Skip to content

Commit

Permalink
Pass elaboration args to verilator
Browse files Browse the repository at this point in the history
  • Loading branch information
tudortimi committed Dec 10, 2023
1 parent 388f4cc commit 97c5eca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/runSVUnit
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ if ($simulator eq "modelsim" or $simulator eq "riviera") {
$cmd .= "-f $vhdlfile " if $vhdlfile;
} elsif ($simulator eq "verilator") {
$cmd .= "verilator --binary --top-module testrunner";
$cmd .= qq! @compileargs!;
$cmd .= qq! @compileargs @elabargs!;
} elsif ($simulator eq "xsim") {
$cmd .= "xvhdl -f $vhdlfile && " if $vhdlfile;
$cmd .= "xvlog --sv --log $vlogfile ";
Expand Down
13 changes: 13 additions & 0 deletions test/test_frmwrk.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,3 +698,16 @@ def test_questasim_can_handle_no_elab_args(tmpdir, monkeypatch):
subprocess.check_call(['runSVUnit'])

assert '-voptargs' not in pathlib.Path('fake_vsim.log').read_text()


def test_verilator_can_take_elab_args(tmpdir, monkeypatch):
with tmpdir.as_cwd():
fake_tool('verilator', log_name_is_tool_name=True)

monkeypatch.setenv('PATH', get_path_without_sims())
monkeypatch.setenv('PATH', '.', prepend=os.pathsep)

pathlib.Path('dummy_unit_test.sv').write_text('dummy')
subprocess.check_call(['runSVUnit', '-e_arg', 'some-arg'])

assert 'some-arg' in pathlib.Path('fake_verilator.log').read_text()

0 comments on commit 97c5eca

Please sign in to comment.