systemverilog dpi usage

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

How to Embed Systemverilog Interpreter using DPI-C?:

https://stackoverflow.com/questions/29781428/how-to-embed-systemverilog-interpreter-using-dpi-c/46441794#46441794

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.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值