23 | | The pessimistic PDES algorithm used relies on temporal filtering of the incoming messages. An active component is only allowed to process when it |
24 | | has sufficient timing information on its input ports. For example, an interconnect is only allowed to let a packet reach |
25 | | a given target only when all the initiators that are connected to it have sent at least one packet with their local times. |
26 | | Several experiments have been realized to identify the best way to perform this temporal filtering. The previous |
27 | | implementation relied on sollicited null message, i.e. the interconnect asks all the initiators for their times. This |
28 | | solution only impacts the way the interconnect is written, and the initiators are not aware of the interconnect requests. |
29 | | The experiments have shown that this technique simplifies the writing of the initiator models but also has a strong |
30 | | impact on the simulation time, as the interconnect spends much of its effort consulting the time of the initiators |
31 | | and not passing packets from initiators to targets. The induced overhead is about 90%. |
32 | | |
33 | | The solution retained is now to strictly follow the Chandy-Misra pessimistic algorithm and to reverse the synchronization |
34 | | process by letting the initiators transmit their local time to others according to their own null message policy. The |
35 | | interconnect is much simpler to write, but the initiators have to be modified in order to handle explicitely the |
36 | | sending of null messages. The performance of the simulation is therefore directly linked to the number of generated null |
37 | | messages. When writing an initiator model, this number directly corresponds to the period that separates the sending of two successive null messages. |
| 23 | The pessimistic PDES algorithm relies on temporal filtering of the incoming messages. A PDES process that has N input channels |
| 24 | is only allowed to process when it has timing information on all its input ports. For example, an interconnect is only allowed to let a |
| 25 | command packet reach a given target when all the initiators that can address this target have sent at least one timed message. |
| 26 | To solve this issue the PDES algorithm uses ''nul message''. A null message contain no data, but only a time information. |
| 27 | Moreover, all processes can be in two modes : active & non-active. Only processes that are active participate to the temporal filtering. |
| 28 | |
| 29 | A first implementation of TLMT used sollicited null messages, but the final solution uses direct null-messages, that strictly |
| 30 | follow the Chandy-Misra pessimistic algorithm. Each process cannot run independantly without sending a timed message |
| 31 | for a time larger that a predefined value, called the SYNCHRONIZATION_TIME_QUANTUM. When this time quantum is elapsed, |
| 32 | the process must send a null message on its output ports. |
89 | | latter 3 values are not directly related to VCI but rather to the PDES simulation algorithm used. The '''TLMT_NULL_MESSAGE''' value is used whenever an initiator needs to send its local time to the rest of the platform for synchronization purpose. |
90 | | The '''TLMT_ACTIVE''' and '''TLMT_INACTIVE''' values are used to inform the interconnect that the corresponding initiator must be taken into account during PDES time filtering or not. A programmable component such as a DMA controller, until it |
| 85 | latter 3 values are not directly related to VCI but rather to the PDES simulation algorithm. The '''TLMT_NULL_MESSAGE''' value is used whenever an initiator needs to send its local time to the rest of the platform for synchronization purpose. |
| 86 | The '''TLMT_ACTIVE''' and '''TLMT_INACTIVE''' values are used to inform the interconnect that the corresponding initiator must be taken into account in the |
| 87 | temporal filtering or not. A programmable component such as a DMA controller, until it |
237 | | after at some point, in order to allow the other threads to execute. With the proposed approach, a TLM-T initiator will never stop if |
238 | | it does not execute blocking communication (such as a processor that has all code and data in the L1 caches). |
239 | | |
240 | | To solve this issue, it is necessary to define -for each initiator module- a '''time quantum''' parameter. This parameter defines the maximum |
241 | | delay that separates the sending of two successive null messages. The '''time quantum''' parameter allows the system designer |
242 | | to bound the de-synchronization time interval between threads. |
243 | | |
244 | | A small value for this parameter results in a better timing accuracy for the simulation, but implies a larger number of context switches, |
245 | | and a slower simulation speed. |
246 | | |
247 | | This time quantum parameter is implemented using the '''!QuantumKeeper''' construct already available in TLM2.0. The main |
248 | | difference comes from the fact that this class is just used to manage the synchronization interval between two null |
249 | | messages. More precisely, the '''sync()''' function of '''!QuantumKeeper''' is not used directly, because it implicitely |
250 | | calls a '''wait(x)''' statement (x being a time delay, which is valid in TLM2.0 but forbidden in the presented |
251 | | distributed time approach). The only needed part in this function is the '''reset()''' feature. |
| 234 | at some point, in order to allow the other threads to execute. Moreover each PDES process must send null message periodically. |
| 235 | |
| 236 | To solve this issue, it is necessary to define -for each initiator module- a '''synchronization time quantum''' parameter. This parameter defines |
| 237 | the maximum delay between two successive timed messages. When this time quantum is elapsed, the component send a null message, |
| 238 | and the corresponding thread is descheduled. |
| 239 | |
| 240 | This time quantum mechanism is implemented in the '''pdes_local_time''' class. |
| 241 | For each initiator, the time quantum value is a parameter defined as a constructor argument. |
| 242 | The three members methods are... |