Changes between Version 25 and Version 26 of Writing Rules/Tlmt
- Timestamp:
- Dec 28, 2007, 4:05:25 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/Tlmt
v25 v26 41 41 {{{ 42 42 void cmdSend(vci_cmd_t *cmd, // VCI command packet 43 sc_timetime); // initiator local time43 uint32_t time); // initiator local time 44 44 }}} 45 45 … … 62 62 The possible values for the '''cmd''' fied are `vci_param::CMD_READ`, `vci_param::CMD_WRITE`, `vci_param::CMD_READ_LOCKED`, 63 63 and `vci_param::CMD_STORE_COND`. 64 '''address'''es may be any value contained in the whole system address space.65 64 The '''contig''' field can be used for optimisation. 66 65 … … 71 70 To receive a VCI response packet, a call-back function must be defined as a member function of the class '''my_initiator'''. This call-back function (named '''rspReceived()''' in the example), will be executed each time a VCI response packet is received on the '''p_vci''' port. The function name is not constrained, but the arguments must respect the following prototype: 72 71 {{{ 73 void rspReceived(vci_rsp_t *rsp, sc_timetime)72 void rspReceived(vci_rsp_t *rsp, uint32_t time) 74 73 }}} 75 74 … … 103 102 == C.4) Lookahead parameter == 104 103 105 The SystemC simulation engine behaves as a cooperative, non-preemptive multi-tasks system. Any thread in the system must stop execution after a given time, in order to allow the other threads to execute. With the proposed approach, a TLM-T initiator will never stop if it does not execute blocking communication (such as a processor that has all code and data in the L1 caches).104 The SystemC simulation engine behaves as a cooperative, non-preemptive multi-tasks system. Any thread in the system must stop execution after at some point, in order to allow the other threads to execute. With the proposed approach, a TLM-T initiator will never stop if it does not execute blocking communication (such as a processor that has all code and data in the L1 caches). 106 105 107 106 To solve this problem, it is necessary to define - for each initiator module- a '''lookahead''' parameter. This parameter defines the maximum number of cycles that can be executed by the thread before it stops. The '''lookahead''' parameter allows the system designer to bound the de-synchronization between threads. … … 163 162 164 163 //////////////// call-back function 165 void rspReceived(vci_cmd_t *cmd, sc_timersp_time)164 void rspReceived(vci_cmd_t *cmd, uint32_t rsp_time) 166 165 { 167 166 if(cmd == VCI_CMD_READ) { … … 184 183 {{{ 185 184 void cmdReceived(vci_cmd_t *cmd, 186 sc_timetime)185 uint32_t time) 187 186 }}} 188 187 For the read and write transactions, the actual data transfer is performed by this '''cmdReceived()''' function. … … 194 193 {{{ 195 194 void rspSend( vci_rsp_t *cmd, 196 sc_timetime)195 uint32_t time) 197 196 }}} 198 197 For a reactive target, the response packet date is computed as the command packet date plus the target intrinsic latency. … … 216 215 my_target (sc_module_name name, 217 216 uint32_t targetIndex, 218 sc_timelatency):217 uint32_t latency): 219 218 p_vci(“vci”,this, &my_target::cmdReceived), 220 219 tlmt::BaseModule(name) … … 226 225 private: 227 226 vci_param::data_t m_data[8]; // local buffer 228 sc_timem_latency; // target latency227 uint32_t m_latency; // target latency 229 228 uint32_t m_index; // target index 230 229 vci_rsp_t m_rsp; // paquet VCI réponse … … 232 231 /////////////// call-back function 233 232 sc_time cmdReceived(vci_cmd_t *cmd, 234 sc_timecmd_time)233 uint32_t cmd_time) 235 234 { 236 235 if(cmd->cmd == VCI_CMD_WRITE) { … … 247 246 rsp_time = cmd_time + latency; 248 247 p_vci.rspSend(&m_rsp, rsp_time) ; 249 return (rsp_time + (sc_time)cmd->length);248 return (rsp_time + cmd->length); 250 249 } // end cmdReceived() 251 250 } // end class my_target … … 293 292 The source module (named '''my_source''' in this example) must contain a member variable '''p_irq''' of type '''!IrqOutPort'''. To activate, or desactivate an interruption, the source module must use the '''irqSend()''' method, that is a member function of the '''!IrqOutPort''' class. Those interrupt packets transport both a Boolean, and a date. The '''irqSend()''' prototype is defined as follows : 294 293 {{{ 295 void irqSend( bool val, sc_timetime)294 void irqSend( bool val, uint32_t time) 296 295 }}} 297 296 … … 340 339 tlmt_time m_time; // local clock 341 340 bool m_irqpendig; // pending interrupt request 342 sc_timem_irqtime; // irq date341 uint32_t m_irqtime; // irq date 343 342 uint32_t m_counter; // iteration counter 344 343 uint32_t m_lookahed; // lookahead value