TestBenchGenerator/generate_harness.py generates a verilator test bench using the bistream and IO collateral generated by smt-pnr
TestBenchGenerator/verilate.py is a simple wrapper script around verilator that will cache the verilated module (so we only have to run verilator once). This generates the standard Verilator collateral that is placed in the build/ directory/
We use the verilator Makefile to compile a binary with make --silent -C build -j -f Vtop.mk Vtop and then run the test bench with ./Vtop
To emulate the interface provided by the existinng run.csh, we provide the TestBenchGenerator/process_input.py and TestBenchGenerator/process_output.py scripts to handle the DELAY parameters as well as mapping input/output files to port names.
Note serpent fails because I believe it's not generating the required collateral build/$*.io.json (instead, on my local machine, it looks like the script uses the generated collateral from smt-pnr during a past run, which doesn't work because I'm guessing serpent uses different pads for IO)
This pull request replaces the current test bench found in
CGRAGenerator/verilator/generator_z_tb
with a test bench generator from https://github.com/StanfordAHA/TestBenchGenerator.TestBenchGenerator/generate_harness.py
generates a verilator test bench using the bistream and IO collateral generated by smt-pnrTestBenchGenerator/verilate.py
is a simple wrapper script around verilator that will cache the verilated module (so we only have to run verilator once). This generates the standard Verilator collateral that is placed in thebuild/
directory/make --silent -C build -j -f Vtop.mk Vtop
and then run the test bench with./Vtop
To emulate the interface provided by the existinng
run.csh
, we provide theTestBenchGenerator/process_input.py
andTestBenchGenerator/process_output.py
scripts to handle theDELAY
parameters as well as mapping input/output files to port names.Note serpent fails because I believe it's not generating the required collateral
build/$*.io.json
(instead, on my local machine, it looks like the script uses the generated collateral fromsmt-pnr
during a past run, which doesn't work because I'm guessing serpent uses different pads for IO)