Repository navigation
merge queue: checking #1985 + #1878 + #1977 together on master (041f4d9) - #1996
Closed
mergify[bot] wants to merge 6 commits into
Closed
mergify[bot] wants to merge 6 commits into
mergify[bot] wants to merge 6 commits into
Conversation
…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
Generated pipelines such as r[n] <= n == 0 ? d : r[n-1] rejected r[-1] in the unselected conditional operand. Route constant invalid integral unpacked indices through the existing bounds guard and fold invalid reads to the selected type's X or zero default. Invalid writes remain no-ops. Exclude wholly invalid constant writes from FF target collection before recording pending-state or latch-coverage targets. An empty constant range must not become a dynamic whole-array write and trigger an inferred latch. Update the large-index diagnostic regression to require successful builds without warnings under both error and warn policies. Preserve both conditional operands' width and signedness, as required by IEEE 1800-2023 7.4.5 and 11.4.11. Cover nonzero ascending/descending bounds, multidimensional indices, sequential writes, 129-bit defaults and two-state elements in a four-state simulator. Replace obsolete rejection expectations. Keep the invalid bit-array read regression in Celox's API tests because Icarus 13.0 returns X instead of the required zero for that case. Validation on master feba1a5 with the preceding Native fix: - Full SystemVerilog suite: 5,003 passed across five backends, with 20 existing exclusions; all 29 added regression variants passed. - SV analyzer: 806 passed, three existing ignored, plus both doctests. - Clippy for celox-sv-analyzer and celox, including the SV tests, passed. The unchanged shared cases passed Icarus during validation on master 644beac. Verilator passed the two-state pipeline; the four-state cases remain unsupported by that adapter. The external adapters are unchanged. Rebuilt NAPI: the threads E2E and all three runtime-event addon tests passed. Workspace check (excluding lydite-celox), formatting, lint and submodule checks passed. After restacking on the typed Native merge dispatch, all 12 added Native regression variants and rebuilt NAPI integration checks passed. The threads E2E initially exceeded its 5s limit while builds ran concurrently; an isolated rerun passed with the same 5s limit. All three addon event tests also passed. CI follow-up: the old diagnostic regression expected a range error. Its replacement exposed and now covers the false latch diagnostic above. Validation: all 5,003 SV cases, all 33 diagnostic-policy tests, six frontend unit tests, and clippy for both affected crates/consumers passed. Change-Id: Ib6ba45acc50166a08cbb7851d3efaa20c89de081
This was referenced Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This is a merge queue draft opened by Mergify. Nobody needs to act on it.
Mergify opened it for batch skillful-cresson-fkib51 of the
changesqueue, to test #1985, #1878 and #1977 before they merge intomaster. Pushing to this branch or closing this pull request removes them from the queue.What this draft tests
Mergify checks that #1985, #1878 and #1977 still pass CI on top of
master. CI runs on this draft's code, built in this order:masterat041f4d9🎉 Where it stands: checks passed
CI passed on this draft.
Follow the
changesqueue in the dashboardWhat happens next
masterand closes this draft.Metadata for CI tooling, read by
mergify ci1 scope
coreRequired conditions of queue rule
changesfor mergecheck-success = Conventional Commit titlecheck-success = Queue validationdepends-on = celox-sim/celox#1976[⛓️ fix(native): retain FF publication from other lane tasks #1976]number != 1977master]:check-success = @github-actions/Lint & Formatcheck-neutral = @github-actions/Lint & Formatcheck-skipped = @github-actions/Lint & Formatmaster]: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)master]:check-success = @github-actions/NAPI Build (Windows)check-neutral = @github-actions/NAPI Build (Windows)check-skipped = @github-actions/NAPI Build (Windows)master]:check-success = @github-actions/Rust Test & NAPI Buildcheck-neutral = @github-actions/Rust Test & NAPI Buildcheck-skipped = @github-actions/Rust Test & NAPI Buildmaster]:check-success = @github-actions/JS Test (Ubuntu)check-neutral = @github-actions/JS Test (Ubuntu)check-skipped = @github-actions/JS Test (Ubuntu)master]:check-success = @github-actions/JS Test (Windows)check-neutral = @github-actions/JS Test (Windows)check-skipped = @github-actions/JS Test (Windows)master]:check-success = @github-actions/Conventional Commit titlecheck-neutral = @github-actions/Conventional Commit titlecheck-skipped = @github-actions/Conventional Commit titleRequired conditions to stay in the queue
-conflict-draft-head ~= ^(integration/|renovate/veryl-crates$|upgrade/veryl-|release-please--branches--master--components--celox$|master$)-head ~= ^renovate/-label = release:holdbase ~= ^(master|develop)$base ~= ^stack/body ~= (?m)^Depends-On:head != release-please--branches--master--components--celoxlabel = merge-readydepends-on = celox-sim/celox#1976[⛓️ fix(native): retain FF publication from other lane tasks #1976]number != 1977master]:check-success = @github-actions/Lint & Formatcheck-neutral = @github-actions/Lint & Formatcheck-skipped = @github-actions/Lint & Formatmaster]:check-skipped = @github-actions/NAPI Build (Linux ARM64 GNU)check-neutral = @github-actions/NAPI Build (Linux ARM64 GNU)check-success = @github-actions/NAPI Build (Linux ARM64 GNU)master]:check-skipped = @github-actions/NAPI Build (Windows)check-neutral = @github-actions/NAPI Build (Windows)check-success = @github-actions/NAPI Build (Windows)master]:check-success = @github-actions/Rust Test & NAPI Buildcheck-neutral = @github-actions/Rust Test & NAPI Buildcheck-skipped = @github-actions/Rust Test & NAPI Buildmaster]:check-success = @github-actions/JS Test (Ubuntu)check-neutral = @github-actions/JS Test (Ubuntu)check-skipped = @github-actions/JS Test (Ubuntu)master]:check-skipped = @github-actions/JS Test (Windows)check-neutral = @github-actions/JS Test (Windows)check-success = @github-actions/JS Test (Windows)master]:check-success = @github-actions/Conventional Commit titlecheck-neutral = @github-actions/Conventional Commit titlecheck-skipped = @github-actions/Conventional Commit titleQueue graph
The diagram is not laid out in queue order, so a node's position says nothing about when it merges.
graph LR 38a046b4069d4094a32f70afe46da344["skillful-cresson-fkib51<br/>#1985 + #1878 + #1977<br/>scopes: core"] 7c15b098a52d4367a423cfd7817d811d["flexible-chocolat-tbvnwr<br/>#1990<br/>scopes: core"] 38a046b4069d4094a32f70afe46da344 --> 7c15b098a52d4367a423cfd7817d811d style 38a046b4069d4094a32f70afe46da344 fill:#6366f1,color:#fff