Skip to content
/ Nirah Public

Nirah is a project aimed at automatically wrapping verilator C++ models in python in order for high level, extendable control and verification of verilog systems.

Notifications You must be signed in to change notification settings

albaEDA/Nirah

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nirah

Nirah

Nirah is a project aimed at automatically wrapping verilator C++ models in python in order for high level, extendable control and verification of verilog systems.

                        Python Dependencies GitHub Issues Contributions welcome

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

GCC 5+ (or 4+ with stdc++ libs linked)
Python 3.0+
Swig
Verilator
Nirah

Installing

Currently Nirah is a standalone script but in future it will be a utility called from a command line. To get up and running the repository should act as a workspace to work as a testbed.

git clone https://github.com/AaronKel/Nirah.git
cd Nirah
python nirah.py RTL/sha256_rtl/sha256.v -O3 --verilator="-IRTL/sha256_rtl"

This will generate a wrapped libary that you can perform tests on. You will need to move the generated python file from obj_dir to TESTBENCH/sha256_tb aswell as the shared _sha256.o. An example of this is shown in the following:

mv obj_dir/sha256.py TESTBENCH/sha256_tb/
mv TESTBENCH/_sha256.so TESTBENCH/sha256_tb/
python TESTBENCH/sha256_tb/sha256_tb.py

view sha256_tb.py for VCD dumping code.

Example

Nirah


The following GIF shows the heirachy autocompletion within Visual Code. The ports are exposed as variables an can be written to the DUT as integers, however other forms of data can be handled natively by Python such as hex and binary values.

Nirah provides minimal support for arrays.

The project is in it's intial stages and can synthesize large designs, however there are bugs with tracing on some larger designs with work arounds already implimented



Features

  • Trace dumping (VCD)

  • Coverage

  • Multi-dimensional Array

  • Command line args

    Use with --swig="...", --gcc="...", etc

  • Complex examples

    Added SHA256 example

  • Multi-threaded. (Compiles but is slower than single threaded)

  • Nirah library for verilog helper features

  • Documentation

Authors

See also the list of contributors who participated in this project.

Acknowledgments

  • Inspiration from sin00b with VerilatorGen.rb a ruby wrapper for Verilator
  • Joachim Strombergson for allowing the redistribution of SHA256 example

About

Nirah is a project aimed at automatically wrapping verilator C++ models in python in order for high level, extendable control and verification of verilog systems.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published