User guide

9-16
Using the Old Command Line Interface (CLI)
fork
{// fork process for CPU 0
repeat(256) {
randflag = cpu0.randomize();
cpu0.request_bus();
cpu0.writeOp();
cpu0.release_bus();
mailbox_put(mboxId, cpu0.address);
mailbox_put(mboxId, cpu0.data);
mailbox_put(mboxId, cpu0.delay);
sync(ALL, CPU1done);
trigger(OFF, CPU1done);
cpu0.delay_cycle();
}
}
{// fork process for CPU 1
repeat(256) {
mailbox_get(WAIT, mboxId, cpu1.address, CHECK);
mailbox_get(WAIT, mboxId, cpu1.data, CHECK);
mailbox_get(WAIT, mboxId, cpu1.delay, CHECK);
cpu1.request_bus();
cpu1.readOp();
if (memsys.busData == cpu1.data)
printf(ā€œ\nThe read and write cycles finished
successfully\n\nā€);
else
printf(ā€œ\nThe memory has been corrupted\n\nā€);
cpu1.release_bus();
trigger(ON, CPU1done);
cpu1.delay_cycle();
}
}
join
}
Use the following command line to compile the design and the
testbench in Example 9-2:
%vcs -ntb +cli -line -f memsys.f memsys.test_top.v memsys1.vr