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.
Example blocking transactors: convert from transaction to pin-level modelling.
// 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;
}
|
See working SystemC versions in the »`Toy ESL'practical material.
| 7: (C) 2008-13, DJ Greaves, University of Cambridge, Computer Laboratory. |