User guide

21-82
OpenVera Native Testbench
Once OpenVera gets an id for a mailbox/semaphore it can save it
into any integer type variable. Note that however if get_id is
invoked for a mailbox, the mailbox can no longer be garbage collected
because VCS has no way of knowing when the mailbox ceases to be
in use.
Typed mailboxes (currently not supported), when they are supported
in SystemVerilog can be passed to OpenVera code using the same
method as untyped mailboxes above. However, if the OpenVera code
attempts to put an object of incompatible type into a typed mailbox,
a simulation error will result.
Bounded mailboxes (currently not supported), when they are
supported in SystemVerilog can be passed to OpenVera code using
the same method as above. OpenVera code trying to do
mailbox_put into a full mailbox will result in a simulation error.
To use an OpenVera mailbox in SystemVerilog, we need to get a
handle to the mailbox object using a system function call. The system
function $get_mailbox returns this handle:
function mailbox $get_mailbox(int id);
It will be used as follows:
// SystemVerilog
.
.
.
mailbox mbox;
int id = foo.vera_method(); // vera_method returns an
// OpenVera mailbox id
mbox = $get_mailbox(id);
Analogous extensions are available for semaphores:
function int semaphore::get_id();