Repository navigation
feat(sv)!: support shared always blocks and delayed nonblocking assignments - #2807
Conversation
|
This pull request is part of a Mergify stack:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5932b12b65
ℹ️ 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".
| Stmt::Assign { lhs, rhs, .. } => { | ||
| let whole = matches!(lhs, sv::ir::LValue::Ident(target) if target == name); |
There was a problem hiding this comment.
Exclude nonblocking writes from temporary eligibility
When shared_always_temporary is set to warn or allow, this analysis treats a whole-variable nonblocking assignment as an immediate write. For example, two always @* blocks containing j <= a; x = j; and j <= b; y = j;, with no other references to j, qualify for privatization even though both reads observe the value from before the NBA update. The default path converts these blocks into process kernels, but privatization leaves them as combinational blocks, where Ff::lower_comb_process rejects their nonblocking assignments with nonblocking assignment inside always_comb. Reject nonblocking writes as evidence of initialization so that these blocks retain the standard process path.
Useful? React with 👍 / 👎.
| .eval_const(amount)? | ||
| .and_then(|(value, _)| u64::try_from(value).ok()) | ||
| .and_then(|value| value.checked_mul(*ticks_per_unit)) |
There was a problem hiding this comment.
Preserve signedness when converting constant NBA delays
For a signed negative constant delay, converting the raw BigUint directly to u64 zero-extends the expression's bit pattern instead of converting it to the unsigned 64-bit simulation-time representation. With timeunit 1ns / 1ns, for example, q <= #(4'shf) 1'b1 schedules its update after 15 ticks rather than the 64-bit two's-complement delay for −1, so q changes during an ordinary short run. The existing Ff::delay path preserves signedness when coercing the delay to PROCESS_DELAY_WIDTH; apply the same conversion before scaling and storing the delayed NBA site's delay.
Useful? React with 👍 / 👎.
5932b12 to
f0d161d
Compare
Revision history
|
…nments Run multiply written always @* variables as event processes with shared storage and authored sensitivity. For isolated write-before-read indices, allow Active continuations before rearming the wait, as permitted by IEEE 1800-2023 4.7 and 4.9.3. Retry static wildcard feedback as event processes and include source locations in nonconvergence diagnostics. Temporary eligibility requires blocking initialization and excludes queued writes, including concatenations and nested branches. Capture integral nonblocking assignment values and target positions when issued and queue constant delayed updates in the future NBA or Re-NBA region. Coerce constant delays to the time width with their original signedness before scaling (IEEE 1800-2023 9.4.1). Preserve pending updates and Active continuations across saved state and disable compiled batching while these queues are pending. This carries forward #2135 and supports the unmodified E203 default RTL without compatibility flags or disabling assertions. An optional diagnostic mode remains available for isolated shared temporaries. Validation: affected unit tests; all-backend SystemVerilog regressions; 103 intra-assignment regressions; 110 runtime/persistence regressions; Icarus and Verilator checks for changed portable cases; clippy and format. Additional IR regression checks queued-write eligibility; the state-file regression verifies 4-bit and 32-bit negative delays at u64::MAX in both state modes. Untimed wildcard NBAs are rejected before lowering today, so the temporary policy regression supplies the IR directly. E203 hello passed in both state models at 5,080 clocks, matching Verilator (two-state) and xezim (four-state); one-clock negative controls also passed. The Verilator adapter does not support the four-state delayed-value case. The pinned official sv-tests runner accepts 9.4.5--event_nonblocking_assignment_delay in elaboration mode for both state models; expected.tsv records only those two fail-to-pass transitions. Conformance wrapper unit tests: 17 passed, 11 skipped. BREAKING CHANGE: NbaSite gains a delay field and ProcessStatus gains an Active continuation variant; native image and private checkpoint formats advance their versions. Older portable state files remain readable. Change-Id: I0efd3e54f8b9711fa8d3d996aa50b0691bc2518e
f0d161d to
1bf9919
Compare
✅ Merged into
|
Run multiply written always @* variables as event processes with shared
storage and authored sensitivity. For isolated write-before-read indices,
allow Active continuations before rearming the wait, as permitted by IEEE
1800-2023 4.7 and 4.9.3. Retry static wildcard feedback as event processes
and include source locations in nonconvergence diagnostics. Temporary
eligibility requires blocking initialization and excludes queued writes,
including concatenations and nested branches.
Capture integral nonblocking assignment values and target positions when
issued and queue constant delayed updates in the future NBA or Re-NBA
region. Coerce constant delays to the time width with their original
signedness before scaling (IEEE 1800-2023 9.4.1). Preserve pending updates
and Active continuations across saved
state and disable compiled batching while these queues are pending.
This carries forward #2135 and supports the unmodified E203 default RTL
without compatibility flags or disabling assertions. An optional diagnostic
mode remains available for isolated shared temporaries.
Validation: affected unit tests; all-backend SystemVerilog regressions;
103 intra-assignment regressions; 110 runtime/persistence regressions;
Icarus and Verilator checks for changed portable cases; clippy and format.
Additional IR regression checks queued-write eligibility; the state-file
regression verifies 4-bit and 32-bit negative delays at u64::MAX in both
state modes. Untimed wildcard NBAs are rejected before lowering today, so
the temporary policy regression supplies the IR directly.
E203 hello passed in both state models at 5,080 clocks, matching Verilator
(two-state) and xezim (four-state); one-clock negative controls also passed.
The Verilator adapter does not support the four-state delayed-value case.
The pinned official sv-tests runner accepts
9.4.5--event_nonblocking_assignment_delay in elaboration mode for both
state models; expected.tsv records only those two fail-to-pass transitions.
Conformance wrapper unit tests: 17 passed, 11 skipped.
BREAKING CHANGE: NbaSite gains a delay field and ProcessStatus gains an
Active continuation variant; native image and private checkpoint formats
advance their versions. Older portable state files remain readable.