32 | | In the proposed example, the initiator module is modeled by the '''!VciSimpleInitiator''' class. This class inherits from the '''soclib::tlmt::BaseModule''' class, that acts as the root class for all TLM-T modules. The process time, as well as other useful process attributes, is contained in a C++ structure called a '''tlmt_thread_context'''.As there is only one thread in this module, there is only one member variable '''c0''' of type '''tlmt_core::tlmt_thread_context'''. '''c0''' mostly corresponds to the PDES process local time ('''H''' on the figure). Time associated to the '''c0''' object can be accessed through the getter function '''time()''', and setter functions '''set_time()''' and '''update_time()'''. |
33 | | |
34 | | The '''execLoop()''' method, describing the initiator activity must be declared as a member function of the '''my_initiator''' class. |
35 | | |
36 | | Finally, the class '''my_initiator''' must contain a member variable '''p_vci''', of type '''!VciInitiatorPort'''. This object has a template parameter <'''vci_param'''> defining the widths of the VCI ADRESS & DATA fields. |
| 32 | In the proposed example, the initiator module is modeled by the '''!VciSimpleInitiator''' class. This class inherits from the '''soclib::tlmt::!BaseModule''' class, that acts as the root class for all TLM-T modules. The process time, as well as other useful process attributes, is contained in a C++ structure called a '''tlmt_core::tlmt_thread_context'''.As there is only one thread in this module, there is only one member variable '''c0''' of type '''tlmt_core::tlmt_thread_context'''. '''c0''' mostly corresponds to the PDES process local time ('''H''' on the figure). In all the TLM-T models, time is handled by the '''tlmt_core::tlmt_time''' class. In order to get the time associated to the initiator process, one should use the getter function '''time()''' on the '''c0''' object, and the setter functions '''set_time()''' and '''update_time()''' to assign a new time to the process. |
| 33 | |
| 34 | The '''execLoop()''' method, describing the initiator behaviour must be declared as a member function of the '''!VciSimpleInitiator''' class. |
| 35 | |
| 36 | Finally, the class '''!VciSimpleInitiator''' must contain a member variable '''p_vci''', of type '''!VciInitiator'''. This object has a template parameter <'''vci_param'''> defining the widths of the VCI ADDRESS and DATA fields. |