Open cknizek opened 2 months ago
This is caused at least partly by not having a --top-module
flag being passed to Verilator. Verilator is throwing a multiple top modules warning, causing an error. We can just statically pass --top-module testbench
.
@cknizek you can add --top-module testbench
to verilator.mk.template?
@cknizek you can add
--top-module testbench
to verilator.mk.template?
Done!
Including the file bsg_dff_chain.sv from BaseJump STL in a Lakeroad integration test can cause it to fail. I want to clarify that this failure is independent of any usage of
bsg_dff_chain.sv
itself within the integration test file. That is, simply includingbsg_dff_chain.sv
into an integration test will cause a test to fail.To reproduce this issue:
After running the above steps, I receive the following terminal output [1].
In the example of [1], I include the statement into a known working file
example_test_using_include.v
. This file passes when no modifications are made.When this file is modified by including the line
"include bsg_defines.sv"
, it still passes.When the file is modified by adding the line
"include bsg_dff_chain.sv"
, the integration test consistently fails. I've produced this on other randomly selected, known working files (e.g.one_stage_mul_or_lattice.v
orintel_cyclone10lp_mul_0_stage_unsigned_18_bit.v
).I'm still trying to figure out what's going on, but it seems like this might be related to the issue with module boundaries.
I think this issue occurs because (from what I've gathered), inserting an
include
statement in Verilog/SystemVerilog will basically copy + paste the contents of the included file directly into the file where theinclude
statement exists.And so, if there is an existing issue with multiple modules within the same file, it might cause conflict between the modules (and cause test failure).
The reason my PR was passing locally was likely because I was setting up the test incorrectly (i.e. using
lit -v bsg_mul_add_unsigned.sv
instead of re-building the Docker container and running it from there).I think the solution to this issue would be to either figure out why this is failing (is it multiple modules within the same file?) and either:
bsg_dff_chain.sv
(and possibly other BaseJump STL files) to fix the issue (make them compatible with Lakeroad)[1]