Changes between Version 29 and Version 30 of Writing Rules/Tlmt


Ignore:
Timestamp:
Jan 7, 2008, 9:00:03 PM (16 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Writing Rules/Tlmt

    v29 v30  
    7373}}}
    7474
    75 The informations transported by a VCI command packet are defined below:
     75The informations transported by a VCI response packet are defined below:
    7676{{{
    7777class vci_rsp_t {
     
    131131               
    132132private:
    133     tlmt_time m_time;           // local clock
    134     uint32_t m_index;           // initiator index
    135     uint32_t m_counter; // iteration counter
    136     uint32_t m_lookahed;        // lookahead value
    137     vci_param::data_t m_data[8];        // local buffer
    138     vci_cmd_t   m_cmd;          // paquet VCI commande
    139     sc_event  m_rsp_received // synchronisation signal
     133    tlmt_time m_time;  // local clock
     134    uint32_t m_index;  // initiator index
     135    uint32_t m_counter;  // iteration counter
     136    uint32_t m_lookahed;  // lookahead value
     137    vci_param::data_t m_data[8];         // local buffer
     138    vci_cmd_t   m_cmd;  // paquet VCI commande
     139    sc_event  m_rsp_received; // synchronisation signal
    140140
    141141    //////// thread
     
    145145        …
    146146        m_cmd.cmd = VCI_CMD_READ;
    147         p_vci.cmdSend(&m_cmd, m_time.getTime());        // lecture bloquante
     147        p_vci.send(&m_cmd, m_time.getTime());   // lecture bloquante
    148148        wait(m_rsp_resceived);
    149149        …
    150         m_cmd.cmd = VCI_CMD_WRITE;
    151         p_vci.send(VCI_CMD_WRITE,…);   
    152         p_vci.cmdSend(&m_cmd, m_time.getTime());        // écriture non bloquante
     150        m_cmd.cmd = VCI_CMD_WRITE;     
     151        p_vci.send(&m_cmd, m_time.getTime());   // écriture non bloquante
    153152        ...
    154153        // lookahead management
     
    191190== D.2) Sending a VCI response packet ==
    192191
    193 To send a VCI response packet the '''cmdReceived()''' function must use the '''rspSend()''' method, that is a member function of the class '''!VciTargetPort''', and has the following prototype:
    194 {{{
    195 void  rspSend( vci_rsp_t *cmd, 
     192To send a VCI response packet the '''cmdReceived()''' function must use the '''send()''' method, that is a member function of the class '''!VciTargetPort''', and has the following prototype:
     193{{{
     194void  send( vci_rsp_t *cmd,     
    196195           uint32_t time)       
    197196}}}
     
    246245    m_rsp.error = 0;
    247246    rsp_time = cmd_time + latency;
    248     p_vci.rspSend(&m_rsp, rsp_time) ;
     247    p_vci.send(&m_rsp, rsp_time) ;
    249248    return (rsp_time + cmd->length);
    250249   } // end cmdReceived()
     
    291290== F.1) Source modeling ==
    292291
    293 The source module (named '''my_source''' in this example) must contain a member variable '''p_irq''' of type '''!SynchroOutPort'''. To activate, or desactivate an interruption, the source module must use the '''synchroSend()''' method, that is a member function of the '''!SynchroOutPort''' class. Those interrupt packets transport both a Boolean, and a date. The '''synchroSend()''' prototype is defined as follows :
    294 {{{
    295 void  synchroSend( bool  val, uint32_t  time)
     292The source module (named '''my_source''' in this example) must contain a member variable '''p_irq''' of type '''!SynchroOutPort'''. To activate, or desactivate an interruption, the source module must use the '''send()''' method, that is a member function of the '''!SynchroOutPort''' class. Those interrupt packets transport both a Boolean, and a date. The '''send()''' prototype is defined as follows :
     293{{{
     294void  send( bool  val, uint32_t  time)
    296295}}}
    297296
     
    299298
    300299The destination module (named here '''my_processor''') must contain a member variable '''p_irq''' of type
    301 '''!SynchroInPortt''', and a call-back function (named here '''synchroReceived()''' that is executed when an interrupt packet is received on the '''p_irq''' port.
     300'''!SynchroInPortt''', and a call-back function (named here '''irqReceived()''' that is executed when an interrupt packet is received on the '''p_irq''' port.
    302301
    303302A link between the '''p_irq''' port and the call-back function mus be established by the port constructor in the constructor of the class '''my_processor''' :
    304303{{{
    305 p_irq(“irq”, this, &my_processor::synchroReceived)
     304p_irq(“irq”, this, &my_processor::irqReceived)
    306305}}}
    307306
     
    311310
    312311The recommended policy for handling interrupts is the following:
    313  * The call-back function '''synchroReceived()''' sets the member variables '''m_irqpending''' and '''m_irqtime''', when a interrupt packet is received on the '''p_irq''' port.
     312 * The call-back function '''irqReceived()''' sets the member variables '''m_irqpending''' and '''m_irqtime''', when a interrupt packet is received on the '''p_irq''' port.
    314313 * The '''execLoop()''' thread must test the '''m_irqpending''' variable at each cycle (i.e. in each iteration of the infinite loop).
    315314 * If there is no interrupt pending, the thread continues execution. If an interrupt is pending, and the interrupt date is larger than the local time, the thread continues execution. If the interrupt date is equal or smaller than the local time, the interrupt is handled.
     
    324323    SynchroInPort               p_irq;
    325324               
    326     // constructor
     325  ////// constructor
    327326    my_processor (sc_module_name        name,
    328327                  uint32_t  lookahead) :
    329     p_irq(“irq”, this, &my_initiator::synchroReceived),
     328    p_irq(“irq”, this, &my_initiator::irqReceived),
    330329    m_time(0),
    331330    tlmt::BaseModule(name)
     
    344343    uint32_t  m_lookahed;  // lookahead value
    345344
    346     // thread
     345    /////////////// thread
    347346    void execLoop()
    348347    {
     
    364363    } // end execLoop()
    365364
    366 // call-back function
    367      void  synchroReceived(bool val, sc_time time)
     365///////////////////////////////////////
     366     void  irqReceived(bool val, sc_time time)
    368367    {
    369368    m_irqpending = val;