HOME       UP       PREV       FURTHER NOTES       NEXT (Loose Timing and Temporal Decoupling)  

TLM Modelling: Adding The Timing Annotations Continued

A more-flexible coding style is to pass a time accumulator variable called 'delay' around for various models to augment:

  putbyte(char d, sc_time &delay)
  {
    ...
    delay += sc_time(140, SC_NS);
  }

At any point, any component can execute a resynch by performing

   sc_wait(delay);
   delay = 0;

Performance will be reduced if there are frequent resynchs, but transaction ordering will be modelled correctly.

At a parallel fork, we need to make a fresh accumulator variable and at any join we continue with the larger delay (ignoring 'eureka' joins).


28: (C) 2008-11, DJ Greaves, University of Cambridge, Computer Laboratory.