User guide

18-38
DirectC Interface
The function prints the following:
The vc_handle to a 4state Vector is:
h2=1
The vc_handles to 4state scalars or
memories and 2state are:
h1=0 h3=0 h4=0 h5=0 h6=0 h7=0 h8=0
int vc_is2stVector(vc_handle)
This routine returns a 1 value if the vc_handle is to a vector bit. It
returns a 0 value if the vc_handle is to a scalar bit, scalar or vector
reg, or to a memory. For example, using the Verilog code from the
previous example, and the following C/C++ function:
#include <stdio.h>
#include "DirectC.h"
statefinder(vc_handle h1, vc_handle h2,
vc_handle h3, vc_handle h4,
vc_handle h5, vc_handle h6,
vc_handle h7, vc_handle h8)
{
printf("\nThe vc_handle to a 2state Vector is:");
printf("\nh6=%d \n\n",vc_is2stVector(h6));
printf("\nThe vc_handles to 2state scalars or
memories and 4state are:");
printf("\nh1=%d h2=%d h3=%d h4=%d h5=%d h7=%d h8=%d\n\n",
vc_is2stVector(h1), vc_is2stVector(h2),
vc_is2stVector(h3), vc_is2stVector(h4),
vc_is2stVector(h5), vc_is2stVector(h7),
vc_is2stVector(h8));
}