Use pysv with VerilatorΒΆ

This sections will cover usages with Verilator. Too see how to generate C++ binding with classes, please refer to C++ binding and Object-Oriented Programming.

  1. In the verilator command, include the shared library and the generated binding file, e.g.

verilator --cc design1.sv design2.sv top.cc libpysv.so
  1. Copy the CXX binding file to proper places so your test bench code can include it.

  2. Make sure libpysv.so is in your LD_LIBRARY_PATH when you run the test bench binary, e.g.

LD_LIBRARY_PATH=. ./obj_dir/Vtop