User guide

18-39
DirectC Interface
The function prints the following:
The vc_handle to a 2state Vector is:
h6=1
The vc_handles to 2state scalars or
memories and 4state are:
h1=0 h2=0 h3=0 h4=0 h5=0 h7=0 h8=0
int vc_width(vc_handle)
Returns the width of a vc_handle. For example:
void memcheck_int(vc_handle h)
{
int i;
int mem_size = vc_arraySize(h);
/* determine minimal needed width, assuming signed int */
for (i=0; (1 << i) < (mem_size-1); i++) ;
if (vc_width(h) < (i+1)) {
printf("Register too narrow to be assigned %d\n",
(mem_size-1));
return;
}
for(i=0;i<8;i++) {
vc_putMemoryInteger(h,i,i*4);
printf("memput : %d\n",i*4);
}
for(i=0;i<8;i++) {
printf("memget:: %d \n",vc_getMemoryInteger(h,i));
}
}