Changes between Version 59 and Version 60 of Writing Rules/Tlmt
- Timestamp:
- Nov 15, 2008, 3:10:42 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/Tlmt
v59 v60 172 172 173 173 To receive a VCI response packet, a call-back function must be defined as a member function of the 174 class '''my_initiator'''. This call-back function (named ''' my_nb_transport_bw()''' in the example), must be174 class '''my_initiator'''. This call-back function (named '''vci_rsp_received()''' in the example), must be 175 175 declared in the '''my_initiator''' class and 176 176 is executed each time a VCI response packet is received on the '''p_vci_init''' port. The function name is not 177 177 constrained, but the arguments must respect the following prototype: 178 178 {{{ 179 tlm::tlm_sync_enum my_nb_transport_bw// for resp messages180 ( soclib_vci_types:: vci_payload_type &payload, // payload181 soclib_vci_types::tlm t_phase_type &phase, // transaction phase179 tlm::tlm_sync_enum vci_rsp_received // for resp messages 180 ( soclib_vci_types::tlm_payload_type &payload, // payload 181 soclib_vci_types::tlm_phase_type &phase, // transaction phase 182 182 sc_core::sc_time &time); // resp time 183 183 }}} 184 184 The return value (type tlm::tlm_sync_enum) must be sytematically set to tlm::TLM_COMPLETED in this implementation 185 185 The function parameters are identical to those described in the forward transport function 186 186 187 The actions executed by the call-back function depend on the response transaction type ('''m_command''' field), as well as187 In the general case, the actions executed by the call-back function depend on the response transaction type ('''m_command''' field), as well as 188 188 the '''pktid''' and '''trdid''' fields. 189 189 190 In the proposed example : 191 * In case of of a blocking read , the call-back function updates the local time, and reactivates the suspended thread. 192 * In case of a non-blocking write, the call-back function does nothing. 193 190 For sake of simplicity, in the proposed example the call-back function does not make any distinction between VCI transaction types : 191 194 192 == C.3) Initiator Constructor == 195 193