Changes between Version 63 and Version 64 of Writing Rules/Tlmt
- Timestamp:
- Nov 15, 2008, 5:17:19 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/Tlmt
v63 v64 4 4 }}} 5 5 6 Authors : Alain Greiner, François Pêcheux, Emmanuel Viaud, Nicolas Pouillon,Aline Vieira de Mello6 Authors : Alain Greiner, François Pêcheux, Aline Vieira de Mello 7 7 8 8 [[PageOutline]] … … 11 11 12 12 This document is still under development. 13 13 14 It describes the modeling rules for writing TLM-T SystemC simulation models for SoCLib that are 14 15 compliant with the new TLM2.0 OSCI standard. 15 These rules enforce the PDES (Parallel Discrete Event Simulation) principles. Each PDES process involved in 16 the simulation has its own local time, and PDES processes synchronize through messages piggybacked with time information. 16 These rules enforce the PDES (Parallel Discrete Event Simulation) principles. In the TLM-T approach, 17 we don't use anymore the SystemC global time, as each PDES process involved in 18 the simulation has its own local time. PDES processes (implemented as SC_THREADS) synchronize through 19 messages piggybacked with time information. 17 20 Models complying to these rules can be used with the "standard" OSCI simulation engine (SystemC 2.x) and 18 the TLM2.0 protocol, but can 19 also be used also with others simulation engines, especially distributed, parallelized simulation engines. 21 the TLM2.0 protocol, but can also be used also with others simulation engines, especially distributed, parallelized simulation engines. 22 23 The examples presented below use the VCI/OCP communication protocol selected by the SoCLib project, 24 but the TLM-T approach described here is very flexible, and is not limited to the VCI/OCP communication protocol. 20 25 21 26 The interested user should also look at the [WritingRules/General general SoCLib rules]. … … 23 28 = B) Single VCI initiator and single VCI target = 24 29 25 Figure 1 presents a minimal TLM-T system containing one singleinitiator, '''my_initiator''' , and one single26 target, '''my_target''' . The '''my_initiator''' module behavior is modeled by30 Figure 1 presents a minimal system containing one single VCI initiator, '''my_initiator''' , and one single 31 VCI target, '''my_target''' . The '''my_initiator''' module behavior is modeled by 27 32 the SC_THREAD '''execLoop()''', that contains an infinite loop. 28 The call-back function ''' my_nb_transport_bw()''' is executed when a VCI response packet is received by the initiator module.33 The call-back function '''vci_rsp_received()''' is executed when a VCI response packet is received by the initiator module. 29 34 30 35 [[Image(tlmt_figure_1.png, nolink)]] 31 36 32 37 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 function '''my_nb_transport_fw()''', 35 that is executed when a VCI command packet is received by the target module. 38 In other words, there is no need to use a SC_THREAD for this simple target component: the target behaviour is entirely described by the call-back 39 function '''vci_cmd_received()''', that is executed when a VCI command packet is received by the target module. 36 40 37 41 The VCI communication channel is a point-to-point bi-directionnal channel, encapsulating two separated uni-directionnal … … 49 53 sc_core::sc_time m_localTime; // the initiator local time 50 54 ... 51 void addLocalTime(sc_core::sc_time t); // add a valueto the local time55 void addLocalTime(sc_core::sc_time t); // add an increment to the local time 52 56 void setLocalTime(sc_core::sc_time& t); // set the local time 53 57 sc_core::sc_time getLocalTime(void); // get the local time 54 58 }}} 55 59 56 The initiator activity corresponds to the boolean member '''m_activity''' that indicates if the initiator is currently active 57 (i.e. '''true''', wants to participate in the arbitration in the interconnect) or inactive (i.e. '''false''', does not want60 The initiator activity corresponds to the boolean member '''m_activity''' that indicates if the initiator is currently active. 61 This boolean variable is used by the arbitration threads i.e. '''true''', wants to participate in the arbitration in the interconnect) or inactive (i.e. '''false''', does not want 58 62 to participate in the arbitration in the interconnect). The corresponding access functions are '''setActivity()''' and '''getActivity()'''. 59 63 {{{