Changes between Version 57 and Version 58 of Writing Rules/Tlmt
- Timestamp:
- Nov 15, 2008, 1:54:21 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/Tlmt
v57 v58 23 23 = B) Single VCI initiator and single VCI target = 24 24 25 Figure 1 presents a minimal system containing one single initiator, '''my_initiator''' , and one single25 Figure 1 presents a minimal TLM-T system containing one single initiator, '''my_initiator''' , and one single 26 26 target, '''my_target''' . The '''my_initiator''' module behavior is modeled by 27 27 the SC_THREAD '''execLoop()''', that contains an infinite loop. … … 30 30 [[Image(tlmt_figure_1.png, nolink)]] 31 31 32 Unlike the initiator, the target module has a purely reactive behaviour and is therefore modeled as a call-back function.33 In other words, there is no need to use a SC_THREAD : The target behaviour is entirely described by the call-back32 Unlike the initiator, the target module has a purely reactive behaviour and is therefore modeled as a simple call-back function. 33 In other words, there is no need to use a SC_THREAD for these simple target components: the target behaviour is entirely described by the call-back 34 34 function '''my_nb_transport_fw()''', 35 35 that is executed when a VCI command packet is received by the target module. … … 41 41 42 42 In the proposed example, the initiator module is modeled by the '''my_initiator''' class. 43 This class inherits from the SystemC '''sc_core::sc_module''' class, that acts as the root class for all TLM-T modules.43 This class inherits from the standard SystemC '''sc_core::sc_module''' class, that acts as the root class for all TLM-T modules. 44 44 45 45 The initiator local time is contained in a member variable named '''m_localTime''', of type '''sc_core::sc_time'''. The 46 local time can be accessed through the use ofthe following accessors: '''addLocalTime()''', '''setLocalTime()'''46 local time can be accessed with the following accessors: '''addLocalTime()''', '''setLocalTime()''' 47 47 and '''getLocalTime()'''. 48 48 {{{ … … 81 81 82 82 To send a VCI command packet, the '''execLoop()''' method must use the '''nb_transport_fw()''' method, that is a member 83 function of the '''p_vci_init''' port. The prototype is the following:83 function of the '''p_vci_init''' port. The prototype of this method is the following: 84 84 {{{ 85 85 86 86 tlm::tlm_sync_enum nb_transport_fw /// sync status 87 ( soclib_vci_types:: vci_payload_type &payload, ///< VCI payload pointer87 ( soclib_vci_types::tlm_payload_type &payload, ///< VCI payload pointer 88 88 soclib_vci_types::tlmt_phase_type &phase, ///< transaction phase 89 89 sc_core::sc_time &time); ///< time