Skip to content

feat(sv)!: support shared always blocks and delayed nonblocking assignments - #2807

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/e203-default-benchmark/support-shared-always-blocks-delayed-nonblocking--0efd3e54
Nov 1, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/e203-default-benchmark/support-shared-always-blocks-delayed-nonblocking--0efd3e54

Conversation

@tignear

@tignear tignear commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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.

@tignear

tignear commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(sv)!: support shared always blocks and delayed nonblocking assignments #2807 👈
2 ci(bench): add the E203 default hello workload #2808

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 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-31T23:29:17.012097Z 1bf9919 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.

@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: 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".

Comment on lines +1537 to +1538
Stmt::Assign { lhs, rhs, .. } => {
let whole = matches!(lhs, sv::ir::LValue::Ident(target) if target == name);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +3741 to +3743
.eval_const(amount)?
.and_then(|(value, _)| u64::try_from(value).ok())
.and_then(|value| value.checked_mul(*ticks_per_unit))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@tignear
tignear force-pushed the stack/tignear/feat/e203-default-benchmark/support-shared-always-blocks-delayed-nonblocking--0efd3e54 branch from 5932b12 to f0d161d Compare October 31, 2026 23:23
@tignear

tignear commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial 5932b12 2026-10-31 23:21 UTC
2 content 5932b12 → f0d161d Exclude queued writes from shared temporary eligibility and coerce signed constant NBA delays to time width; cover the IR policy and exact persisted due times from review 5725361321. 2026-10-31 23:21 UTC
3 content f0d161d → 1bf9919 2026-10-31 23:26 UTC

…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
@tignear
tignear force-pushed the stack/tignear/feat/e203-default-benchmark/support-shared-always-blocks-delayed-nonblocking--0efd3e54 branch from f0d161d to 1bf9919 Compare October 31, 2026 23:27
@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 31, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 31, 2026
@mergify

mergify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into master as ab7cd92 at Sun 1 Nov, 00:23 UTC

27 min in the queue, 26 min of it CI.

So far

9 merge conditions met
  • check-success = Conventional Commit title
  • check-success = Queue validation
  • check-success = Verify workflow lockfile
  • any of · required by GitHub repository ruleset rule master:
    • check-success = @github-actions/Lint & Format
    • check-neutral = @github-actions/Lint & Format
    • check-skipped = @github-actions/Lint & Format
  • any of · required by GitHub repository ruleset rule master:
    • check-success = @github-actions/Rust Test & NAPI Build
    • check-neutral = @github-actions/Rust Test & NAPI Build
    • check-skipped = @github-actions/Rust Test & NAPI Build
  • any of · required by GitHub repository ruleset rule master:
    • check-success = @github-actions/JS Test (Ubuntu)
    • check-neutral = @github-actions/JS Test (Ubuntu)
    • check-skipped = @github-actions/JS Test (Ubuntu)
  • any of · required by GitHub repository ruleset rule master:
    • check-success = @github-actions/Conventional Commit title
    • check-neutral = @github-actions/Conventional Commit title
    • check-skipped = @github-actions/Conventional Commit title
  • any of · required by GitHub repository ruleset rule master:
    • check-success = @github-actions/Queue validation
    • check-neutral = @github-actions/Queue validation
    • check-skipped = @github-actions/Queue validation
  • any of · required by GitHub repository ruleset rule master:
    • check-success = @github-actions/Verify workflow lockfile
    • check-neutral = @github-actions/Verify workflow lockfile
    • check-skipped = @github-actions/Verify workflow lockfile

Times in UTC · dashboard · how the merge queue works

@mergify
mergify Bot merged commit ab7cd92 into master Nov 1, 2026
28 of 29 checks passed
@mergify
mergify Bot deleted the stack/tignear/feat/e203-default-benchmark/support-shared-always-blocks-delayed-nonblocking--0efd3e54 branch November 1, 2026 00:23
@mergify mergify Bot removed the queued Mergify queue entry label Nov 1, 2026
@github-actions github-actions Bot mentioned this pull request Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-ready Request merging through Mergify after required checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant