Changes between Version 7 and Version 8 of Writing Rules/Tlmt


Ignore:
Timestamp:
Dec 25, 2007, 2:58:39 PM (16 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Writing Rules/Tlmt

    v7 v8  
    4343{{{
    4444class vci_cmd_t {
    45 vci_command_t  cmd;     // VCI transaction type
    46 vci_address_t  *address;  // pointer to an array of addresses on the target side
    47 uint32_t        *be;  // pointer to an array of byte_enable signals
     45vci_param::vci_command_t  cmd;  // VCI transaction type
     46vci_param::vci_address_t  *address;  // pointer to an array of addresses on the target side
     47uint32_t  *be;  // pointer to an array of byte_enable signals
    4848bool   contig;    // contiguous addresses (when true)
    4949vci_param::vci_data_t  *buf;  // pointer to the local buffer on the initiator
    50 uint32_t        length;  // number of words in the packet
     50uint32_t  length;  // number of words in the packet
    5151bool  eop;  // end of packet marker
    5252uint32_t  srcid;  // SRCID VCI
    53 uint32_t        trdid;  // TRDID VCI
    54 uint32_t        pktid;  // PKTID VCI
     53uint32_t  trdid;  // TRDID VCI
     54uint32_t  pktid;  // PKTID VCI
    5555}
    5656}}}
     
    9797A 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.
    9898
    99 == C.4) TLM-T initiator example ==
     99== C.4) VCI initiator example ==
    100100
    101101{{{
     
    194194}}}
    195195 
    196 == D.4) TLM-T target example ==
     196== D.4) VCI target example ==
    197197 {{{
    198198template <typename vci_param>
     
    239239} // end class my_target
    240240}}}
     241
     242= E) Interconnection network modeling =
     243
     244= F) Interruption modeling =
     245
     246== F.1) Source modeling ==
     247
     248== F.2) Destination modeling ==
     249
     250== F.3)  processor with interrupt example ==
     251
     252class my_processor : Tlmt::BaseModule {
     253public:
     254    IrqInPort           p_irq;
     255               
     256    // constructor
     257    my_processor (      sc_module_name  name,
     258                uint32_t  lookahead) :
     259    p_irq(“irq”, this, &my_initiator::irqReceived),
     260    m_time(0),
     261    BaseModule(name)
     262    {
     263    m_lookahed = lookahead;
     264    m_counter = 0;
     265    m_irqset = false;
     266    SC_THREAD(execLoop);
     267} // end constructor
     268               
     269private:
     270    tlmt_Time  m_time;  // local clock
     271    bool  m_irqset;  // pending interrupt request
     272    sc_time  m_irqtime;  // irq date
     273    uint32_t  m_counter;  // iteration counter
     274    uint32_t  m_lookahed;  // lookahead value
     275
     276    // thread
     277    void execLoop()
     278    {
     279    while(1) {
     280        ...
     281        // test interrupts
     282        if (m_irqset && (m_irqtime <= m_time.getTime())) {
     283                                        // traitement interrupt
     284                                        }
     285                                ...
     286        // lookahead management
     287        m_counter++ ;
     288        if (m_counter >= m_lookahead) {
     289            m_counter = 0 ;
     290            wait(SC_ZERO_TIME) ;
     291            } // end if
     292        m_time.addtime(1) ;
     293        } // end while
     294    } // end execLoop()
     295
     296// call-back function
     297     void  irqReceived(bool val, sc_time time)
     298    {
     299    m_irqset = val;
     300    m_irqtime = time;
     301    } // end irqReceived()
     302} // end class my_processor
     303
     304