openhwgroup / cva6

The CORE-V CVA6 is an Application class 6-stage RISC-V CPU capable of booting Linux
https://docs.openhwgroup.org/projects/cva6-user-manual/
Other
2.28k stars 689 forks source link

Is it possible to access memory content using VPI interface? #1316

Closed yulong-lan closed 1 year ago

yulong-lan commented 1 year ago

I am trying to access the memory at any location I want, by which I mean I want to provide the address, and have the memory value at that address returned.

In brief, the memory is in the hierarchy shown in this VPI handle declaration:

vpiHandle vh1 = vpi_handle_by_name("TOP.ariane_testharness.i_sram.i_tc_sram_wrapper.i_tc_sram.sram", NULL); 
if (!vh1) vl_fatal(FILE, LINE, "ariane_testharness", "No handle found");

And the memory model "sram" is only a one-dimentioanl array:

parameter type         data_t    = logic [DataWidth-1:0],
data_t sram [NumWords-1:0]/*verilator public_flat_rd*/;

But I only gets this error and warning message: "No handle found", which indicates that the handle is simply not created.

Is it not possible to access memory using this way or am I using it wrong?

yulong-lan commented 1 year ago

got it. Verilator creates a different path that is not what we think it is.