HOME       UP       PREV       NEXT (TLM Modelling: Adding Timing Annotations Continued)  

TLM Modelling: Adding Approximate Timing Annotations

The naive way to add approximate timing annotations is to block the SystemC kernel in a transaction until the required time has elapsed:

   sc_time clock_period  = sc_time(5, SC_NS);  // 200 MHz clock

   int read(A)
     int r = 0;
     if (A < 0 or A >= SIZE) error(....);
     else r = MEM[A];
     wait(clock_period * 3);   // <-- Directly model memory access time: three cycles say.
     return r;

22: (C) 2008-13, DJ Greaves, University of Cambridge, Computer Laboratory.