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 b_mem_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; }
27: (C) 2008-17, DJ Greaves, University of Cambridge, Computer Laboratory. |