Changes between Version 5 and Version 6 of Writing Rules/Tlmt


Ignore:
Timestamp:
Dec 25, 2007, 12:16:29 AM (16 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Writing Rules/Tlmt

    v5 v6  
    5858and VCI_CMD_STORECONDITIONAL  Le champ address contient un ensemble d’adresses valides dans l’espace mémoire partagé du système modélisé. The contig field can be used for optimisation.
    5959
    60 The '''cmdSend()''' function is non-blocking. To implement a blocking transaction (such as a cache line read, where the processor is blocked during the VCI transaction), the model designer must use the '''wait()''' method, that is a member function of the '''VciInitiatorPort''' class. The '''execLoop()''' thread is suspended; It will be activated when the response packet is received by the '''notify()''' method, that is also a member function of the '''VciInitiatorPort'''.
     60The '''cmdSend()''' function is non-blocking. To implement a blocking transaction (such as a cache line read, where the processor is ''frozen'' during the VCI transaction), the model designer must use the '''wait()''' method, that is a member function of the '''VciInitiatorPort''' class. The '''execLoop()''' thread is suspended. It will be activated when the response packet is received by the '''notify()''' method, that is also a member function of the '''VciInitiatorPort'''.
    6161
    6262== C.2) Receiving a VCI response packet ==
    6363
     64To receive a VCI response packet, a call-back function must be defined as a member function of the class '''my_initiator'''. This call-back function (named '''rspReceived()''' in the example), will be executed each time a VCI response packet is received on the '''p_vci''' port. The function name is not constrained, but the arguments must respect the following prototype:
     65{{{
     66void  rspReceived(vci_rsp_t  *rsp,
     67               sc_time  time)
     68}}}
     69The informations transported by a VCI command packet are defined below:
     70{{{
     71class vci_rsp_t {
     72vci_command_t  cmd;  // VCI transaction type
     73uint32_t  length;  // number of words in the packet
     74bool  eop;  // end of packet marker
     75uint32_t  srcid;  // SRCID VCI
     76uint32_t  trdid;  // TRDID VCI
     77uint32_t  pktid;  // PKTID VCI
     78}
     79}}}
     80The actions executed by the call-back function depend on the transaction type ('''cmd'''  field), as well as the '''pktid''' and '''trdid''' fields. In the proposed example :
     81 * In case of of a blocking read , the call-back function updates the local time, and activates the suspended threadwith the by the '''notify()''' method.
     82 * In case of a non-blocking write, the call-back function does nothing.
     83 
    6484== C.3) Initiator Constructor ==
    6585
     86The constructor of the class'''my_initiator''' must initialize all the member variables, including the VCI port. The '''rspReceived()''' call-back function being executed in the context of the thread sending the response packet, a link between the '''p_vci''' port and the call-back function must be established. Moreover, the '''p_vci''' port must contain a pointer on the initiator local time.
     87The VciInitiatorPort constructor must be called with the following arguments:
     88{{{
     89p_vci(“vci”, this, &my_initiator::rspReceived, &m_time);
     90}}}
     91 
    6692== C.4) Lookahead parameter ==
    6793
    68 == C.5) TLM-T initiator example ==
     94The SystemC simulation engine behaves as a cooperative, non-preemptive multi-tasks system. Any thread in the system must stop execution after a given time, in order to allow the other threds to execute. With the proposed approach, a TLM-T initiator will never stop if it does not execute blocking communication (such as a processor that has all code and data in the L1 caches). This can block the simulation.
     95
     96To solve this problem, it is necessary to define - for each initiator module- a '''lookahead''' parameter. This parameter defines the maximum number of cycles that can be executed by the thread before it stops. The '''lookahead''' parameter allows the system designer to bound the de-synchronization between threads.
     97A small value for this parameter result in a better timing accuracy for the simulation, but implies a larger number of context switch, and a slower simulation speed.
     98
     99== C.4) TLM-T initiator example ==
    69100
    70101{{{