Skip to content

feat(sv)!: defer assertions of combinational processes, module items and covers - #1878

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a
Oct 25, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a

Conversation

@tignear

@tignear tignear commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The previous change deferred the actions of deferred assertions in processes. This one covers the rest of IEEE 1800-2023 16.4, the third part of SVA stage 1 (#89):

  • Combinational processes (always_comb, always_latch, and an always lowered as combinational logic) reported deferred assertions at once. Their flush point is each run of the process (16.4.2), and their actions now wait like those of other processes.
  • Module items: a deferred assertion was rejected (module deferred immediate assertion). It is now the same assertion in an always_comb (16.4.3).
  • Deferred cover (cover #0, cover final) was rejected. Its pass action now waits and matures like an assertion's.

Symbolic always_comb. Combinational logic is fused and levelized, so the host decides when a process runs again: when its activation group is active (comb_activation::active_sites). This now also flushes its queue:

  • The SV frontend gives the action site of a deferred assertion DeferredSite::Action with the process's activation group as its queue. Lowering sets the group and shifts it like the other combinational sites.
  • Before the backend evaluates, the simulator takes in the events already issued, then flushes the queue of each active group that has deferred actions (Simulator::flush_comb_deferred). An earlier action of the group is discarded, and a new one waits.
  • A group can also run again because the evaluation changed one of its inputs, as through a continuous assignment; the backend then enables its observers itself. After the evaluation, the simulator reads those enables (the new SimBackend::comb_capture_event_enabled) and flushes what such a group had waiting from before (Simulator::flush_comb_rerun_deferred). Its new actions are still in the backend's buffer and wait.
  • A deferred $fatal has no fatal code in its observer: combinational logic settles, and the simulation ends when the action matures.

Gated processes. An always that the frontend lowers as a gated imperative unit (Ff::lower_comb_process) reports a flush-point event at the start of each run, as an edge-triggered process does.

Module items. The parser reads a module item that starts with assert, assume or cover (optionally labeled) followed by #0 or final as an always_comb procedure whose body is the assertion (Parser::static_deferred_assertion), also in a generate region or block (generate, if/for generate blocks and generate case).

Slots without a step. A design without events may never step, and the initial settle of combinational logic belongs to time zero. Simulation::drain_runtime_events therefore settles dirty combinational logic and then matures the queue when nothing more is due at the current time, which ends the slot. A fatal action found there is drained as a fatal report. A run with set_fail_on matures the slot itself before it checks the reports, also the actions of an earlier settle at that time, so a failure there stops the run. A run or step without it that leaves such a slot settles its logic if it is dirty and matures the actions waiting at that time first (Simulation::end_idle_slot, also in advance_to), also those of an earlier settle at that time such as eval_comb, so a deferred $fatal there ends the run at that time.

Untimed hosts. A Simulator call is a time slot. Without a scheduler, the queue matures at the end of the public calls that settle combinational logic (Simulator::end_untimed_slot): eval_comb, an event drain, and a modify while a RuntimeEventDrain is active, besides the ticks and edges of the previous change. A settle inside a call, such as the one before the flip-flops of a tick, does not end the slot, so the settle after them can flush what failed in between. A drain returns a fatal action as a fatal report rather than failing (Simulator::timed tells timed hosts apart).

Validation

  • New cases in crates/celox/tests/sv_deferred_assertions.rs:
    • always_comb assert #0 (a == y) with assign y = ~x: a = 1; #0 x = 0; reports nothing, since the run caused by the change of y flushes the first failure. Without the flush after the evaluation the failure was reported;
    • module-level assert #0 in generate ... endgenerate, an if and a for generate block and a generate case: a glitch is flushed and a lasting failure reports once. Without the parser change they were parse errors;
    • set_fail_on(Error) with an always_comb assert #0 (a) else $error and no events: run_until(10) stops at 0 with the failure. Without the change it ran to 10.
    • without set_fail_on, an always_comb assert #0 (a) else $fatal with no events ends run_until(10) at 0 with an error, and so does step() with an initial #5 scheduled. Without the change both returned Ok. The same holds after eval_comb() or run_until(0) already settled the logic, for a step() with nothing scheduled, for advance_to(1), and with set_fail_on after eval_comb().
  • crates/celox/tests/sv_deferred_assertions.rs, new cases on the interpreter, cranelift, native and wasm backends:
    • in always_comb (with #0 and final), in always @(a or b) and as module items (assert #0, assume final): a glitch from a = 1; #0 b = 1; is flushed by the second run, and a lasting failure reports once;
    • cover #0 reports its pass action for a lasting difference and nothing for a glitch;
    • a deferred $fatal in always_comb ends the run at the end of a slot in which the failure lasted, not in the slot of a glitch;
    • a module-level assume #0 of a design without events reports after run_until(0). Without the maturity in the drain it is not reported;
    • on a Simulator, an always_comb action matures when the initial settle or a modify settles combinational logic.
  • New non-backend cases:
    • a drain of a Simulator whose always_comb holds a failing assert #0 ... else $fatal returns the fatal report. Without the change the drain panicked;
    • with always_ff @(posedge clk) q <= 1'b1 and always_comb assert #0 (!clk || q), a tick after a host write reports nothing: the failure of the settle before the flip-flops is flushed by the one after them. Without the change it was reported;
    • the first drain of a Simulation with a failing module-level assert #0 returns the report. Without the change only a second drain did.
  • Parser and analyzer: module-level deferred assertions (labeled or not, all three keywords, both deferrals) become always_comb procedures and analyze. The tests that expected rejection now check that, and that a deferred cover with an assignment action is rejected.
  • cargo nextest run with CI's features (celox/systemverilog,celox-test-suite/verilator,celox-test-suite/icarus) on celox, celox-frontend-{core,sv,veryl}, celox-sv-analyzer, celox-sv-syntax, celox-runtime, celox-design, celox-slt, celox-test-suite, celox-vpi and celox-napi: 15,403 passed. After the maturity in the drain, celox, celox-vpi and celox-napi again: 14,025 passed.
  • sv-tests conformance (conformance/sv-tests/run.py): 12 runs go from fail to pass, and expected.tsv is updated: 16.2--assert0, --assert-final, --assume0, --assume-final, --cover0 and --cover-final, in both state modes. They are elaboration tests of module-level deferred assertions. Each was also simulated with the driver:
    • assert0 and assert-final (a = 1) report nothing;
    • assume0 and assume-final, whose a is an undriven input (0 or X), report assume failed from their default $error;
    • cover0 and cover-final have no action.
      No other result changed.
  • cargo clippy --workspace --all-targets with CI's features and -D warnings, clippy of celox without default features, cargo fmt --check.

BREAKING CHANGE

  • Deferred assertions in combinational processes report when they mature, and a re-run of the process discards them.
  • Module-level deferred assertions and deferred covers are accepted.

@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-25T10:01:35.925964Z 71e4e4f 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(sv)!: defer assertions of combinational processes, module items and covers #1878 👈
2 feat(sv): support $sampled in processes #1879
3 feat(sv): support $past and the value change functions in clocked processes #1880
4 fix(sv)!: give reports the time they are issued at #1881
5 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: 87fc9d661a

ℹ️ 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/src/simulator.rs Resolved
Comment thread crates/celox/src/simulation.rs Resolved
Comment thread crates/celox/src/simulator.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/defer-assertions-combinational-processes-module--dc510d3a branch from 87fc9d6 to b3f39f3 Compare October 24, 2026 11:06
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-actions-deferred-assertions-processes--1062591d branch from 713d3a6 to 4e94918 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 87fc9d6 2026-10-24 11:03 UTC
2 content 87fc9d6 → b3f39f3 Review: mature only at outer untimed boundaries, drain fatal actions as reports, settle before the first drain matures 2026-10-24 11:03 UTC
3 rebase b3f39f3 → c9f6320 (rebase only) 2026-10-24 12:11 UTC
4 rebase c9f6320 → 0e7031c (rebase only) 2026-10-24 18:21 UTC
5 rebase 0e7031c → 8821d4c (rebase only) 2026-10-24 21:36 UTC
6 content 8821d4c → 736ab81 (raw) 2026-10-25 04:27 UTC
7 content 736ab81 → 4da191c (raw) 2026-10-25 05:14 UTC
8 rebase 4da191c → e3ce7bf (rebase only) 2026-10-25 06:02 UTC
9 content e3ce7bf → 32b8420 2026-10-25 06:58 UTC
10 content 32b8420 → 03fc450 2026-10-25 08:25 UTC
11 content 03fc450 → 0857710 2026-10-25 08:57 UTC
12 content 0857710 → 086b802 2026-10-25 09:46 UTC
13 content 086b802 → 71e4e4f 2026-10-25 09:59 UTC

@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a branch from b3f39f3 to c9f6320 Compare October 24, 2026 12:12
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-actions-deferred-assertions-processes--1062591d branch from 4e94918 to a81005a Compare October 24, 2026 12:12

@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: c9f6320722

ℹ️ 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/src/simulator.rs Resolved
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-actions-deferred-assertions-processes--1062591d branch from a81005a to 2ab3a7f Compare October 24, 2026 18:24
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a branch from c9f6320 to 0e7031c Compare October 24, 2026 18:24

@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: 0e7031c286

ℹ️ 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/src/simulation.rs Resolved
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a branch from 0e7031c to 8821d4c Compare October 24, 2026 21:38
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-actions-deferred-assertions-processes--1062591d branch from 2ab3a7f to 78475a1 Compare October 24, 2026 21:38
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a branch from 8821d4c to 736ab81 Compare October 25, 2026 04:28
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-actions-deferred-assertions-processes--1062591d branch from 78475a1 to 6ea4a3b Compare October 25, 2026 04:28
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-actions-deferred-assertions-processes--1062591d branch from 6ea4a3b to fce39bf Compare October 25, 2026 05:15
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a branch from 736ab81 to 4da191c Compare October 25, 2026 05:15
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a branch from 4da191c to e3ce7bf Compare October 25, 2026 06:02
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-actions-deferred-assertions-processes--1062591d branch from fce39bf to 1a5e079 Compare October 25, 2026 06:02
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a branch from e3ce7bf to 32b8420 Compare October 25, 2026 06:59

@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: 32b8420710

ℹ️ 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/src/simulation.rs Resolved
Base automatically changed from stack/tignear/feat/sva-stage1/defer-actions-deferred-assertions-processes--1062591d to master October 25, 2026 07:13
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a branch from 32b8420 to 03fc450 Compare October 25, 2026 08:28

@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: 03fc450068

ℹ️ 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/src/simulation.rs Resolved
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a branch from 03fc450 to 0857710 Compare October 25, 2026 08:57

@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: 08577108d7

ℹ️ 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/src/simulation.rs Resolved
Comment thread crates/celox/src/simulation.rs Resolved
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a branch from 0857710 to 086b802 Compare October 25, 2026 09:46

@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: 086b802c82

ℹ️ 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/src/simulation.rs Resolved
…and covers

## Summary

The previous change deferred the actions of deferred assertions in processes. This one covers the rest of IEEE 1800-2023 16.4, the third part of SVA stage 1 (#89):
- **Combinational processes** (`always_comb`, `always_latch`, and an `always` lowered as combinational logic) reported deferred assertions at once. Their flush point is each run of the process (16.4.2), and their actions now wait like those of other processes.
- **Module items:** a deferred assertion was rejected (`module deferred immediate assertion`). It is now the same assertion in an `always_comb` (16.4.3).
- **Deferred cover** (`cover #0`, `cover final`) was rejected. Its pass action now waits and matures like an assertion's.

**Symbolic `always_comb`.** Combinational logic is fused and levelized, so the host decides when a process runs again: when its activation group is active (`comb_activation::active_sites`). This now also flushes its queue:
- The SV frontend gives the action site of a deferred assertion `DeferredSite::Action` with the process's activation group as its queue. Lowering sets the group and shifts it like the other combinational sites.
- Before the backend evaluates, the simulator takes in the events already issued, then flushes the queue of each active group that has deferred actions (`Simulator::flush_comb_deferred`). An earlier action of the group is discarded, and a new one waits.
- A group can also run again because the evaluation changed one of its inputs, as through a continuous assignment; the backend then enables its observers itself. After the evaluation, the simulator reads those enables (the new `SimBackend::comb_capture_event_enabled`) and flushes what such a group had waiting from before (`Simulator::flush_comb_rerun_deferred`). Its new actions are still in the backend's buffer and wait.
- A deferred `$fatal` has no fatal code in its observer: combinational logic settles, and the simulation ends when the action matures.

**Gated processes.** An `always` that the frontend lowers as a gated imperative unit (`Ff::lower_comb_process`) reports a flush-point event at the start of each run, as an edge-triggered process does.

**Module items.** The parser reads a module item that starts with `assert`, `assume` or `cover` (optionally labeled) followed by `#0` or `final` as an `always_comb` procedure whose body is the assertion (`Parser::static_deferred_assertion`), also in a generate region or block (`generate`, `if`/`for` generate blocks and generate `case`).

**Slots without a step.** A design without events may never step, and the initial settle of combinational logic belongs to time zero. `Simulation::drain_runtime_events` therefore settles dirty combinational logic and then matures the queue when nothing more is due at the current time, which ends the slot. A fatal action found there is drained as a fatal report. A run with `set_fail_on` matures the slot itself before it checks the reports, also the actions of an earlier settle at that time, so a failure there stops the run. A run or step without it that leaves such a slot settles its logic if it is dirty and matures the actions waiting at that time first (`Simulation::end_idle_slot`, also in `advance_to`), also those of an earlier settle at that time such as `eval_comb`, so a deferred `$fatal` there ends the run at that time.

**Untimed hosts.** A `Simulator` call is a time slot. Without a scheduler, the queue matures at the end of the public calls that settle combinational logic (`Simulator::end_untimed_slot`): `eval_comb`, an event drain, and a `modify` while a `RuntimeEventDrain` is active, besides the ticks and edges of the previous change. A settle inside a call, such as the one before the flip-flops of a tick, does not end the slot, so the settle after them can flush what failed in between. A drain returns a fatal action as a fatal report rather than failing (`Simulator::timed` tells timed hosts apart).

## Validation

- New cases in `crates/celox/tests/sv_deferred_assertions.rs`:
  - `always_comb assert #0 (a == y)` with `assign y = ~x`: `a = 1; #0 x = 0;` reports nothing, since the run caused by the change of `y` flushes the first failure. Without the flush after the evaluation the failure was reported;
  - module-level `assert #0` in `generate ... endgenerate`, an `if` and a `for` generate block and a generate `case`: a glitch is flushed and a lasting failure reports once. Without the parser change they were parse errors;
  - `set_fail_on(Error)` with an `always_comb assert #0 (a) else $error` and no events: `run_until(10)` stops at 0 with the failure. Without the change it ran to 10.
  - without `set_fail_on`, an `always_comb assert #0 (a) else $fatal` with no events ends `run_until(10)` at 0 with an error, and so does `step()` with an `initial #5` scheduled. Without the change both returned `Ok`. The same holds after `eval_comb()` or `run_until(0)` already settled the logic, for a `step()` with nothing scheduled, for `advance_to(1)`, and with `set_fail_on` after `eval_comb()`.
- `crates/celox/tests/sv_deferred_assertions.rs`, new cases on the interpreter, cranelift, native and wasm backends:
  - in `always_comb` (with `#0` and `final`), in `always @(a or b)` and as module items (`assert #0`, `assume final`): a glitch from `a = 1; #0 b = 1;` is flushed by the second run, and a lasting failure reports once;
  - `cover #0` reports its pass action for a lasting difference and nothing for a glitch;
  - a deferred `$fatal` in `always_comb` ends the run at the end of a slot in which the failure lasted, not in the slot of a glitch;
  - a module-level `assume #0` of a design without events reports after `run_until(0)`. Without the maturity in the drain it is not reported;
  - on a `Simulator`, an `always_comb` action matures when the initial settle or a `modify` settles combinational logic.
- New non-backend cases:
  - a drain of a `Simulator` whose `always_comb` holds a failing `assert #0 ... else $fatal` returns the fatal report. Without the change the drain panicked;
  - with `always_ff @(posedge clk) q <= 1'b1` and `always_comb assert #0 (!clk || q)`, a tick after a host write reports nothing: the failure of the settle before the flip-flops is flushed by the one after them. Without the change it was reported;
  - the first drain of a `Simulation` with a failing module-level `assert #0` returns the report. Without the change only a second drain did.
- Parser and analyzer: module-level deferred assertions (labeled or not, all three keywords, both deferrals) become `always_comb` procedures and analyze. The tests that expected rejection now check that, and that a deferred cover with an assignment action is rejected.
- `cargo nextest run` with CI's features (`celox/systemverilog,celox-test-suite/verilator,celox-test-suite/icarus`) on celox, celox-frontend-{core,sv,veryl}, celox-sv-analyzer, celox-sv-syntax, celox-runtime, celox-design, celox-slt, celox-test-suite, celox-vpi and celox-napi: 15,403 passed. After the maturity in the drain, celox, celox-vpi and celox-napi again: 14,025 passed.
- sv-tests conformance (`conformance/sv-tests/run.py`): 12 runs go from fail to pass, and `expected.tsv` is updated: `16.2--assert0`, `--assert-final`, `--assume0`, `--assume-final`, `--cover0` and `--cover-final`, in both state modes. They are elaboration tests of module-level deferred assertions. Each was also simulated with the driver:
  - `assert0` and `assert-final` (`a = 1`) report nothing;
  - `assume0` and `assume-final`, whose `a` is an undriven input (0 or X), report `assume failed` from their default `$error`;
  - `cover0` and `cover-final` have no action.
  No other result changed.
- `cargo clippy --workspace --all-targets` with CI's features and `-D warnings`, clippy of `celox` without default features, `cargo fmt --check`.

## BREAKING CHANGE

- Deferred assertions in combinational processes report when they mature, and a re-run of the process discards them.
- Module-level deferred assertions and deferred covers are accepted.

Change-Id: Idc510d3a28cde5401f0327b296ab70cab8e67d19
@tignear
tignear force-pushed the stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a branch from 086b802 to 71e4e4f Compare October 25, 2026 09:59
@tignear

tignear commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 53 minutes 44 seconds in the queue, including 27 minutes 9 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued Mergify queue entry label Oct 25, 2026
@mergify
mergify Bot merged commit e389d90 into master Oct 25, 2026
40 of 42 checks passed
@mergify
mergify Bot deleted the stack/tignear/feat/sva-stage1/defer-assertions-combinational-processes-module--dc510d3a branch October 25, 2026 11:52
@mergify mergify Bot removed the queued Mergify queue entry label Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant