User guide

18-67
DirectC Interface
void vc_get2stMemoryVector(vc_handle, U indx, U *)
Copies the data bytes, but not the control bytes, from a Verilog
memory element to an array in your C/C++ function. For example, if
you use the Verilog code from the previous example but simulate in
two state and use the following C/C++ code:
#include <stdio.h>
#include "DirectC.h"
void mem_elem_copier(vc_handle h)
{
U holder[1];
vc_get2stMemoryVector(h,0,holder);
vc_put2stMemoryVector(h,32,holder);
}
The only difference here is that we declare the array to be of type U
instead and we don’t copy the control bytes, because there are none
in two-state simulation.
void vc_put2stMemoryVector(vc_handle, U indx, U *)
Copies Verilog data from a U array to a Verilog memory element. This
routine is used in the previous example.