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.
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
Copy the CXX binding file to proper places so your test bench code can include it.
Make sure
libpysv.sois in yourLD_LIBRARY_PATHwhen you run the test bench binary, e.g.
LD_LIBRARY_PATH=. ./obj_dir/Vtop