User guide
18-37
DirectC Interface
The function prints the following:
The vc_handles to 4state are:
h1=0 h2=0 h3=0 h4=0
The vc_handles to 2state are:
h5=1 h6=1 h7=1 h8=1
int vc_is4stVector(vc_handle)
This routine returns a 1 value if the vc_handle is to a vector reg. It
returns a 0 value if the vc_handle is to a scalar reg, scalar or vector
bit, or 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 4state Vector is:");
printf("\nh2=%d \n\n",vc_is4stVector(h2));
printf("\nThe vc_handles to 4state scalars or
memories and 2state are:");
printf("\nh1=%d h3=%d h4=%d h5=%d h6=%d h7=%d h8=%d\n\n",
vc_is4stVector(h1), vc_is4stVector(h3),
vc_is4stVector(h4),vc_is4stVector(h5),
vc_is4stVector(h6), vc_is4stVector(h7),
vc_is4stVector(h8));
}