leonardt / fault

A Python package for testing hardware (part of the magma ecosystem)
BSD 3-Clause "New" or "Revised" License
41 stars 13 forks source link

Add Icarus Verilog to Regression Testing #181

Closed sgherbst closed 4 years ago

sgherbst commented 4 years ago

Currently Icarus Verilog support is not checked as part of Travis or BuildKite tests. This PR adds Icarus Verilog to the list of simulators tested with Travis, and fixes a few minor bugs causing some tests to fail when run using Icarus Verilog.

Details:

  1. Travis Linux distro upgraded to "bionic" from "xenial" so that a modern iverilog version could be used (in particular, we need one supporting the "-g2012" flag)
  2. Icarus Verilog is installed as a package for Linux and OSX targets on Travis.
  3. Waveform dumping is fixed for Icarus Verilog using code from PR #180.
  4. File writing is fixed for Icarus Verilog. $fwrite doesn't work properly for Icarus Verilog when dealing with individual bytes because it won't write the byte "0x00". As a result, for the iverilog simulator the non-standard function $fputc is used instead.
  5. Library file inclusion is fixed for Icarus Verilog. Since iverilog doesn't have a command like "-v" that allows a single library file to be included, a list of all unique library directories is built up and passed using the "-y" flag.