Changes between Version 71 and Version 72 of Writing Rules/Tlmt
- Timestamp:
- Nov 15, 2008, 6:39:02 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/Tlmt
v71 v72 90 90 Experiments are currently in progress to evaluate the performance degradation incurred by this byte formatting. 91 91 It is therefore possible that the types of the '''m_data''' and '''m_byte_enable''' of the '''tlmt_vci_transaction''' 92 will be changed to '''uint32*''' in a near future.92 will be changed to '''uint32*''' . 93 93 94 94 = D) VCI initiator Modeling = 95 95 96 == D.1) Member variables ==96 == D.1) Member variables & methods == 97 97 98 98 In the proposed example, the initiator module is modeled by the '''my_initiator''' class. … … 122 122 The '''execLoop()''' method, describing the initiator behaviour must be declared as a member function. 123 123 124 Finally, the class '''my_initiator''' must contain a member variable '''p_vci_init''', of type '''tlmt_simple_initiator_socket'''. 124 The '''my_initiator''' class must define a call-back function to handle the VCI response packets. 125 126 Finally, the it must contain a member variable '''p_vci_init''', of type '''tlmt_simple_initiator_socket'''. 125 127 This member variable represents the VCI initiator port. 126 128 127 129 == D.2) Sending a VCI command packet == 128 130 129 To send a VCI command packet, the '''execLoop()''' method must use the '''nb_transport_fw()''' method, that is a member130 function of the '''p_vci_init''' port. The prototype of this method is the following:131 To send a VCI command packet, the '''execLoop()''' method must use the '''nb_transport_fw()''' method, defined by TLM2.0, 132 that is a member function of the '''p_vci_init''' port. The prototype of this method is the following: 131 133 {{{ 132 134 133 135 tlm::tlm_sync_enum nb_transport_fw 134 136 ( soclib_vci_types::tlm_payload_type &payload, // VCI payload pointer 135 soclib_vci_types::tlm_phase_type &phase, // transaction phase (TLMT_CMD)137 soclib_vci_types::tlm_phase_type &phase, // transaction phase (TLMT_CMD) 136 138 sc_core::sc_time &time); // local time 137 139 }}} 138 140 139 The first argument is a pointer to the payload, the second represents the phase (TLMT_CMD in this case), and the third141 The first argument is a pointer to the payload, the second represents the phase, and the third 140 142 argument contains the initiator local time. 141 143 … … 148 150 149 151 To receive a VCI response packet, a call-back function must be defined as a member function of the 150 class '''my_initiator'''. This call-back function (named '''vci_rsp_received()''' in the example), 151 is executed each time a VCI response packet is received on the '''p_vci_init''' port. The function name is not152 constrained, but the arguments must respect the following prototype:152 class '''my_initiator'''. This call-back function (named '''vci_rsp_received()''' in the example), must be linked to 153 the '''p_vci_init''' port, and is executed each time a VCI response packet is received on the '''p_vci_init''' port. 154 The function name is not constrained, but the arguments must respect the following prototype: 153 155 {{{ 154 156 tlm::tlm_sync_enum vci_rsp_received … … 159 161 The return value (type tlm::tlm_sync_enum) is not used in this tlmt implementation, and must be sytematically set to tlm::TLM_COMPLETED. 160 162 161 In the general case, the actions executed by the call-back function depend on the response transaction type ('''m_command''' field), as well as162 the '''pktid''' and '''trdid''' fields.163 In the general case, the actions executed by the call-back function depend on the transaction type defined in the payload 164 ('''m_command''', '''m_pktid''' and '''m_trdid''' fields). 163 165 For sake of simplicity, the call-back function proposed in the example below does not make any distinction between transaction types. 164 166 … … 169 171 the response packet, a link between the '''p_vci_init''' port and this call-back function must be established. 170 172 171 The '''my_initiator''' constructor for the '''p_vci_init''' object must be called with the following arguments:173 The constructor for the '''p_vci_init''' port must be called with the following arguments: 172 174 {{{ 173 175 p_vci_init.register_nb_transport_bw(this, &my_initiator::vci_rsp_received); … … 181 183 182 184 To solve this issue, it is necessary to define -for each initiator module- a '''lookahead''' parameter. This parameter defines the maximum 183 number of cycles that can be executed by the thread before it is automatically stopped. The '''lookahead''' parameter allows the system designer185 number of cycles that can be executed by the thread before it is descheduled. The '''lookahead''' parameter allows the system designer 184 186 to bound the de-synchronization time interval between threads. 185 187