From faf83096298c52f6dab66bb5ee90f2d8dc833cac Mon Sep 17 00:00:00 2001 From: umarcor Date: Wed, 21 Jul 2021 18:04:15 +0200 Subject: [PATCH 1/4] ci: in job 'VUnit' use a container step instead of a container job Signed-off-by: umarcor --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f5fbe6..51cd5e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,10 +54,11 @@ jobs: VUnit: needs: [build] runs-on: ubuntu-latest - container: ghdl/vunit:llvm steps: - uses: actions/checkout@v2 - - run: python3 ./run.py -p10 + - uses: docker://ghdl/vunit:llvm + with: + args: python3 ./run.py -p10 symbiflow: strategy: From 7571416f817ec03fd883924587f1457401273240 Mon Sep 17 00:00:00 2001 From: umarcor Date: Wed, 21 Jul 2021 18:09:37 +0200 Subject: [PATCH 2/4] ci: add 'workflow_dispatch' Signed-off-by: umarcor --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 51cd5e1..04b3d79 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,7 @@ on: pull_request: schedule: - cron: '0 0 * * 5' + workflow_dispatch: jobs: From 2031c6d2d22a43cff869c5716ee7e06f4fb26334 Mon Sep 17 00:00:00 2001 From: umarcor Date: Wed, 21 Jul 2021 19:52:24 +0200 Subject: [PATCH 3/4] VUnit: use Path.glob instead of glob.glob Signed-off-by: umarcor --- run.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/run.py b/run.py index 2ffbc9e..a01c11d 100644 --- a/run.py +++ b/run.py @@ -1,6 +1,5 @@ from pathlib import Path from vunit import VUnit -from glob import glob prj = VUnit.from_argv() prj.add_osvvm() @@ -11,7 +10,7 @@ lib.add_source_files(root / "litedram" / "extras" / "*.vhdl") lib.add_source_files(root / "litedram" / "generated" / "sim" / "*.vhdl") # Use multiply.vhd and not xilinx-mult.vhd. Use VHDL-based random. -vhdl_files = glob(str(root / "*.vhdl")) +vhdl_files = root.glob("*.vhdl") vhdl_files = [ src_file for src_file in vhdl_files From 178c2a7da31b5939b34030d3fd7ba12e0563fbf1 Mon Sep 17 00:00:00 2001 From: umarcor Date: Wed, 21 Jul 2021 19:54:27 +0200 Subject: [PATCH 4/4] VUnit: style Signed-off-by: umarcor --- run.py | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/run.py b/run.py index a01c11d..3bf49da 100644 --- a/run.py +++ b/run.py @@ -1,28 +1,23 @@ from pathlib import Path from vunit import VUnit -prj = VUnit.from_argv() -prj.add_osvvm() -root = Path(__file__).parent +ROOT = Path(__file__).parent -lib = prj.add_library("lib") -lib.add_source_files(root / "litedram" / "extras" / "*.vhdl") -lib.add_source_files(root / "litedram" / "generated" / "sim" / "*.vhdl") +PRJ = VUnit.from_argv() +PRJ.add_osvvm() -# Use multiply.vhd and not xilinx-mult.vhd. Use VHDL-based random. -vhdl_files = root.glob("*.vhdl") -vhdl_files = [ +PRJ.add_library("lib").add_source_files([ + ROOT / "litedram" / "extras" / "*.vhdl", + ROOT / "litedram" / "generated" / "sim" / "*.vhdl" +] + [ src_file - for src_file in vhdl_files - if ("xilinx-mult" not in src_file) - and ("foreign_random" not in src_file) - and ("nonrandom" not in src_file) -] -lib.add_source_files(vhdl_files) + for src_file in ROOT.glob("*.vhdl") + # Use multiply.vhd and not xilinx-mult.vhd. Use VHDL-based random. + if not any(exclude in str(src_file) for exclude in ["xilinx-mult", "foreign_random", "nonrandom"]) +]) -unisim = prj.add_library("unisim") -unisim.add_source_files(root / "sim-unisim" / "*.vhdl") +PRJ.add_library("unisim").add_source_files(ROOT / "sim-unisim" / "*.vhdl") -prj.set_sim_option("disable_ieee_warnings", True) +PRJ.set_sim_option("disable_ieee_warnings", True) -prj.main() +PRJ.main()