User guide
18-31
DirectC Interface
The corresponding header for the C/C++ function is as follows:
After declaring the vc_handles you can use them to pass data to and
from these descriptors.
Using Access Routines
Abstract access comes with a set of access routines that enable your
C/C++ function to pass values to and from the descriptors for the
Verilog reg, bit, and memory arguments in the function call.
These access routines use the vc_handle to pass values by reference
but the vc_handle is not the only type of parameter for many of these
routines. These routines also have the following types of parameters:
• Scalar — an unsigned char
• Integers — uninterpreted 32 bits with no implied semantics
• Other types of pointers — primitive types “string” and “pointer”
• Real numbers
.
.
.
my_function(vc_handle h1, vc_handle h2)
{
.
.
.
up1=vc_2stVectorRef(h1);
up2=vc_2stVectorRef(h2);
.
.
.
}
h1 is the vc_handle for bit1
h2 is the vc_handle for bit2
A routine that accesses the data
structures for bit1 and bit2 using
their vc_handles