vunit
vunit copied to clipboard
Importing DPI-C functions in verilog causes a warning
We are importing the DPI-C "getenv" function in our verilog code to be able to grab some environment variables at runtime, and an unnecessary warning is generated by tests/unit/test_verilog_parser.py https://github.com/VUnit/vunit/blob/master/tests/unit/test_verilog_parser.py#L180
// Despite the warning, the command still works. Here is the import statement
import "DPI-C" function string getenv(input string env_name);
And here is the warning we get:
WARNING - import bad argument
from globals_pkg.sv line 99:
`include "../sim/api/glbl_helper.svh"
~~~~~~~~
at ../sim/api/glbl_helper.svh line 19:
import "DPI-C" function string getenv(input string env_name);
~~~~~~~
Despite the warning, the imported function works as expected.