User guide
21-81
OpenVera Native Testbench
Mailboxes and Semaphores
Mailboxes and semaphores are referenced using object handles in
SystemVerilog whereas in OpenVera they are referenced using
integral ids.
VCS plans to support the mapping of mailboxes between the two
languages as follows:
Consider a mailbox created in SystemVerilog. To use it in OpenVera,
we need to get the id for the mailbox somehow. The get_id() function,
available as a VCS extension to SV, returns this value:
function int mailbox::get_id();
It will be used as follows:
// SystemVerilog
mailbox mbox = new;
int id;
.
.
.
id = mbox.get_id();
.
.
.
foo.vera_method(id);
// OpenVera
class Foo {
.
.
.
task vera_method(integer id) {
.
.
.
void = mailbox_put(data_type mailbox_id,
data_type variable);
}
}