Skip to content

Commit

Permalink
Enable wider input bitwidths for inputs coming from the command line …
Browse files Browse the repository at this point in the history
…in `simulate_with_verilator.py` (#378)

This came up in #363.
  • Loading branch information
gussmith23 authored Oct 24, 2023
1 parent 39bcc92 commit a66e7c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions bin/simulate_with_verilator.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def simulate_with_verilator(
Path(os.environ["LAKEROAD_DIR"]) / "misc" / "verilator_testbench.sv.template"
).read_text()
testbench_source = testbench_template_source.format(
max_input_bitwidth=max([bw for _, bw in module_inputs]),
test_module_name=test_module_name,
ground_truth_module_name=ground_truth_module_name,
test_module_port_list=",".join(
Expand Down
2 changes: 1 addition & 1 deletion misc/verilator_testbench.sv.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module testbench;

integer num_inputs;
integer num_test_cases;
integer inputs[];
logic [{max_input_bitwidth}-1:0] inputs[];

{test_module_name} simulate_with_verilator_test_module({test_module_port_list});
{ground_truth_module_name} simulate_with_verilator_ground_truth_module({ground_truth_module_port_list});
Expand Down

0 comments on commit a66e7c5

Please sign in to comment.