Services and Modeling for Embedded Software Development
Embecosm divider strip
Prev  Next

9.1.  What is Temporal Decoupling

9.1.1. Timing Concepts
9.1.2. The Global Quantum Class, tlm_global_quantum
9.1.3. TLM 2.0 Quantum Keepers
9.1.4. Other Styles of Temporal Decoupling

The idea of temporal decoupling is very simple and has been around for a long time (see for example A loosely coupled parallel LISP execution system. ). In a parallel system, the various threads keep their own local time, and only synchronize when they need to communicate with each other. It is particularly suited to timed-based modeling, since it ensures that no one thread hogs the execution.

It is worth noting that temporal decoupling does not improve overall model performance per se. All the same elements will need to be modeled. However it does ensure that the various threads in the model stay approximately in step over the duration of the run, making for a more realistic model. In our example it ensures that the Or1ksim model yields control regularly to allow the UART and terminal models to keep up.

TLM 2.0 provides some convenience classes to help threads implement temporal decoupling. The nomenclature used by these classes can be more than a little confusing—the following should help to explain how the technique works.

There are two key points about temporal decoupling.

  1. Temporal decoupling is a property of threads, not module classes. So it is each thread that must keep track of its local view of time.

  2. Nothing in the TLM 2.0 system checks a program is following the rules. It is up to each thread to ensure it is compliant.

Not all threads need use temporal decoupling, although the more that do, the greater the potential benefit. In general temporal decoupling is only appropriate for threads using TLM 2.0 blocking interfaces for their communication—typically loosely timed models. Where temporal decoupling is implemented it is managed by the threads driving initiator sockets.

Embecosm divider strip