These tests are borrowed from Reid Long's HDL Examples repository. That repository was intended to provide examples for how the conversions in this project could be done. sv2v does not necessarily convert code as demonstrated in the examples. Notably, sv2v does not create generate blocks when converted vectors with multiple packed dimensions, uses localparams rather than macros for enum conversion, and converts struct literals to concatenations, rather than multiple statements.
Each test case (say, “foo”) is comprised of the following files:
foo.sv: original SystemVerilogfoo.v: hand-converted Verilogfoo_tb.v: basic testbench exercising the given modulesThe SystemVerilog source file is converted to Verilog using sv2v, and then both the converted file and the reference Verilog are simulated using Icarus Verilog. This produces VCD files for each which are expected to match exactly, except for the timestamp.
The following differences exist between the tests in this folder and their corresponding versions in the source repository.
inline_concat files were modified to remove a stray trailing semicolon. Though some tools allow for stray semicolons, iverilog does not.array.v previously had a custom implementation of $clog2, which was removed.cache_request.sv was modified to include a plain decimal literal to ensure coverage beyond the unbased-unsized literals.cache_request2 test is omitted. It was only an example for debugging a VCS-specific issue encountered with cache_request.