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.
使用DPI-C嵌入SystemVerilog解释器
本文详细介绍了如何使用DPI-C接口将SystemVerilog解释器嵌入到C程序中,包括编译C代码、编译SystemVerilog代码、链接加载以及运行的步骤。通过实例演示了从C代码向SystemVerilog发送Hello World消息的过程。
1万+

被折叠的 条评论
为什么被折叠?



