Repository navigation
merge queue: checking #1361 on master (787acd8), stacked on #1384 - #1394
Closed
mergify[bot] wants to merge 33 commits into
Closed
mergify[bot] wants to merge 33 commits into
mergify[bot] wants to merge 33 commits into
Conversation
An event domain whose variable no path names, such as a hidden copy of a clock, has no name to list in named_events, as named_signals, the hierarchy, and VCD descriptions already omit such variables.
A variable carries one domain kind, so always_ff processes sensing one signal at both edges, or as a clock and as an asynchronous reset, were rejected. The frontend now senses the signal on itself at one kind (rising clock first) and at every other kind on a hidden one-bit whole-variable copy, which clock-domain unification keeps in the signal's domain when the edges agree and otherwise runs as a clock derived from the signal. Designs that sense one kind per signal are unchanged. Closes #443. Closes #471.
Both edges of a divided clock, of a child clock port, and one register as an asynchronous reset at both edges and as a clock at both edges. Verified against Verilator and Icarus with no mismatches.
Simulation::step of counters at the rising edge only, half at each edge of one clock, and half at the falling edge of a whole copy of the clock.
Process kernels get the rest of the timing protocol: inactive-region delays, event and level waits, nonblocking assignments and yields. The timed scheduler runs them in a process phase in front of today's batch step (IEEE 1800-2023 4.5), so a round without ready or waiting processes and counted signals does exactly the batch step, with the fused evaluate-and-apply and parallel units. - Waits compare the value each waiting process last saw against the edge it waits for (Table 9-2), at every point the runtime checks. - A signal that one unit may store twice without such a check, and that a domain or wait watches, is counted: assembly instruments exactly those stores in kernels and combinational process units with changes/rises/falls counters in plain SIR, so no backend changes. - Domains triggered before an inactive region evaluate first and publish in the NBA region; a domain evaluated twice keeps the earlier working state. Kernel nonblocking assignments use an ordered queue or a single pending value per site. - $finish ends a timed simulation as a control result and freezes the simulator. A host write settles at the current time. - Checkpoints, state files (version 2) and exported schedules carry the waiting processes, queues and counter baselines; the native image container is version 13. - The SDK (format 3) gains the timing statements and combinational processes; its runtime tests run on every backend. - The timing oracle no longer excludes host clock edges. BREAKING CHANGE: SimulationExecutor methods return Halt, ProcessRefs and RuntimeSchema carry the new metadata, state files are written as version 2, native images as container version 13, and a timed Simulation ends at a design's $finish and settles host writes at the current time.
runUntil({ maxSteps }) calls the new Simulation::run_until_bounded through
NAPI instead of re-implementing the step loop in TypeScript.
Cover the timing statements and combinational processes of the frontend SDK, the round structure of a time slot, state files with processes, the bounded runUntil, and the shared-suite rule against depending on the race between an edge-woken process and the flip-flops of that edge.
Address review findings on the process phase: - Each publication of a domain evaluated more than once in a slot is an update: waits and event domains see it between images. - A queued nonblocking assignment or yield returns to the runtime between writes; the runtime checks waits and event edges at that return. - Checkpoints and state files carry the host writes the next step has yet to show the waits. - A $finish executed during a direct settle, read, dump or modify of a timed Simulation ends it. - Loading a state file sets whether the simulator is frozen.
When a domain publishes several evaluations, the edges among them are marked after the round's last publication, tracking each event signal's latest value, so a pulse that interleaves with another signal's or ends in the main flip-flop loop still triggers its domains. State files reject queued nonblocking assignments outside their target.
- Scheduled and process-driven values of one event signal compare with the preceding value, not only the round's baseline. - Several queued nonblocking assignments of a slot each count as an update for the event domains. - The waveform records the time slot of a $finish before the simulator freezes, and save_state notices a $finish its settle executed. - State files reject waiter baselines of the wrong kind. - A combinational process of the frontend SDK may overwrite part of a signal it assigned.
- A design without processes and counted signals runs the batch step's previous body as its own round; the process round is only for designs that need it. - Edge marking over a round's transitions is linear: each value compares with the latest one of its signal, kept in a generation-stamped table. - Host writes no longer reach an unreachable counter comparison. - The process round's helpers lose their inline hints.
- No unit loads the signal of a wait's event term: a kernel suspends and the runtime compares the signal with the waiter's baseline. Dead store elimination removed a combinational store to such a signal, and the wait never woke. - Every wait-term signal is a timing read root, like counters and staged nonblocking values.
- When one domain evaluates and applies in a single unit, the NBA region publishes right after it, and the stable-edge filter that follows cleared the occurrences the publications marked. A domain clocked by a pulse of two nonblocking assignments did not evaluate. - The fused path marks the round's occurrences again after the filter, as the path for several domains does.
- Each wave of the active region marked its transitions against the round's baseline, so a signal one process lowered and the process it woke raised again showed no rise, and its domain missed the pulse. - The latest value of each event signal now carries over the waves and the NBA publications of a round. It restarts with the round and where the baseline moves, before an inactive region.
- The process phase repeats while processes are ready or inactive, and only kernel returns and later rounds were charged. `forever #0`, or two processes waking each other through waits, looped inside one step, which `run_until_bounded` cannot stop. - Every round and every pass of the process phase counts against the slot's budget, and the step fails once it is spent. - `SimulationState::set_slot_budgets` sets the budgets.
- TypeScript DUT setters write the shared memory directly. The Rust `Simulation` only heard of writes through `modify`, so a write that should wake a process did nothing without a scheduled event, and woke it at the next event's time otherwise. - `Simulation::note_raw_writes` reports raw writes like `modify` does: the next step settles the current time when a process may see them or an event signal changed. NAPI exposes it as `noteHostWrites`. - The DUT records input writes apart from `dirty`, which a read clears. `Simulation` reports them before it steps, runs, peeks at the next event time, or saves a checkpoint or state file.
- A combinational process dropped every signal it wrote from its gate and sources, so reading `v[1]` while writing `v[0]` left `v` out, and the process did not run again when `v[1]` changed. - Its inputs are now the bit ranges it reads outside the ranges it writes (IEEE 1800-2023 9.2.2.2.1), as the SV lowering does. A gate input compares a range of its signal.
- Every round reads the triggered bits into a `BitSet`. The native backend tested them bit by bit, the others byte by byte. Once the process round also called the native reader, it was no longer inlined into the batch step, and a pure RTL run took 4% more instructions than master. - `celox_runtime::backend::triggered_bits_from_bytes` reads them 64 bits at a time and inserts only the set bits, for every backend.
- `celox` re-exports `ProcessRecord`, `WaiterRecord`, `BaselineRecord` and `NbaRecord`, which `ScheduleRecord::processes` holds. - `Simulation::is_finished` has its documentation back; it had landed on `run_until_bounded`. - `StateError::Processes`, no longer returned, no longer claims that state files do not support processes.
- A clock computed from a source, such as `clk & en`, is judged at the settle after the source changes, and its baseline moves then. A later settle of the round marked only the scheduled triggers, so with a process woken by the source (a second wave of the active region) the gated domain lost its edge. - Before an inactive region, the cascaded stable-edge test did not know the judged edges either, and the baseline resync hid the edge of a domain that evaluates later with the remaining domains. - Each settle of the round marks the judged edges again until their domain evaluates; the inactive region's evaluation honours them, and a domain it passes on keeps its edge approved.
- A host write that a waiting process or a counted signal may see is an update of the current time. The next step settled it and returned the current time, so a loop of writes and steps never advanced: with a process, any write did this, even after the process had finished. - A step now settles pending host writes at the current time and goes on to the next event. `run_until` and `run_until_bounded` stop at their end time (`SimulationState::step_until`). - Only waiting processes and counted signals make a host write pending; processes that finished or wait for a time do not see it.
- Only kernels and combinational process units count the writes of a counted signal, and a wait's counted term compared only the counter. A continuous assignment to other bits of the signal changed it without a count, and the wait never woke. - A counted term also keeps the signal's value at the last check and wakes on an occurrence the value shows. After a state file loads, the value is sampled once the state is in place.
- Waits were checked after the process phase, after publications and at the end of the round, not after the settle that follows each wave of flip-flop domains. A combinational value between two waves, such as `a & ~b` high after `a` rose and before `b <= a` published, triggered a flip-flop clocked by it but not a process waiting on it. - Each settle of the round's main loop checks the waits on driven signals (IEEE 1800-2023 4.5: every update event wakes the processes sensitive to it).
- `ProcessKernelBuilder::yield_now` returns so that the runtime charges a
process's time-slot budget, but the SDK lowering never placed it. A
`forever` or `while` loop without a timing control, such as `Forever {
Assign }`, spun inside the kernel and hung the step.
- A loop whose body has no delay, inactive delay or event wait at its top
level now yields at the end of each iteration, and the step fails once
the budget is spent. A level wait passes without suspending when its
condition holds, so it does not count.
- `NbaSite::pending` is only for a destination that nothing outside the module writes, so not a port, but the SDK lowering also flagged output ports with a single nonblocking site. A flat SDK module has no outside writers, so this only aligns the code with the contract.
- `runUntil(time(), { maxSteps })` returned before reporting the DUT's
input writes, so the writes stayed unseen until a later run; the
unbounded path and Rust `run_until_bounded` settle them at the target
time.
- The bounded path reports the writes first and keeps pending inputs for
lazy evaluation only when nothing is due at the target.
- `runUntilBounded` is optional on the native handle types, like
`noteHostWrites`; a handle without it reports that it does not support
bounded runs.
- Every state file was written as version 2, so older builds rejected even files of designs without processes. - A file whose processes have nothing to record is written as version 1, without the process section.
…suspend
- Loops that may not suspend yielded at every iteration. A long finite
loop then left the kernel, recorded transitions and checked the waits
each time, and one past 2^24 iterations exhausted the return budget it
finished within before.
- Such a loop now counts its iterations in a hidden 16-bit object and
yields when the count wraps: a finite loop pays one counter update per
iteration, and only about 2^40 iterations in one slot are reported.
`Forever { Assign }` still ends the step with an error.
- A state file recorded only the counter of a counted wait term, and the value it compares writes the counter misses with was sampled after loading. Saving settles combinational logic, so a write made before `save_state` was already in the sampled value, and the loaded wait never woke. - The counter record carries the value and its unknown bits; format version 2, new with this change set, encodes them after the counter.
- `SimulationState::step_until` checked `limit` only after settling host writes, so a call whose next time was already after the limit ran it. - Every pass now checks the limit, and the documentation says that no time after it runs.
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 able-caramel-vki4hr of the
changesqueue, to test #1361 before it merges intomaster. Pushing to this branch or closing this pull request removes #1361 from the queue.What this draft tests
Mergify checks that #1361 still passes CI once combined with everything queued ahead of it. CI runs on this draft's code, built in this order:
masterat787acd8610891fThe 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 pull request ahead, so a failure here can come from it as much as from #1361. See only this batch's changes.
Queued ahead of this batch
This pull request entered the queue before this batch and is 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
-draft-head ~= ^(integration/|renovate/veryl-crates$|upgrade/veryl-|release-please--branches--master--components--celox$|master$)-head ~= ^renovate/-label = release:holdbase ~= ^(master|develop)$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 titleQueue graph
The diagram is not laid out in queue order, so a node's position says nothing about when it merges.
graph LR 2c13699fd3aa4ccdb00833c340273284["able-caramel-vki4hr<br/>#1361<br/>scopes: core"] d6eb291997014cc5be192f0ddce06f8e["eternal-vinaigrette-42exrv<br/>#1393<br/>scopes: core"] 2c13699fd3aa4ccdb00833c340273284 --> d6eb291997014cc5be192f0ddce06f8e style 2c13699fd3aa4ccdb00833c340273284 fill:#6366f1,color:#fff