My verilog code:
export "DPI-C" function inst_fetch;
module mymodule;
//other code...
function [31:0] inst_fetch;
return inst;
endfunction
//other code...
endmodule
And I verilated it. However, verilator reports an error:
"Can't find definition of exported task/function: 'inst_fetch'"
Are there some syntax errors?
I read the section about dpi-c in the Verilator manual but didn’t find the solution.