Skip to content

Using Nim to interface with Verilog and SystemVerilog test benches via VPI

License

Notifications You must be signed in to change notification settings

kaushalmodi/nim-systemverilog-vpi

Repository files navigation

Nim + SystemVerilog + VPI

This repo contains SystemVerilog VPI examples that I found in the wild, translated to Nim, and then many examples of my own that show the Nim/SystemVerilog interface via VPI.

Requirements

User needs to have access to some SystemVerilog simulator supporting VPI, like Cadence Xcelium.

All examples in this repo use the Nim ~svvpi~ package. To install it, do:

nimble install svvpi

Running the examples in this repo

  • To run the default Nim/SV examples, cd to each subdirectory and run make.
  • Some examples also have C/SV examples in an orig/ subdirectory under there. To run those, cd to that orig/ directory and then run make.

Authors

Unless stated otherwise, all C examples in this repo and most of the SystemVerilog test benches are originally authored by late Stuart Sutherland (sourced from The Verilog PLI Handbook).

I have received the permission from Don Mills (sutherland-hdl.com) to post code from The Verilog PLI Handbook in this repository.

All Nim examples are authored by Kaushal Modi. The C and SystemVerilog test benches could also be altered to improve the examples functionally, or just for coding consistency.

References

Versions tested

Cadence Xcelium
20.09-s09
OS
CentOS 7.6
Nim
1.5.1 as of 2021-04-30 Fri.