Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,11 @@ jobs:
https://github.com/chipsalliance/sv-tests.git "$revision"
git -C "$RUNNER_TEMP/sv-tests" checkout -q FETCH_HEAD
git -C "$RUNNER_TEMP/sv-tests" submodule update --init --depth 1 \
third_party/tests/uvm third_party/tests/uvm-1.2
third_party/tests/uvm third_party/tests/uvm-1.2 \
third_party/tests/easyUVM third_party/tests/uvm-examples

- name: Generate the upstream main-tests corpus
run: python conformance/sv-tests/prepare.py "$RUNNER_TEMP/sv-tests"

- name: Validate the adapter against the official runner
env:
Expand Down Expand Up @@ -532,6 +536,7 @@ jobs:
name: sv-tests-report
path: |
${{ runner.temp }}/sv-tests-report.tsv
${{ runner.temp }}/sv-tests-report.summary.json
${{ runner.temp }}/sv-tests-results
if-no-files-found: ignore
retention-days: 14
Expand Down
81 changes: 64 additions & 17 deletions conformance/sv-tests/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
# sv-tests conformance

CI runs the unmodified [sv-tests `tools/runner`](https://github.com/chipsalliance/sv-tests/blob/c4229f3bd5220e6d3ba8f390e5d09c87e462e9c7/tools/runner)
CI runs the unmodified [sv-tests `tools/runner`](https://github.com/chipsalliance/sv-tests/blob/db159ad8e9cbbd62036569d240153f753258f640/tools/runner)
at the commit in [`revision`](revision), using the Celox
[`BaseRunner` adapter](runners/celox.py). [`run.py`](run.py) launches that official
runner in a subprocess for every `.sv` file, as the upstream Makefile does.
It compares the official verdicts with [`expected.tsv`](expected.tsv).
Each test has separate `2state` and `4state` rows (`test`, `state_mode`, `result`).

The corpus matches the public dashboard's **main tests** at
[build 40150201340](https://github.com/chipsalliance/sv-tests/actions/runs/40150201340)
(2026-10-25, revision `db159ad8e9cbbd62036569d240153f753258f640`): **1,650 cases
per state mode**, comprising 1,028 checked-in cases and 622 generated cases.
[`prepare.py`](prepare.py) runs upstream's unmodified `template_generator`,
`easyUVM`, and `uvm-examples` generators. It verifies the pinned checkout and
library submodules, generates into a fresh temporary tree, checks the reviewed
counts in [`corpus.json`](corpus.json), and rejects stale or foreign generated
cases. CI prepares this corpus before collecting results. The dashboard's
`cores` and `imported` groups are separate corpora and are not included here.

The TSV report has a companion `.summary.json` containing the tested revision,
per-group/per-state pass totals, per-tag results, fully passing tag totals, and execution-mode
counts. As in the upstream dashboard, skipped cases are excluded from the
executed-case denominator, and a tag passes only when all its executed cases
pass. Aggregate tags (including `uvm-req`) are expanded using upstream
`conf/meta-tags.conf`, in the same order as `tools/sv-report`. Each case counts once in the overall total even when it has multiple tags.
States and groups are never combined into one percentage. A tool that only
parses a case is not demonstrating the same behavior as one that simulates it;
compare the corpus revision, selected cases, and execution modes alongside
percentages. This measures test outcomes, not a percentage of the language spec.

The official runner owns metadata parsing, compatible-runner filtering, mode
priority, library injection, timeouts, expected failures and simulation
`:assert:` evaluation. The adapter declares only the driver’s supported
Expand Down Expand Up @@ -37,37 +59,52 @@ command-line defines apply to each file.
| `skip` | the official runner skipped an incompatible test or unsupported mode |

All 90 preprocessing cases at the pinned revision now execute in both state
modes, leaving no skipped expectation rows. Each mode reports 89 passes and
one failure: `chapter-22/22.11--pragma-invalid.sv` expects a bare `` `pragma ``
to be rejected, but the preprocessor currently accepts it. This failure remains
visible in the baseline. Upstream preprocessing verdicts check process success
and expected failure; they do not compare the emitted text against a golden file.
modes, leaving no skipped expectation rows. Each mode reports 90 passes,
including `chapter-22/22.11--pragma-invalid.sv`: a bare `` `pragma `` is rejected
because its name is required by IEEE 1800-2023 22.11. Upstream preprocessing
verdicts check process success and expected failure; they do not compare the
emitted text against a golden file.

The official runner’s process exit code is separate from the case verdict.
The wrapper reads its `PASS`/`FAIL` log messages; it does not reconstruct their
rules from tool exit codes or `should_fail` metadata. A negative test may pass
because of an unsupported language construct rather than its intended error.
Crashes and timeouts retain the official runner’s verdict and tool return code.

A runner infrastructure error, missing driver or missing source/library/include
directory aborts collection with exit code 2 and cannot update expectations.
A runner infrastructure error, missing driver or unreviewed missing
source/library/include directory aborts collection with exit code 2 and cannot
update expectations. One upstream input defect is retained explicitly in
[`input-issues.json`](input-issues.json): `uvm_alu_config_analysis` has a string
instead of a source-file list and a combined include-directory entry. For that
case, exact missing include path, and pinned revision only, the adapter forwards
the original input to the driver, which reports the missing include and fails.
It remains in the dashboard-compatible denominator, with an `input_issue` report
column and `upstream_input_issues` summary count; this is not a language-support
failure. No generated source or metadata is repaired, and negative tests cannot
use this exception to gain a false pass.
The UVM submodules named by upstream `conf/runners/libs.json` must be available
before any test runs. Nonempty `simvariants` currently cause an explicit adapter
preparation error because the Celox driver has no runtime plusarg support;
variants are never silently ignored.
before any test runs. For simulation cases, each `simvariants` entry is forwarded
as one plusarg
to a fresh simulation, in upstream order. A failed run stops the driver; logs
from successful runs still reach the official assertion evaluator. The official
runner timeout covers the complete invocation, including all variants.
Elaboration/parsing cases do not execute variants.

## Running locally

Use the locked development shell, which provides Python with `psutil`, or install
the pinned [`requirements.txt`](requirements.txt) in a Python environment.
Use the locked development shell and install the pinned [`requirements.txt`](requirements.txt) in a Python environment.

```bash
python3 -m venv work/sv-tests-venv
work/sv-tests-venv/bin/pip install -r conformance/sv-tests/requirements.txt
git clone https://github.com/chipsalliance/sv-tests.git ../sv-tests
git -C ../sv-tests checkout "$(cat conformance/sv-tests/revision)"
git -C ../sv-tests submodule update --init --depth 1 \
third_party/tests/uvm third_party/tests/uvm-1.2
third_party/tests/uvm third_party/tests/uvm-1.2 \
third_party/tests/easyUVM third_party/tests/uvm-examples
work/sv-tests-venv/bin/python conformance/sv-tests/prepare.py ../sv-tests
cargo build --locked --release -p celox --features systemverilog --example sv_tests
PYTHONDONTWRITEBYTECODE=1 python3 conformance/sv-tests/run.py ../sv-tests \
PYTHONDONTWRITEBYTECODE=1 work/sv-tests-venv/bin/python conformance/sv-tests/run.py ../sv-tests \
--driver target/release/examples/sv_tests --out-dir work/sv-tests --jobs 4 \
--expected conformance/sv-tests/expected.tsv --report work/sv-tests-report.tsv
```
Expand All @@ -88,7 +125,15 @@ Both state modes run by default. Use `--state-mode 2state` or
selects the default. After reviewing changed verdicts, add `--update` to rewrite
expectations. A single-mode update preserves the other mode’s rows. Missing
cases and changed results are checked independently for each selected mode.
Update `revision` and the measured expectations together when upgrading upstream.
Update `revision`, the reviewed counts/provenance in `corpus.json`, and the
measured expectations together when upgrading upstream.

## Historical baseline reviews

The notes below describe earlier changes to the 1,027-case, checked-in-only
corpus at `c4229f3bd5220e6d3ba8f390e5d09c87e462e9c7`. Counts and support
boundaries are snapshots from those changes, not the current generated-corpus
totals. Use `expected.tsv` and the current run summary for present results.

The native-parser transition reviews twenty expectation rows separately from grammar
repairs. The six module-level deferred `assert`, `assume`, and `cover` probes
Expand Down Expand Up @@ -224,6 +269,8 @@ high-impedance values are checked by the shared undriven-net simulation cases.
The [reviewed CI run](https://github.com/celox-sim/celox/actions/runs/40112270471)
changes only these two verdicts across 2,054 mode runs.

## Reports and contract tests

The report contains each case’s state mode, verdict, selected execution mode,
tags, tool return code and path to the official log. The output directory retains
both the official log and runner diagnostics for each case and state mode.
Expand All @@ -232,7 +279,7 @@ Run the adapter contract fixtures against the same upstream checkout:

```bash
SV_TESTS_ROOT=../sv-tests PYTHONDONTWRITEBYTECODE=1 \
python3 -m unittest discover -s conformance/sv-tests -p 'test_*.py' -v
work/sv-tests-venv/bin/python -m unittest discover -s conformance/sv-tests -p 'test_*.py' -v
```

These fixtures exercise the actual upstream runner with a controlled driver,
Expand Down
8 changes: 8 additions & 0 deletions conformance/sv-tests/corpus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"scope": "main",
"main_cases": 1650,
"generated_cases": 622,
"reference_report": "https://chipsalliance.github.io/sv-tests-results/",
"reference_build": "https://github.com/chipsalliance/sv-tests/actions/runs/40150201340",
"reference_date": "2026-10-25"
}
Loading
Loading