From 67749d93a97537822738140d2d32274305e52488 Mon Sep 17 00:00:00 2001 From: Stefan Lippuner <3071885+stefanlippuner@users.noreply.github.com> Date: Sat, 4 Nov 2023 17:54:13 +0100 Subject: [PATCH] try to use docker for verilator --- .github/verilator_docker | 2 ++ .github/workflows/ci.yml | 4 +++- proto/tests.py | 7 ++++++- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100755 .github/verilator_docker 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..1e73b6dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,9 @@ jobs: uses: actions/checkout@v4 - name: Install Tools - run: sudo apt-get install ghdl verilator + run: | + sudo apt-get install ghdl + export VERILATOR=.github/verilator_docker - name: Setup Python venv run: | 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))