Skip to content

Commit

Permalink
Error if modules have the same name
Browse files Browse the repository at this point in the history
  • Loading branch information
gussmith23 committed Dec 23, 2023
1 parent 1a090c5 commit b1d7f87
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/simulate_with_verilator.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ def simulate_with_verilator(
expect_all_zero_outputs: If True, we will expect that all outputs are
always 0 on all inputs. This should almost always be False.
"""
# This is an annoying fact. It's totally natural that the modules **would**
# have the same name; they're two implementations of the same thing, after
# all. But this will lead to a name collision from Verilator, and until
# there are namespaces in Verilog (how are there not???) this is what we're
# stuck with.
assert test_module_name != ground_truth_module_name, "Modules cannot have the same name."

if ignore_missing_test_module_file and not all(
[Path(path).exists() for path in verilog_filepaths]
Expand Down

0 comments on commit b1d7f87

Please sign in to comment.