Skip to content

Commit

Permalink
Merge pull request #163 from zeroasiccorp/ali/pytest
Browse files Browse the repository at this point in the history
Move testing over to pytest and change CI to account for it
  • Loading branch information
azaidy authored Aug 29, 2024
2 parents 9c0c0d6 + b32ba87 commit 208fbc9
Show file tree
Hide file tree
Showing 13 changed files with 391 additions and 316 deletions.
42 changes: 6 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,19 @@ on:
workflow_dispatch:

jobs:
get_testbenches:
name: 'Get testbenches'

runs-on: ubuntu-latest

outputs:
testbenches: ${{ steps.tests.outputs.tests }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Collect testbenches
id: tests
run: |
echo "tests=$(python3 .github/workflows/bin/collect_tests.py)" >> $GITHUB_OUTPUT
testbench:
needs: get_testbenches
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get_testbenches.outputs.testbenches) }}

timeout-minutes: 10
switchboard_ci:
name: "Switchboard CI"
runs-on: ubuntu-latest
container:
image: ghcr.io/zeroasiccorp/sbtest:latest
timeout-minutes: 10

steps:
- name: Check out UMI
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install requirements
- name: pytest
run: |
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -e .[test]
- name: Run ${{ matrix.testbench }}
run: |
. .venv/bin/activate
cd $(dirname "${{ matrix.testbench }}")
./$(basename "${{ matrix.testbench }}")
pytest -m "switchboard" -n auto
16 changes: 14 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ version = {attr = "umi.__version__"}

[project.optional-dependencies]
test = [
"switchboard-hw>=0.2.14",
"flake8==7.1.1"
"switchboard-hw>=0.2.15",
"flake8==7.1.1",
"pytest==8.3.2",
"pytest-xdist==3.6.1",
"pytest-timeout==2.3.1"
]

[tool.setuptools]
Expand All @@ -43,3 +46,12 @@ packages = [
ignore = [
"W002"
]

[tool.pytest.ini_options]
markers = [
"switchboard: this test requires switchboard to run"
]
testpaths = [
"umi/sumi/tests"
]
timeout = "300"
4 changes: 2 additions & 2 deletions umi/sumi/rtl/umi_isolate.v
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ module umi_isolate
.iso(isolate));

la_visolo #(.N(DW))
i_data (.in(umi_srcaddr[DW-1:0]),
.out(umi_srcaddr_iso[DW-1:0]),
i_data (.in(umi_data[DW-1:0]),
.out(umi_data_iso[DW-1:0]),
.iso(isolate));
end
else
Expand Down
83 changes: 0 additions & 83 deletions umi/sumi/testbench/test_fifo.py

This file was deleted.

87 changes: 0 additions & 87 deletions umi/sumi/testbench/test_fifo_flex.py

This file was deleted.

13 changes: 4 additions & 9 deletions umi/sumi/testbench/testbench_crossbar.sv
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ module testbench
input clk
);

`include "switchboard.vh"

localparam N = PORTS;

/*AUTOWIRE*/
Expand Down Expand Up @@ -171,15 +173,8 @@ module testbench
nreset <= nreset | 1'b1;
end

// control block
initial
begin
if ($test$plusargs("trace"))
begin
$dumpfile("testbench.fst");
$dumpvars(0, testbench);
end
end
// waveform dump
`SB_SETUP_PROBES

// auto-stop

Expand Down
Loading

0 comments on commit 208fbc9

Please sign in to comment.