S
skyworld
Guest
Hi,
I'm trying to pass some values from verilog simulation to my c program
with vpi. I found one examples from wiki as this:
// from verilog simulator:
val = 41;
$increment(val);
// from example c program
static int increment(char *userdata) {
vpiHandle systfref, args_iter, argh;
struct t_vpi_value argval;
int value;
systfref = vpi_handle(vpiSysTfCall, NULL);
args_iter = vpi_iterate(vpiArgument, systfref);
argh = vpi_scan(args_iter);
argval.format = vpiIntVal;
vpi_get_value(argh, &argval);
value = argval.value.integer;
vpi_printf("VPI routine received %d\n", value);
This examples works, but how can I pass an array from verilog to c?
for example, how can I access array as follows in c?
reg[7:0] test_data[0:127];
$increment(test_data);
I'm trying to pass some values from verilog simulation to my c program
with vpi. I found one examples from wiki as this:
// from verilog simulator:
val = 41;
$increment(val);
// from example c program
static int increment(char *userdata) {
vpiHandle systfref, args_iter, argh;
struct t_vpi_value argval;
int value;
systfref = vpi_handle(vpiSysTfCall, NULL);
args_iter = vpi_iterate(vpiArgument, systfref);
argh = vpi_scan(args_iter);
argval.format = vpiIntVal;
vpi_get_value(argh, &argval);
value = argval.value.integer;
vpi_printf("VPI routine received %d\n", value);
This examples works, but how can I pass an array from verilog to c?
for example, how can I access array as follows in c?
reg[7:0] test_data[0:127];
$increment(test_data);