PyHDI/veriloggen

iverilog libdir option

sgherbst opened this issue · 1 comments

Thanks for the great work on this module! I suggest adding support for the iverilog -y option (libdir, see http://iverilog.wikia.com/wiki/Iverilog_Flags). This makes it easy to run simulations with stub modules instantiated from existing Verilog libraries.

Here's how I implemented this modification
veriloggen/simulation/simulation.py @ line 119

if libdirs:
   for libdir in libdirs:
      cmd.append('-y')
      cmd.append(libdir)

libdirs was then passed as an optional argument through run and run_iverilog.

Thank you for your nice suggestion!
I have implemented the proposed idea on the latest version.
Please see the example code in "veriloggen/tests/simulation/simulator/libdir/simulation_simulator_libdir.py".