An aim of ESL modelling was to be able to easily replace parts of the high-level model with greater detail where necessary. So-called transactors are commonly needed at the boundaries.
Here is an example blocking transactor. It forms a gateway from a transactional initiator to a pin-level target.
// Write transactor 4/P handshake b_putbyte(char d) { while(ack) do wait(10, SC_NS); data = d; settle(); req = 1; while(!ack) do wait(10, SC_NS); req = 0; } | // Read transactor 4/P handshake char b_getbyte() { while(!req) do wait(10, SC_NS); char r = data; ack = 1; while(req) do wait(10, SC_NS); ack = 0; return r; } |
11: (C) 2008-18, DJ Greaves, University of Cambridge, Computer Laboratory. |