Repository navigation
merge queue: checking #1877 on master (17dedea), stacked on #1960 and #1967 - #1972
Closed
mergify[bot] wants to merge 7 commits into
Closed
mergify[bot] wants to merge 7 commits into
mergify[bot] wants to merge 7 commits into
Conversation
Flattening splits combinational paths at the bit boundaries each variable is accessed at, and propagates boundaries across port connections. Input ports only passed the parent's boundaries to the child, so where a child read its input port in parts the connected parent variable stayed one range. A parent that fed other bits of the child's output back into that variable then formed a combinational loop that does not exist; written in one module, the same logic simulates. The boundaries of the child port now propagate to the parent variable when the connection is one range as wide as the port, mapped onto that range, so the parent is split as it is when it reads the bits itself. Closes #1955 Change-Id: I24f244b6bb1f0b940eef0f1fbae08573ca011747
…ed scheduler
The compiled scheduler rejected every design with gated, inverted or
divided clocks ("the design has derived clocks", "RTL logic drives an
event signal"), so those designs ran every slot in the reference loop.
It now tracks the clocks derived, transitively, from the events its
slots change, and runs a slot's domains in the reference loop's waves:
after the process phase, combinational logic settles; the domains of the
events with an active edge evaluate together with those of the clocks
gated by a changed source whose levels moved to their active edge,
judged then, whose levels become their baselines; a slot without an
active edge runs every tracked event whose level moved to its active
edge. After each wave commits and logic settles, the domains not run yet
whose clocks moved to their active edge run in another, until none
does. Baselines are the levels of the tracked events at the slot's
start, in the levels slot, which now covers the derived clocks too, so
a run that returns in the middle of a slot leaves their levels as the
reference does.
RTL logic may drive exactly those derived clocks. A design with derived
clocks keeps the reference loop when a waiting kernel stages
nonblocking assignments, a tracked domain commits in the active region,
or a tracked domain may end the run; and when the host observes a
derived clock, which changes in the slots of its sources.
Change-Id: Ibb48c1e36a21599607c012f0e6748de35e2616ae
Two cases where the waves of a slot with derived clocks differed from the reference loop's: - A host clock input with no clock armed kept its slot-start level out of the levels slot, which only the clock-apply block filled. The waves compared against zero, so a gate on a clock input the host had set high fired its source's domain at every slot. The levels of every tracked event are now recorded at the slot's start. - A waiting kernel woken by a clock's change runs in a pass after the settle that judges the clocks gated by it; what it writes moves those clocks only for the waves after the commit. The waves judge once, after every pass, so a design with gated clocks whose waiting kernels write what combinational logic reads keeps the reference loop. Change-Id: I42793209eeebcfeffaf0fbc08b91fc586edc58f0
`assert #0`, `assume #0`, `assert final` and `assume final` in a process reported at once, like simple immediate assertions. Glitches that a deferred assertion exists to hide were therefore reported. IEEE 1800-2023 16.4 instead has the action wait in the process's deferred assertion report queue: - its arguments are evaluated when the assertion executes; - a flush point of the process discards what waits (16.4.2): a resume from an event control or a wait, but not a resume after a delay; - what is left matures in the Observed region (`#0`) or the Postponed region (`final`) of the time slot. This is the second part of SVA stage 1 (#89). **Flush points as events.** - The SV frontend gives a process that holds a deferred assertion, directly or in a subroutine it calls, a flush-point event site (`DeferredSite::FlushPoint`). A process kernel reports it whenever it wakes from an event control or a wait (`ProcessKernelBuilder::flush_deferred_at`, in `wake_if`). An edge-triggered process reports it at the start of each evaluation, which is a resume from its event control. - The site of a deferred action is `DeferredSite::Action { queue, region }`, where `queue` is the flush-point site of its process. Assembly offsets it like the other sites of the instance. - A deferred `$fatal` does not stop the evaluation; it ends the simulation when it matures. - The SV frontend also finds a deferred assertion in a subroutine that only the default of an omitted argument, or a timing control (`wait`, an event control or a delay), calls. **The queue on the host.** - `PendingRuntimeEvents`, which the simulator's drain and `RuntimeEventDrain` share, holds back the events of action sites in issue order. A flush-point event discards those of its queue. - When the slot is over, `mature` queues what is left: the `#0` actions, then the `final` ones, up to the first fatal one, after which the simulation ends. Events of the slot's active regions, such as `$display` output, come before them. - Nothing is needed for designs without deferred assertions: the site table is empty and `Simulator::deferred_assertions` is false. - Events lost to a full event buffer (`Missed`) may have held a deferred `$fatal`. In a design with a fatal deferred action they end the simulation when the slot matures, with `missed N runtime events, which may have held a deferred $fatal`. **The end of a time slot.** - A step of the runtime ends before its slot when a process waits for zero time, and `try_finish_timed_step` is called at the end of every step. The new `HostBoundary::try_end_time_slot` is called only when no more work is due at that time; the simulator matures the queue there. - A design with deferred assertions runs the runtime's loop (`CompiledSlots::None`), which tells the two apart. - A `Simulator` call is a time slot, so the queue matures after each run of a domain (`fire`), after `tick_events`, and after `edge` and `edges` through derived domains (`note_edge`), which also serve `tick` of a clock with derived domains. **Analyzer.** - The deferral of an immediate assertion is recorded in `AssertionSite::deferral` (previously always `None`). - A deferred action must be one display or severity task call (16.4). User subroutines would run in the Reactive region, which Celox does not model, so they are rejected. Deferred assertions in `always_comb`, `always_latch` and `always` processes lowered as combinational logic still report at once. Module-level ones and deferred cover stay rejected. The next change handles combinational processes. - New `crates/celox/tests/sv_deferred_assertions.rs` on the interpreter, cranelift, native and wasm backends: - a resume from `@(a or b)` flushes the failure of the first execution, while the immediate assertion beside it reports; - the `a3`/`a4` example of 16.4.2: `a3` reports and `a4` is flushed; - `$display` output, then `#0` actions (fail and pass), then `final` ones in one slot; - an edge-triggered process: one edge reports, and a second edge in the slot flushes; - a deferred `$fatal` stops the run at the end of its slot and is drained as a fatal report; - a `Simulator` tick matures the action of an `always_ff`; - a timed `Simulation` built from a reloaded native image flushes the glitch and reports the lasting failure as the in-process build does (`native_simulation_image::deferred_assertions_run_from_the_image`); - `edges` and ticks of a clock with a derived domain mature each call's actions: 9 reports for 2 `edges` periods and 4 ticks. Without `note_edge` maturing none are drained; - a function called only from the default of an omitted argument holds a `#0` assertion: its report follows the `$display` after the call. Without the default scan it comes first; - a deferred `$fatal` followed by 2,000 `$display`s in its slot still ends the run, with a `missed` error; - a `final` action after an `#0` `$fatal` does not mature. Without the change it was drained; - a function called only by a `wait` condition holds an `#0` assertion: its report follows the `$display` after the wait. Without the change it came first; - an action of two statements 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-runtime, celox-design, celox-slt, celox-test-suite, celox-vpi and celox-napi: 15,270 passed, after updating the two analyzer tests that gave deferred assertions assignment actions, which 16.4 does not allow (they now use a `$info` action, and check that the header's deferral makes an assignment action an error). - 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_design::RuntimeEventSite` has the new field `deferred`, of the new type `DeferredSite`. The native image container version is 36. - Deferred assertions in processes report when they mature, at the end of their time slot, and a flush point discards them. Change-Id: I1062591d4b559e6f6fa13de6f7a435b7790c02e5
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 grilled-bouillabaisse-2oqsfp of the
changesqueue, to test #1877 before it merges intomaster. Pushing to this branch or closing this pull request removes #1877 from the queue.What this draft tests
Mergify checks that #1877 still passes CI once combined with everything queued ahead of it. CI runs on this draft's code, built in this order:
masterat17dedead150e93The check is speculative: it assumes the pull requests ahead will merge, so it starts without waiting for them.
🎉 Where it stands: checks passed
CI passed on this draft.
Follow the
changesqueue in the dashboardWhat happens next
masterand closes this draft.Tip
A red check is not necessarily caused by this batch. These checks run on a tip that also carries the commits of the 2 pull requests ahead, so a failure here can come from them as much as from #1877. See only this batch's changes.
Queued ahead of this batch
These pull requests entered the queue before this batch and are not part of it.
Metadata for CI tooling, read by
mergify ci1 scope
coreRequired conditions of queue rule
changesfor mergecheck-success = Conventional Commit titlecheck-success = Queue validationmaster]: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-readymaster]: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 title