Skip to content

Commit

Permalink
try to use docker for verilator
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanlippuner committed Nov 4, 2023
1 parent fc549d3 commit ef2b2e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/verilator_docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker run -t verilator/verilator:v5.018 $@
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -22,6 +22,7 @@ jobs:
- name: Test Generation
run: |
export VERILATOR=.github/verilator_docker
cd proto
python3 tests.py
Expand Down
7 changes: 6 additions & 1 deletion proto/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit ef2b2e5

Please sign in to comment.