Major Tools
Other Tools
General Info

Issue #1391

Updated by Wilson Snyder about 1 year ago

I've been using about a year old version of Verilator, and when I try to switch to the latest stable, I'm running into this problem...

The design__Syms.cpp file contains a number of "exportInsert" calls for each of the DPI functions that I have scattered all over the design:

@ __Vscope_path_to_my_block.exportInsert(__Vfinal,"my_dpi_function", (void*)(&my_block::__Vdpiexp_path_to_my_block));@

There's a few hundred of these, and each of these lines is trying to cast the address of a function to (void *) pointer. I run into compile problems here because some of these functions it is trying to cast are static, and those are fine to get an address of like this, and some are not static and can't be cast to (void *) without an instance of the object. I can't figure out why Verilator would generate some of these as static and some not... Every one of my DPI functions is the same, auto-generated code that looks like:

@ export "DPI-C" function my_dpi_function_name;
function int my_dpi_function_name() ;
return signal_value ;
</pre> @

I can't see any pattern in which ones are chosen to be static and which are not....

In the ~1 year old version that I was previously using, I've checked that all DPI functions were generated as static member functions, and hence I had no compile problems.