User guide

18-21
DirectC Interface
An open bit-width for a reg makes it possible for you to pass a
vector reg, so the corresponding formal parameter for a reg
argument, specified with an open bit-width, must be a pointer.
Similarly an open bit-width for a bit makes it possible for you to
pass a bit larger than 32 bits, so the corresponding formal
parameter for a bit argument specified with an open bit width must
be a pointer.
Direct access passes by value the following types of input
arguments: int, string, and pointer.
Direct access passes input arguments of type real by reference.
The following tables show the mapping between the data types you
use in the C/C++ function and the arguments you specify in the
function declaration in your Verilog code.
Table 18-7 For Input Arguments
argument type C/C++ formal
parameter data type
Passed by
int int value
real double* reference
pointer void* value
string char* value
bit scalar value
reg scalar value
bit [] - 1-32 bit wide vector U value
bit [] - open vector, any vector wider than
32 bits
U* reference
reg [] - 1-32 bit wide vector vec32* reference
array [] - open vector, any vector wider
than 32 bits
UB* reference