Changes between Version 8 and Version 9 of Writing Rules/RISC


Ignore:
Timestamp:
Jan 7, 2008, 7:46:35 PM (16 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Writing Rules/RISC

    v8 v9  
    138138[[Image(caba_wrapper.png, nolink)]]
    139139
    140 To communicate with the '''!VciXcache''', the '''!IssWrapper''' class contains two member variables '''p_icache''', of type '''!IcacheProcessorPort''' and '''p_dcache''', of type '''!DcacheProcessorPort'''. It contains also N member variables '''p_irq[i]''', of type '''sc_in<bool>''', representing the interrupt ports. The number N of interrupt ports depends on the wrapped ISS, an is defined by the '''n_irq''' member variable of the '''iss_t''' class.
     140To communicate with the '''!VciXcache''', the '''!IssWrapper''' class contains two member variables '''p_icache''', of type '''!IcacheProcessorPort''' and '''p_dcache''', of type '''!DcacheProcessorPort'''. It contains also the member variable '''p_irq''', That is a pointer to an array of ports of type '''sc_in<bool> *'''. This array represents the interrupt ports. The number N of interrupt ports depends on the wrapped processor, an is defined by the '''n_irq''' member variable of the '''iss_t''' class.
    141141
    142142The SystemC code for the generic CABA wrapper is presented below :
     
    150150
    151151//////// ports ////////
    152 sc_in<bool>  p_irq[iss_t ::n_irq] ;
     152sc_in<bool>  *p_irq ;
    153153IcacheProcessorPort  p_icache ;
    154154DcacheProcessorPort  p_dcache ;
     
    160160           int  ident ) :
    161161    BaseModule(insname),
    162     p_icache("icache"),
    163     p_dcache("dcache"),
    164     p_resetn("resetn"),
    165     p_clk("clk"),
    166162    m_iss(ident)
    167163    {
     164    p_icache("icache") ;
     165    p_dcache("dcache") ;
     166    p_resetn("resetn") ;
     167    p_clk("clk") ;
     168    for (uint32_t i = 0 ; i < iss_t::n_irq ; i++) {
     169        new(&p_irq[i]) sc_in<bool> ("irq", i) ;
     170    }
    168171    SC_METHOD(transition);
    169172    dont_initialize();
     
    223226p_icache.req = m_ins_asked;
    224227p_icache.type = m_ins_type ;
    225 p_icache.mode = m_ins_mode ;
    226228p_icache.adr = m_ins_address;
    227229p_dcache_req = m_mem_asked ;
    228230p_dcache_type = m_mem_type ;
    229 p_dcache_mode = m_mem_mode ;
    230231p_dcache.adr = m_mem_address;
    231232p_dcache.wdata = m_mem_wdata; 
     
    234235
    235236= F) TLM-T modeling =
    236 
    237237The TLM-T modeling for a complete CPU (processor + cache) is presented in figure 3.
    238238To increase the simulation speed, the TLM-T wrapper is the cache controler itself, and it is implemented as the class ''' !VciXcache'''. This class contains the SC_THREAD '''execLoop()''' implementing the PDES process, and the '''m_time''' member variable implementing the associated local clock. The class '''!VciXcache''' inherit the class '''Tlmt::!ModuleBase''', that is the basis for all TLM-T modules.
     
    273273}
    274274}}}
    275 The '''cacheAccess()''' function détermines the actions to be done.
    276 In case of data or instruction MISS, the '''cacheAccess()''' function sends the proper VCI command packet on the '''p_vci''' port, and the '''exedcLoop()''' thread is suspended.
    277 In case of data write, the the '''cacheAccess()''' function sends the proper VCI command packet on the '''p_vci''' port, but the '''exedcLoop()''' thread is not suspended.
     275The '''cacheAccess()''' function détermines the actions to be done :
     276 * In case of data or instruction MISS, the '''cacheAccess()''' function sends the proper VCI command packet on the '''p_vci''' port, and the '''exedcLoop()''' thread is suspended.
     277 * In case of data write, the the '''cacheAccess()''' function sends the proper VCI command packet on the '''p_vci''' port, but the '''exedcLoop()''' thread is not suspended.
    278278
    279279At each iteration in the execution loop, the '''cacheAccess()''' method updates the local clock (variable '''m_time''') :
    280  The local time is simply incremented by one cycle, if the cache controller is able to answer immediately to the processor requests.
    281 • The local time is updated using the date containeded in the VCI response packet in case of MISS.?
     280 * The local time is simply incremented by one cycle, if the cache controller is able to answer immediately to the processor requests.
     281 * The local time is updated using the date containeded in the VCI response packet in case of MISS.
    282282
    283283The SystemC TLM-T model for the VciXcache module is presented below :
     
    289289/////// ports ///////
    290290VciInitiatorPort<vci_param>  p_vci ;
    291 IrqInPort  p_irq[iss_t ::n_irq] ;
     291SynchroInPort  * p_irq ;
    292292
    293293/////// constructor /////
     
    301301          uint32_t  icache_nwords)
    302302    p_vci(« vci », this, &VciXcache::rspReceived, &m_time) ,
    303     for (uint32_t i = 0 ; i < iss_t ::n_irq ; i++) { p_irq[i] (« irq », i, this, &VciXcache::irqReceived) ; }
    304303    BaseModule(name),
    305304    m_iss(processorIdent),
    306305    m_time(0)
    307306    {
     307    for (uint32_t i = 0 ; i < iss_t::n_irq ; i++) {
     308        new(&p_irq[i])SynchroInPort ("irq", i, this, &VciXcache::irqReceived) ;
     309    }
    308310    m_initiator_index = initiatorIndex ;
    309311    m_counter = 0 ;
     
    392394    m_irqtime[p_irq[index] = time ;
    393395    } // end irqReceived()
    394 
    395        
    396 
    397 
    398 
     396} // end class VciXcache
     397}}}     
     398
     399
     400