User guide

18-46
DirectC Interface
}
The vc_putValue routine passes the string "10xz" to the reg r1 through
the vc_handle. The Verilog code displays:
r1=10xz
void vc_putValueF(vc_handle, char *, char )
This function passes by reference, through the vc_handle, a value
for which you specify a radix with the third parameter. The valid
radixes are ’b’, ’o’, ’d’, and ’x’. For example the following
Verilog code declares a function named assigner that uses this
routine:
extern void assigner (output reg [31:0] r1,
output reg [31:0] r2,
output reg [31:0] r3,
output reg [31:0] r4);
module test;
reg [31:0] r1,r2,r3,r4;
initial
begin
assigner(r1,r2,r3,r4);
$display("r1=%0b in binary r1=%0d in decimal\n",r1,r1);
$display("r2=%0o in octal r2 =%0d in decimal\n",r2,r2);
$display("r3=%0d in decimal r3=%0b in binary\n",r3,r3);
$display("r4=%0h in hex r4= %0d in decimal\n\n",r4,r4);
$finish;
end
endmodule
The following is the C/C++ function:
#include <stdio.h>
#include "DirectC.h"
void assigner (vc_handle h1, vc_handle h2, vc_handle h3,