How to Embed Systemverilog Interpreter using DPI-C?:
https://verificationacademy.com/news/featured-technical-papers-dvcon-2013
conv2013:
https://verificationacademy.com/news/featured-technical-papers-dvcon-2013
export LD_LIBRARY_PATH=<path_to_lib>:$LD_LIBRARY_PATH
how to run
Step 1. Compile your C code
gcc -shared -o hello.so hello.c
Step 2. Compile your SV code
vlog -sv hello.sv
Step 3. link and load
vsim -c hello -sv_lib hello
Step 4. Run
VSIM> run -all
output :
VSIM 1> run -all
# Hello World From C
# ** Note: $finish : hello.sv(7)
# Time: 0 ns Iteration: 0 Instance: /hello
Gcc option:
-shared
Produce a shared object which can then be linked with other objects to form an executable.