| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi all ! I am wondering how to access (write and read) a register array passed as parameter to my vpi function. Here is the resume (dummy) code that I have. ------------------------------------ /* file cosimu.v */ reg [7:0] my_reg_array [0:3][0:3]; initial $c_random_fill(my_reg_array); ------------------------------------------ /* file vpi_func.c */ /* Write value to reg array */ int c_random_fill(char *userdata) { /* get handles ... */ vpiHandle systfref, // handle on current function args_iter, // handle to iterate on arguments argh, // handles on arguments var_name; // handles on variable names /* structures for input arguments */ struct t_vpi_value argval; /* Obtain a handle to the argument list */ systfref = vpi_handle(vpiSysTfCall, NULL); /* get first handle of function args */ args_iter = vpi_iterate(vpiArgument, systfref); argh = vpi_scan(args_iter); /* getting iterator on Verilog data to fill */ argval.format = vpiRegArray; /* How can I continue here to iterate on the register values of my_reg_array ? */ vpi_printf("\n Thank you ! \n); return 0; } |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.