User guide

18-36
DirectC Interface
vc_is4state(h3),vc_is4state(h4));
printf("\nThe vc_handles to 2state are:");
printf("\nh5=%d h6=%d h7=%d h8=%d\n\n",
vc_is4state(h5),vc_is4state(h6),
vc_is4state(h7),vc_is4state(h8));
}
The function prints the following:
The vc_handles to 4state are:
h1=1 h2=1 h3=1 h4=1
The vc_handles to 2state are:
h5=0 h6=0 h7=0 h8=0
int vc_is2state(vc_handle)
This routine does the opposite of the vc_is4state routine. 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_handles to 4state are:");
printf("\nh1=%d h2=%d h3=%d h4=%d\n\n",
vc_is2state(h1),vc_is2state(h2),
vc_is2state(h3),vc_is2state(h4));
printf("\nThe vc_handles to 2state are:");
printf("\nh5=%d h6=%d h7=%d h8=%d\n\n",
vc_is2state(h5),vc_is2state(h6),
vc_is2state(h7),vc_is2state(h8));
}