System Verilog DPI Example

Refer to the previous post for introduction.

System Verilog DPI NCVerilog

The above example gives a demo with NCVerilog.

Here is the run script for running the same example with Modelsim under windows.

Download here. system-verilog-dpi-modelsim.pdf

#File name run.tcl

# Author: A.G.Raja

# Website: agraja.wordpress.com

# License: GPL

#Type at Transcript terminal: source run.tcl

vlib work

vlog -sv -dpiheader dpiheader.h dpi_top.v

exec gcc -c -g -IE:/modelsim/include dpi_main.c -o dpi_main.obj

exec gcc -shared -o dpi_main.dll dpi_main.obj -LE:/modelsim/win32

vsim -novopt top -sv_lib dpi_main

run

# EOF run.tcl

Replace “E:/modelsim” with “modelsim installation path”

1) Don’t create a new project while starting Modelsim

2) Open and proceed directly to Modelsim.

3) At the transcript terminal change to the working directory

4) No need to create a folder named work.

5) The run script given above does it.

Download here. system-verilog-dpi-modelsim.pdf

Download NCVerilog demo here.
 systemverilogdpi.pdf

 

Advertisements

5 thoughts on “System Verilog DPI Example

  1. Pingback: System Verilog DPI Example « Applied Electronics Journal

  2. hi I was running your example of DPI on modelsim 6.3f installed on XP. Can you please explain how should I install gcc so that modelsim recognizes it.

  3. hi I was running your example of DPI on modelsim 6.3f installed on XP. Can you please explain how should I install gcc so that modelsim recognizes it. Can you please give step by step procedure to install GCC.

  4. Thanks for the reply. Actually at that point I had not set path var using the bash profile.
    Now it works. I use cygwin to launch modelsim.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s