HOME       UP       PREV       FURTHER NOTES       NEXT (SystemC Plotting and GUI)  

Blocking and Eventing

A SystemC thread can block for a given amount of time using the wait function in the SystemC library (not the Posix namesake).

Waiting for an arbitrary boolean expression to hold hard to implement on top of C++ owing to its compiled nature:

     waituntil(mycount.delayed() > 5 && !reset.delayed());

Poor user had to just insert the delayed keyword where needed and then ignore it when reading the code.

It was too unwieldly, now removed. So today (pre C++11) use the less-efficient:

     do { wait(10, SC_NS); }  while(!((mycount > 5 && !reset)));

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