diff --git a/.github/verilator_docker b/.github/verilator_docker new file mode 100755 index 00000000..8f052edb --- /dev/null +++ b/.github/verilator_docker @@ -0,0 +1,2 @@ +#!/bin/bash +docker run -t verilator/verilator:v5.018 $@ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cd74a5f..9bcd5701 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: uses: actions/checkout@v4 - name: Install Tools - run: sudo apt-get install ghdl verilator + run: sudo apt-get install ghdl - name: Setup Python venv run: | @@ -22,6 +22,7 @@ jobs: - name: Test Generation run: | + export VERILATOR=.github/verilator_docker cd proto python3 tests.py diff --git a/proto/tests.py b/proto/tests.py index 5ffd5b78..90b99ebc 100755 --- a/proto/tests.py +++ b/proto/tests.py @@ -413,8 +413,13 @@ def test_hdl_ref(): if res.returncode != 0: error('VHDL elaboration failed for {}'.format(f)) + + if 'VERILATOR' in os.environ: + verilator_cmd = os.environ['VERILATOR'] + else: + verilator_cmd = 'verilator' sv_pkgs = [srcdir + 'tb/dpssram.sv', srcdir + 'tb/wishbone_pkg.sv'] - res = subprocess.run(['verilator', '--lint-only', '--top-module', top_entity] + sv_pkgs + [sv_file]) + res = subprocess.run([verilator_cmd, '--lint-only', '--top-module', top_entity] + sv_pkgs + [sv_file]) if res.returncode != 0: error('SV elaboration failed for {}'.format(f))