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
48 changes: 46 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ jobs:
case "$feature" in celox/*) args+=(--features "$feature");; esac
done
CELOX_COCOTB_PYTHON="$(command -v python)" \
cargo test --locked -p celox-vpi "${args[@]}" --test cocotb_e2e \
cocotb_drives_an_attached_native_flip_flop -- --exact --ignored
cargo test --locked -p celox-vpi --features systemverilog "${args[@]}" --test cocotb_e2e \
cocotb_ -- --ignored

external-suites:
name: External suite (${{ matrix.suite }}, ${{ matrix.tool }})
Expand Down Expand Up @@ -385,6 +385,49 @@ jobs:
if-no-files-found: error
retention-days: 14

common-cells:
name: Upstream SystemVerilog testbench
if: ${{ !cancelled() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7

- uses: ./.github/actions/setup-rust

- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}

- uses: actions/setup-node@v7
with:
node-version: 24

- name: Fetch pinned common_cells
run: |
revision="$(cat conformance/common-cells/revision)"
git init -q "$RUNNER_TEMP/common-cells"
git -C "$RUNNER_TEMP/common-cells" fetch -q --depth 1 \
https://github.com/pulp-platform/common_cells.git "$revision"
git -C "$RUNNER_TEMP/common-cells" checkout -q FETCH_HEAD

- name: Build the SystemVerilog CLI
run: cargo build --locked -p celox-vpi --features systemverilog --bin celox

- name: Run upstream TB and assertion negative control
run: >-
node scripts/run-common-cells.mjs "$RUNNER_TEMP/common-cells"
target/debug/celox "$RUNNER_TEMP/common-cells-results"

- name: Retain testbench logs
if: always()
uses: actions/upload-artifact@v7
with:
name: common-cells-results
path: ${{ runner.temp }}/common-cells-results
if-no-files-found: ignore
retention-days: 14

sv-tests:
name: sv-tests conformance
needs: changes
Expand Down Expand Up @@ -879,6 +922,7 @@ jobs:
rust-tests,
sv-tests,
external-suites,
common-cells,
napi-linux,
napi-wasm,
rust,
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ Local validation uses the behavior-based matrix above.
| Daily at 01:47 UTC (10:47 JST) | `bench.yml` measures Rust, Verilator, and TypeScript on one host and publishes master history. Manual dispatch supports branch measurements. |
| Daily at 02:17 UTC (11:17 JST) | `codspeed.yml` measures compile time on the default branch using CPU simulation. Execution failures and CodSpeed performance-check failures open or update a branch issue; the next healthy run closes it. Manual dispatch supports branch measurements. PRs, merge groups, and pushes do not run CodSpeed. |
| Daily at 02:37 UTC (11:37 JST) | `heliodor-bench.yml` runs the complete master Linux suite on x86-64 and AArch64. Explicit manual selections retain focused suite runs and ARM64 profiling. PRs do not run this workflow; its tooling tests run in `Lint & Format` with the other script tests. |
| Every daily/manual full CI run | Run the pinned upstream `common_cells` Gray code SV TB through `celox run --project`, plus an assertion negative control. Logs are retained for 14 days and failures feed the Full CI issue. See [the reproduction instructions](conformance/common-cells/README.md). |
| Every full CI run | Run every shared Veryl and SystemVerilog case against both Verilator and Icarus, with locked Nix tools. Run the live adapter tests normally marked ignored because they need external tools. Preserve reports and per-case diagnostics as artifacts for 14 days, including on failure; matrix failures do not cancel the other comparisons. |
| Affected pull requests and merge groups; daily at 03:41 UTC (12:41 JST); on demand | `lydite-checks.yml` owns Lydite Rust tests, proof, conformance, editor, and mutation gates. Unrelated changes skip these jobs, and Celox changes skip the bridge. Daily and manual runs enable all lanes and report failures in an issue. |
| On demand | Dispatch `ci.yml` on the desired branch to run full CI and external comparisons, regardless of its diff. |
Expand Down
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions conformance/common-cells/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Upstream SystemVerilog testbench smoke test

Daily full CI runs the unmodified `cc_graycode_tb` from
[PULP common_cells](https://github.com/pulp-platform/common_cells), pinned by
[`revision`](revision). The same job runs on manual `ci.yml` dispatches and on
develop's nightly full CI. It exercises the `celox run --project` CLI with the
SystemVerilog frontend and native timed simulation.

The default 9-bit TB applies 1,536 inputs using loops, `#1` delays, an untimed
task, and immediate assertions. It checks binary/Gray round trips and changes
in the Gray code population count. This is a small combinational design smoke
test, not coverage of all common_cells modules or clocked testbenches.

The gate first requires the original RTL/TB to exit successfully. It then forces
the Gray encoder output to zero in a separate RTL copy and requires exit code 1
with an assertion diagnostic. Compilation errors, crashes and timeouts do not
satisfy this negative control. Upstream files are never edited. Each execution
has a two-minute wall timeout and the CLI's default scheduler step limit.

To reproduce from the repository root:

```sh
revision="$(cat conformance/common-cells/revision)"
git init work/common-cells
git -C work/common-cells fetch --depth 1 https://github.com/pulp-platform/common_cells.git "$revision"
git -C work/common-cells checkout FETCH_HEAD
cargo build --locked -p celox-vpi --features systemverilog --bin celox
node scripts/run-common-cells.mjs work/common-cells target/debug/celox work/common-cells-results
```

The output directory contains the generated `celox.toml`, negative-control
sources, both logs, and a `result.json` written only after both checks pass.
Use a fresh output directory for each run. CI retains this directory for 14 days,
including on failure; failures feed the existing Full CI issue reporter.

Update the pin deliberately after reviewing and running the upstream TB. The
negative-control assignment is checked explicitly so an upstream rewrite cannot
silently remove that check.
1 change: 1 addition & 0 deletions conformance/common-cells/revision
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e73baaec2ca665cd80c3c384e9258e35242b829c
8 changes: 8 additions & 0 deletions crates/celox-frontend-sv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,11 @@ pub use lowering::{
schedule_sources,
};
pub use lowering::{InterfaceSignature, interface_signatures, interface_signatures_for};

pub use celox_sv_analyzer::AnalysisOptions;
pub use lowering::{
interface_signatures_for_with_options,
prepare_external_hierarchy_with_foreign_resolver_with_options, schedule_sources_with_options,
};

pub use lowering::schedule_sources_with_force_signals;
Loading
Loading