User guide
18-42
DirectC Interface
The following C/C++ function uses this routine:
#include <stdio.h>
#include "DirectC.h"
void rout1 (vc_handle onebit, vc_handle mobits)
{
printf("\n\nonebit is %d mobits is %d\n\n",
vc_toInteger(onebit), vc_toInteger(mobits));
}
This function prints the following:
onebit is 0 mobits is 0
onebit is 1 mobits is 128
char *vc_toString(vc_handle)
Returns a string that contains the 1, 0, x, and z characters. For
example:
extern void vector_printer (input reg [7:0] r1);
module test;
reg [7:0] r1,r2;
initial
begin
#5 r1 = 8’bzx01zx01;
#5 vector_printer(r1);
#5 $finish;
end
endmodule
void vector_printer (vc_handle h)