User guide
18-45
DirectC Interface
double vc_getReal(vc_handle)
Returns a real (double) value from a vc_handle. For example:
void print_real(vc_handle h)
{
printf("[print_real] %f\n", vc_getReal(h));
}
void vc_putValue(vc_handle, char *)
This function passes, by reference through the vc_handle, a value
represented as a string containing the 0, 1, x, and z characters. For
example:
extern void check_vc_putvalue(output reg [] r1);
module tester;
reg [31:0] r1;
initial
begin
check_vc_putvalue(r1);
$display("r1=%0b",r1);
$finish;
end
endmodule
Here the C/C++ function is declared in the Verilog code specifying
that the function passes a value to a four-state reg (and therefore can
hold X and Z values).
#include <stdio.h>
#include "DirectC.h"
void check_vc_putvalue(vc_handle h)
{
vc_putValue(h,"10xz");