Changes between Version 56 and Version 57 of Writing Rules/Tlmt
- Timestamp:
- Nov 14, 2008, 2:00:34 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/Tlmt
v56 v57 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 single26 target, ''' !my_target''' . The '''!my_initiator''' module behavior is modeled by25 Figure 1 presents a minimal system containing one single initiator, '''my_initiator''' , and one single 26 target, '''my_target''' . The '''my_initiator''' module behavior is modeled by 27 27 the SC_THREAD '''execLoop()''', that contains an infinite loop. 28 28 The call-back function '''my_nb_transport_bw()''' is executed when a VCI response packet is received by the initiator module. … … 40 40 = C) VCI initiator Modeling = 41 41 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.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. 44 44 45 45 The initiator local time is contained in a member variable named '''m_localTime''', of type '''sc_core::sc_time'''. The … … 65 65 66 66 The '''execLoop()''' method, describing the initiator behaviour must be declared as a member function of 67 the ''' !my_initiator''' class.68 69 Finally, the class ''' !my_initiator''' must contain a member variable '''p_vci_init''', of type '''tlmt_simple_initiator_socket'''.67 the '''my_initiator''' class. 68 69 Finally, the class '''my_initiator''' must contain a member variable '''p_vci_init''', of type '''tlmt_simple_initiator_socket'''. 70 70 This member variable represents the VCI initiator port. It has 3 template parameters, two of which are used to help 71 71 connecting the response callback function ('''my_initiator''' in the example, first template parameter) to the port and … … 73 73 ('''soclib_vci_types''' in the following example, third template parameter). '''soclib_vci_types''' is indeed a C++ structure containing two 74 74 typedef: the first typedef defines the payload type as VCI, and the other defines the TLM phase type. The phase type can either 75 be ''' !TLMT_CMD''' (i.e. the transaction indicates the emission of a command by an initiator and its reception by a target),76 ''' !TLMT_RSP''' (i.e. the transaction indicates the emission of a response by a target and its reception by an initiator),77 or ''' !TLMT_INFO''' (i.e. a TLM-T transaction emitted by one side of a link (vci, irq or fifo) to get information such as time75 be '''TLMT_CMD''' (i.e. the transaction indicates the emission of a command by an initiator and its reception by a target), 76 '''TLMT_RSP''' (i.e. the transaction indicates the emission of a response by a target and its reception by an initiator), 77 or '''TLMT_INFO''' (i.e. a TLM-T transaction emitted by one side of a link (vci, irq or fifo) to get information such as time 78 78 and activity on the other side of the link). 79 79 … … 170 170 171 171 To receive a VCI response packet, a call-back function must be defined as a member function of the 172 class ''' !my_initiator'''. This call-back function (named '''my_nb_transport_bw()''' in the example), must be172 class '''my_initiator'''. This call-back function (named '''my_nb_transport_bw()''' in the example), must be 173 173 declared in the '''my_initiator''' class and 174 174 is executed each time a VCI response packet is received on the '''p_vci_init''' port. The function name is not … … 192 192 == C.3) Initiator Constructor == 193 193 194 The constructor of the class ''' !my_initiator''' must initialize all the member variables, including194 The constructor of the class '''my_initiator''' must initialize all the member variables, including 195 195 the '''p_vci_init''' port. The '''my_nb_transport_bw()''' call-back function being executed in the context of the thread sending 196 196 the response packet, a link between the '''p_vci_init''' port and the call-back function must be established. … … 480 480 In the proposed example, the target handles all VCI commands in the same way. To simplify the model, there is no real error management. 481 481 482 The class ''' !my_target''' inherits from the class '''sc_core::sc_module'''. The class '''!my_target''' contains a member482 The class '''my_target''' inherits from the class '''sc_core::sc_module'''. The class '''my_target''' contains a member 483 483 variable '''p_vci_target''' of type '''tlmt_simple_target_socket'''. This object has 3 template parameters, that are identical to 484 484 those used for declaring initiator ports (see above). … … 513 513 == D.3) Target Constructor == 514 514 515 The constructor of the class ''' !my_target''' must initialize all the member variables, including515 The constructor of the class '''my_target''' must initialize all the member variables, including 516 516 the '''p_vci_target''' port. The '''my_nb_transport_fw()''' call-back function being executed in the context of the thread sending 517 517 the command packet, a link between the '''p_vci_target''' port and the call-back function must be established.