User guide
18-53
DirectC Interface
else{
u2=0;
printf("\nShort 2 state vector passed to up2\n");}
}
In this example the short bit vector is passed to the
vc_2stVectorRef routine, so it returns a null value to pointer up1.
Then the long bit vector is passed to the vc_2stVectorRef routine,
so it returns a pointer to the Verilog data for vector bit r2 to pointer
up2.
It checks for the null value in up1. If it doesn’t have null value,
whatever it points to is passed to u1. If it does have a null value, the
function prints a message about the short bit vector. In this example,
you can expect it to print the message.
Still later in the function, it checks for the null value in up2 and the
size of the long bit vector that is passed to the second parameter.
Then, because Verilog values are stored in 32-bit chucks in C/C++,
the function finds out how many chunks are needed to store the long
bit vector. It then loads one chunk at a time into u2 and prints the
chunk starting with the most significant bits. This function displays
the following:
Short 2 state vector passed to up1
width of h2 is 33
the number of chunks needed for h2 is 2
loading into u2 1 2