Skip to content

feat(sim)!: report severity, location and assertion of severity tasks - #1875

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/sva-stage1/report-severity-location-assertion-severity-tasks--4abb3cc4
Oct 24, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/sva-stage1/report-severity-location-assertion-severity-tasks--4abb3cc4

Conversation

@tignear

@tignear tignear commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

IEEE 1800-2023 20.10 has every severity task report its severity, the file and line of the call, the scope that issued it and the simulation time. Celox lost most of this:

  • $info, $warning and $error all became RuntimeEvent::AssertContinue, so the severity was gone;
  • events carried no location and no scope;
  • the celox command failed a run on $warning and $info.

This is the first part of SVA stage 1 (#89). Deferred assertions and concurrent assertions will report through the same record.

RuntimeEvent::Report. It replaces AssertContinue and AssertFatal. A Report has:

  • severity: Info, Warning, Error or Fatal;
  • message: the formatted bytes, as before;
  • scope: from the drain context, else the scope of the site;
  • location: the file and line as `__FILE__ and `__LINE__ give them, so `line directives apply;
  • assertion: for a report from an action block of an immediate assertion, its statement label (which names it in its scope, 16.3), assert/assume/cover, and whether the pass or the fail action issued it. The default $error of an assert or assume without a fail action has the location of the assertion. Severity tasks in subroutines the action block calls are not attributed;
  • time: the time of the drain context. The VPI host drains at each callback, so its times are exact. A later change stamps events at the end of their time slot for every host.

Report::render formats a report as Error: file:line: message, then the time and the scope. The VPI host and the celox command print reports this way.

Design metadata. RuntimeEventKind::Report(Severity) replaces AssertContinue and AssertFatal. Veryl's $assert is a fatal report and $assert_continue an error. RuntimeEventSite has location and assertion (serde default: none). The SV analyzer records the logical file and line in SourceSpan and attributes severity tasks to their assertion in Stmt::SystemTask::assertion. A task of a nested assertion keeps the attribution of the inner one. The native image container version is 35.

Failures.

  • The celox command fails a run only on $error and $fatal.

  • The Veryl native testbench and the SV suite harness count only errors and fatal reports as failures. They print info and warning reports like $display.

  • $fatal still ends the simulation with an error.

  • lydite's proof backend (lydite/conformance/veryl-proof) accepts reports below Fatal where it accepted AssertContinue, and still fails closed on fatal ones.

  • New crates/celox/tests/sv_reports.rs on the interpreter, cranelift, native and wasm backends:

    • $info, $warning and $error give their severity, message, line and scope;
    • action blocks of a labeled assert (with a $warning fail action and with the default $error), a labeled cover and an unlabeled assume name their assertion and outcome;
    • an always_comb report keeps its location;
    • a `line directive sets the file and line;
    • a failing assertion in the action block of another reports the inner one;
    • plus a unit test of Report::render.
  • New lydite unit test test_events.test_only_nonfatal_runtime_events_are_observed: Display, Write and reports up to Error are observed, and Fatal, Finish and Stop fail closed. The bridge job's veryl-proof gate rejected flip_flop::test_ff_assert_message_output_argument_is_eager without it.

  • New celox command test: a run fails on $error but not on $info or $warning, and each is printed with its severity and location.

  • Existing tests that compare drained events now compare them without the report context, which they do not check. Their messages and severities are unchanged.

  • cargo nextest run with CI's features (celox/systemverilog,celox-test-suite/verilator,celox-test-suite/icarus):

    • celox and celox-vpi: 13,548 passed;
    • celox-frontend-{core,sv,veryl}, celox-sv-analyzer, celox-runtime, celox-design, celox-slt, celox-test-suite and celox-napi: 1,294 passed.
  • sv-tests conformance (conformance/sv-tests/run.py): unchanged from expected.tsv.

  • cargo clippy --workspace --all-targets with CI's features and -D warnings; clippy of celox without default features; cargo fmt --check.

  • celox::RuntimeEvent::AssertContinue and AssertFatal are replaced by RuntimeEvent::Report(Report).

  • celox_design::RuntimeEventKind::AssertContinue and AssertFatal are replaced by RuntimeEventKind::Report(Severity).

  • celox_design::RuntimeEventSite has the new fields location and assertion.

  • celox_sv_analyzer::ir::SourceSpan has the new fields logical_path and line, and Stmt::SystemTask has assertion.

  • The celox command no longer fails a run on $info or $warning, and prints reports with their severity and location.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T21:39:47.755299Z a8d379a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tignear

tignear commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(sim)!: report severity, location and assertion of severity tasks #1875 👈
2 feat(sim): fail runs on reports and drain runtime events in TypeScript #1876
3 fix(sv)!: defer the actions of deferred assertions in processes #1877
4 feat(sv)!: defer assertions of combinational processes, module items and covers #1878
5 feat(sv): support $sampled in processes #1879
6 feat(sv): support $past and the value change functions in clocked processes #1880
7 fix(sv)!: give reports the time they are issued at #1881
8 feat(sv): sample static locals and combinational logic, and infer more clocks of $past #1882

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2da588a274

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/celox-design/src/lib.rs Resolved
@mergify

mergify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/report-severity-location-assertion-severity-tasks--4abb3cc4 branch from 2da588a to 1a9cabc Compare October 24, 2026 11:06
@tignear

tignear commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial 2da588a 2026-10-24 11:03 UTC
2 content 2da588a → 1a9cabc Review: keep the attribution of nested assertions; bump CONTAINER_VERSION for the report sites 2026-10-24 11:03 UTC
3 content 1a9cabc → e96ed5a 2026-10-24 12:11 UTC
4 content e96ed5a → 960a5f3 2026-10-24 18:21 UTC
5 content 960a5f3 → a8d379a 2026-10-24 21:36 UTC

@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/report-severity-location-assertion-severity-tasks--4abb3cc4 branch from 1a9cabc to e96ed5a Compare October 24, 2026 12:12
@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 24, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 24, 2026
@mergify

mergify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-24 15:01 UTC · Rule: changes · triggered by rule Queue explicitly requested merges
  • 🚫 Left the queue — 2026-10-24 16:20 UTC · at e96ed5a178672f56a1224dd9e5451dccf459128c

This pull request spent 1 hour 18 minutes 59 seconds in the queue, with no time running CI.

Reason

The pull request conflicts with the base branch

The pull request was held in the queue, conflicting with at least one of 4 pull requests ahead of it. The conflict became a base branch one after #1838, #1847, #1884 merged.

Hint

You should update or rebase your pull request.

If you want to requeue this pull request, you can post a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

@mergify mergify Bot added dequeued Mergify stopped this queue entry; investigate before retrying and removed queued Mergify queue entry labels Oct 24, 2026
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/report-severity-location-assertion-severity-tasks--4abb3cc4 branch from e96ed5a to 960a5f3 Compare October 24, 2026 18:24
@mergify mergify Bot added queued Mergify queue entry and removed dequeued Mergify stopped this queue entry; investigate before retrying labels Oct 24, 2026
@mergify

mergify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 48 minutes 26 seconds in the queue, including 3 minutes 43 seconds running CI.

Reason

The merge conditions cannot be satisfied due to failing checks

  • Lint & Format

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

@mergify mergify Bot added dequeued Mergify stopped this queue entry; investigate before retrying and removed queued Mergify queue entry labels Oct 24, 2026
IEEE 1800-2023 20.10 has every severity task report its severity, the file and line of the call, the scope that issued it and the simulation time. Celox lost most of this:
- `$info`, `$warning` and `$error` all became `RuntimeEvent::AssertContinue`, so the severity was gone;
- events carried no location and no scope;
- the `celox` command failed a run on `$warning` and `$info`.

This is the first part of SVA stage 1 (#89). Deferred assertions and concurrent assertions will report through the same record.

**`RuntimeEvent::Report`.** It replaces `AssertContinue` and `AssertFatal`. A `Report` has:
- `severity`: `Info`, `Warning`, `Error` or `Fatal`;
- `message`: the formatted bytes, as before;
- `scope`: from the drain context, else the scope of the site;
- `location`: the file and line as `` `__FILE__ `` and `` `__LINE__ `` give them, so `` `line `` directives apply;
- `assertion`: for a report from an action block of an immediate assertion, its statement label (which names it in its scope, 16.3), `assert`/`assume`/`cover`, and whether the pass or the fail action issued it. The default `$error` of an `assert` or `assume` without a fail action has the location of the assertion. Severity tasks in subroutines the action block calls are not attributed;
- `time`: the time of the drain context. The VPI host drains at each callback, so its times are exact. A later change stamps events at the end of their time slot for every host.

`Report::render` formats a report as `Error: file:line: message`, then the time and the scope. The VPI host and the `celox` command print reports this way.

**Design metadata.** `RuntimeEventKind::Report(Severity)` replaces `AssertContinue` and `AssertFatal`. Veryl's `$assert` is a fatal report and `$assert_continue` an error. `RuntimeEventSite` has `location` and `assertion` (serde default: none). The SV analyzer records the logical file and line in `SourceSpan` and attributes severity tasks to their assertion in `Stmt::SystemTask::assertion`. A task of a nested assertion keeps the attribution of the inner one. The native image container version is 35.

**Failures.**
- The `celox` command fails a run only on `$error` and `$fatal`.
- The Veryl native testbench and the SV suite harness count only errors and fatal reports as failures. They print info and warning reports like `$display`.
- `$fatal` still ends the simulation with an error.
- lydite's proof backend (`lydite/conformance/veryl-proof`) accepts reports below `Fatal` where it accepted `AssertContinue`, and still fails closed on fatal ones.

- New `crates/celox/tests/sv_reports.rs` on the interpreter, cranelift, native and wasm backends:
  - `$info`, `$warning` and `$error` give their severity, message, line and scope;
  - action blocks of a labeled `assert` (with a `$warning` fail action and with the default `$error`), a labeled `cover` and an unlabeled `assume` name their assertion and outcome;
  - an `always_comb` report keeps its location;
  - a `` `line `` directive sets the file and line;
  - a failing assertion in the action block of another reports the inner one;
  - plus a unit test of `Report::render`.
- New lydite unit test `test_events.test_only_nonfatal_runtime_events_are_observed`: `Display`, `Write` and reports up to `Error` are observed, and `Fatal`, `Finish` and `Stop` fail closed. The `bridge` job's veryl-proof gate rejected `flip_flop::test_ff_assert_message_output_argument_is_eager` without it.
- New `celox` command test: a run fails on `$error` but not on `$info` or `$warning`, and each is printed with its severity and location.
- Existing tests that compare drained events now compare them without the report context, which they do not check. Their messages and severities are unchanged.
- `cargo nextest run` with CI's features (`celox/systemverilog,celox-test-suite/verilator,celox-test-suite/icarus`):
  - celox and celox-vpi: 13,548 passed;
  - celox-frontend-{core,sv,veryl}, celox-sv-analyzer, celox-runtime, celox-design, celox-slt, celox-test-suite and celox-napi: 1,294 passed.
- sv-tests conformance (`conformance/sv-tests/run.py`): unchanged from `expected.tsv`.
- `cargo clippy --workspace --all-targets` with CI's features and `-D warnings`; clippy of `celox` without default features; `cargo fmt --check`.

- `celox::RuntimeEvent::AssertContinue` and `AssertFatal` are replaced by `RuntimeEvent::Report(Report)`.
- `celox_design::RuntimeEventKind::AssertContinue` and `AssertFatal` are replaced by `RuntimeEventKind::Report(Severity)`.
- `celox_design::RuntimeEventSite` has the new fields `location` and `assertion`.
- `celox_sv_analyzer::ir::SourceSpan` has the new fields `logical_path` and `line`, and `Stmt::SystemTask` has `assertion`.
- The `celox` command no longer fails a run on `$info` or `$warning`, and prints reports with their severity and location.

Change-Id: I4abb3cc497c11a31008ec8429fedaf365b4689a1
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/report-severity-location-assertion-severity-tasks--4abb3cc4 branch from 960a5f3 to a8d379a Compare October 24, 2026 21:38
@mergify mergify Bot removed the dequeued Mergify stopped this queue entry; investigate before retrying label Oct 24, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 24, 2026
@mergify

mergify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 1 minute 12 seconds in the queue, including 24 minutes 14 seconds running CI.

Required conditions to merge
  • check-success = Conventional Commit title
  • check-success = Queue validation
  • depends-on=celox-sim/celox#1896 [⛓️ feat(runtime)!: run program kernels in the reactive region set #1896 [stack]]
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Lint & Format
    • check-neutral = @github-actions/Lint & Format
    • check-skipped = @github-actions/Lint & Format
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-neutral = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-skipped = @github-actions/NAPI Build (Linux ARM64 GNU)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Windows)
    • check-neutral = @github-actions/NAPI Build (Windows)
    • check-skipped = @github-actions/NAPI Build (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Rust Test & NAPI Build
    • check-neutral = @github-actions/Rust Test & NAPI Build
    • check-skipped = @github-actions/Rust Test & NAPI Build
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Ubuntu)
    • check-neutral = @github-actions/JS Test (Ubuntu)
    • check-skipped = @github-actions/JS Test (Ubuntu)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Windows)
    • check-neutral = @github-actions/JS Test (Windows)
    • check-skipped = @github-actions/JS Test (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Conventional Commit title
    • check-neutral = @github-actions/Conventional Commit title
    • check-skipped = @github-actions/Conventional Commit title

@mergify
mergify Bot merged commit 746fb36 into master Oct 24, 2026
23 checks passed
@mergify
mergify Bot deleted the stack/tignear/feat/sva-stage1/report-severity-location-assertion-severity-tasks--4abb3cc4 branch October 24, 2026 23:40
@mergify mergify Bot removed the queued Mergify queue entry label Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-ready Request merging through Mergify after required checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant