Changes between Version 7 and Version 8 of Writing Rules/Tlmt
- Timestamp:
- Dec 25, 2007, 2:58:39 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/Tlmt
v7 v8 43 43 {{{ 44 44 class vci_cmd_t { 45 vci_ command_t cmd;// VCI transaction type46 vci_ address_t *address; // pointer to an array of addresses on the target side47 uint32_t 45 vci_param::vci_command_t cmd; // VCI transaction type 46 vci_param::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 48 48 bool contig; // contiguous addresses (when true) 49 49 vci_param::vci_data_t *buf; // pointer to the local buffer on the initiator 50 uint32_t 50 uint32_t length; // number of words in the packet 51 51 bool eop; // end of packet marker 52 52 uint32_t srcid; // SRCID VCI 53 uint32_t 54 uint32_t 53 uint32_t trdid; // TRDID VCI 54 uint32_t pktid; // PKTID VCI 55 55 } 56 56 }}} … … 97 97 A 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 98 99 == C.4) TLM-Tinitiator example ==99 == C.4) VCI initiator example == 100 100 101 101 {{{ … … 194 194 }}} 195 195 196 == D.4) TLM-Ttarget example ==196 == D.4) VCI target example == 197 197 {{{ 198 198 template <typename vci_param> … … 239 239 } // end class my_target 240 240 }}} 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 252 class my_processor : Tlmt::BaseModule { 253 public: 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 269 private: 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