Changes between Version 8 and Version 9 of Writing Rules/RISC
- Timestamp:
- Jan 7, 2008, 7:46:35 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/RISC
v8 v9 138 138 [[Image(caba_wrapper.png, nolink)]] 139 139 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.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 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. 141 141 142 142 The SystemC code for the generic CABA wrapper is presented below : … … 150 150 151 151 //////// ports //////// 152 sc_in<bool> p_irq[iss_t ::n_irq];152 sc_in<bool> *p_irq ; 153 153 IcacheProcessorPort p_icache ; 154 154 DcacheProcessorPort p_dcache ; … … 160 160 int ident ) : 161 161 BaseModule(insname), 162 p_icache("icache"),163 p_dcache("dcache"),164 p_resetn("resetn"),165 p_clk("clk"),166 162 m_iss(ident) 167 163 { 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 } 168 171 SC_METHOD(transition); 169 172 dont_initialize(); … … 223 226 p_icache.req = m_ins_asked; 224 227 p_icache.type = m_ins_type ; 225 p_icache.mode = m_ins_mode ;226 228 p_icache.adr = m_ins_address; 227 229 p_dcache_req = m_mem_asked ; 228 230 p_dcache_type = m_mem_type ; 229 p_dcache_mode = m_mem_mode ;230 231 p_dcache.adr = m_mem_address; 231 232 p_dcache.wdata = m_mem_wdata; … … 234 235 235 236 = F) TLM-T modeling = 236 237 237 The TLM-T modeling for a complete CPU (processor + cache) is presented in figure 3. 238 238 To 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. … … 273 273 } 274 274 }}} 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.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. 278 278 279 279 At 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. 282 282 283 283 The SystemC TLM-T model for the VciXcache module is presented below : … … 289 289 /////// ports /////// 290 290 VciInitiatorPort<vci_param> p_vci ; 291 IrqInPort p_irq[iss_t ::n_irq];291 SynchroInPort * p_irq ; 292 292 293 293 /////// constructor ///// … … 301 301 uint32_t icache_nwords) 302 302 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) ; }304 303 BaseModule(name), 305 304 m_iss(processorIdent), 306 305 m_time(0) 307 306 { 307 for (uint32_t i = 0 ; i < iss_t::n_irq ; i++) { 308 new(&p_irq[i])SynchroInPort ("irq", i, this, &VciXcache::irqReceived) ; 309 } 308 310 m_initiator_index = initiatorIndex ; 309 311 m_counter = 0 ; … … 392 394 m_irqtime[p_irq[index] = time ; 393 395 } // end irqReceived() 394 395 396 397 398 396 } // end class VciXcache 397 }}} 398 399 400