Skip to content

feat(sv)!: judge iff-qualified event controls in processes - #1829

Merged
mergify[bot] merged 6 commits into
masterfrom
feature/feat/sv-iff-event-controls
Oct 27, 2026
Merged

mergify[bot] merged 6 commits into
masterfrom
feature/feat/sv-iff-event-controls

Conversation

@tignear

@tignear tignear commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1444. Part of #1123.

Support iff-qualified process events such as @(posedge clk iff en) and conditions on individual or items (IEEE 1800-2023 9.4.2.3). False/unknown gates consume the occurrence; changing only the gate does not wake the process. Plain always with iff runs as a process; always_ff remains tracked by #452.

For a variable event and one-bit variable gate, preserve write-time conditions across procedural/NBA/host writes and combinational processes, including hierarchical references. In clk=a; en=a, a parent waiting on the child's clock sees the old gate; reversing the statements sees the new gate. Automatic gates use the waiting activation and shared fork cells. Automatic event signals with module-level gates also observe each assignment, preserving short pulses; plain-variable observation is explicit and independent of the presence of global counters. Gated occurrence baselines survive checkpoints and portable state files, including cross-backend restoration of live fork waits.

The assembly stage selects imperative combinational alternatives after resolving global gated dependencies. Designs without gated waits retain the existing alternative filtering and runtime fast path. Preserve master's batched watch instrumentation and activation-local event probes.

Limitations: general event/gate expressions and nets use settled observation semantics. FF-domain writes remain tracked by #1830. Impure function calls and static task-argument event expressions remain unsupported. Implicit function/output-argument writes to operands of an automatic gated wait are rejected until safe observation boundaries exist. This does not implement concurrent assertions.

Breaking API changes: event items, wait descriptors and baseline records expose gated-event metadata; native-image format version is 50. Existing state files without gated baselines remain readable.

Validation on master 8a85460 plus this change:

  • Full SV: 6,185 passed, 20 ignored, including automatic-clock pulses and interpreter-to-native state-file restoration of forked gated waits.
  • Affected design/frontend/analyzer/runtime units: 1,005 passed. API/checkpoint/state-file/fork regressions: 107 passed. Final timing regressions: 1,277 passed, including tracked host pulses with automatic gates and state-file replay on interpreter/native/Cranelift/Wasm.
  • NAPI build and JS: 435 tests passed; package/plugin integration checks also passed. Formatting and Clippy passed.
  • Upstream 9.4.2.3--event_conditional.sv succeeds in 2state and 4state; update only those two expected rows.
  • All 15 iff shared cases checked with Verilator 5.052, Icarus 13.0 and an installed xezim 0.11.3. Strict assertions remain intact. Tool disagreements/rejections have standalone Top/Wrapped evidence in verification/repros/sv_iff_hierarchy_automatic.json; retained-report tests pass. Xezim's six failures remain executed evidence, not exclusions.
  • The current pinned xezim Nix build fails because its dependency lock does not supply the requested xezim-core revision. The xezim evidence explicitly identifies the available installed binary; it is not validation of the current pin.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-27T22:26:26.795609Z c66d10d 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: c11eeaa628

ℹ️ 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".

@mergify

mergify Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@tignear
tignear force-pushed the feature/feat/sv-iff-event-controls branch from c11eeaa to 0bc6855 Compare October 24, 2026 09:13

@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: 213dc654c1

ℹ️ 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".

@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: fa84cf7f94

ℹ️ 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".

@tignear
tignear force-pushed the feature/feat/sv-iff-event-controls branch from fa84cf7 to 66283e6 Compare October 24, 2026 21:21

@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: 66283e6cb0

ℹ️ 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".

An event control item `expr iff condition` in a process (IEEE 1800-2023
9.4.2.3) is an event only if the condition is a known 1 when the
occurrence happens; an occurrence while it is false is consumed, and the
wait does not watch the condition's operands. A plain always whose event
has iff runs as a process; always_ff keeps rejecting iff (#452).

The condition becomes the term's gate: a one-bit module variable, or the
hidden $event[k] assignment of its truth value with process-local
operands sampled before the process suspends.

- When the term's signal and its gate are variables, every write of the
  signal judges the gate at the write and bumps per-term counters: SIR
  instrumentation of process kernels and imperative combinational
  processes (which keep their procedural order), process nonblocking
  updates in issue order, scheduled and add_clock edges, and host
  writes. Raw host writes are counted from the wait's baseline when the
  host notes them; every piece of this state lives in the wait baselines
  and the counters, which checkpoints and state files keep.
- Other gates, and signals a flip-flop domain (#1830) or a continuous
  assignment writes, are judged when the runtime detects the occurrence,
  after combinational logic settled.
- Kernels whose waits have iff conditions stay out of compiled slots.
- Designs without iff run the previous wait check unchanged.

Closes #1444.

BREAKING CHANGE: celox_design::WaitSite has a new public field `gates`
(Vec<Option<WaitGate>>) and celox_design::schedule::TermModel a new field
`gate`; celox_runtime::timing::Baseline and celox_runtime::BaselineRecord
have a new variant `Gated` (state-file baseline tag 2, which older builds
reject).

Change-Id: I59402e1356cac2aaf254082d1feef6348380447a
Timing cases for conditions judged at the write, nonblocking update order,
combinational process order, consumed occurrences, automatic task
arguments, unknown conditions and plain always procedures; Rust tests for
scheduled clocks, host pulses, raw edges and state-file and checkpoint
round trips between host writes. Icarus 13.0 rejects iff in event
controls; Verilator 5.052 judges the condition late (excluded with
probes).

Change-Id: I47afd3cfa65b0ee5c7568f84d2f67cff0530bae9
Change-Id: Ifdd7058d940a9394fb51d7121382b87c5d31f723
@tignear
tignear force-pushed the feature/feat/sv-iff-event-controls branch from 66283e6 to cb8e54c Compare October 25, 2026 10:44

@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: cb8e54c271

ℹ️ 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".

Merge master 8a85460 into the existing iff event-control PR. Preserve combinational writer order after hierarchical binding, resolve gates through activation kernels and shared automatic cells, and retain the current batched watch instrumentation.

Validated: full SV 6178 passed plus one new cross-backend fork/state-file regression; affected crate units 1005 passed; API/state regressions 107 passed; NAPI/JS 435 passed; Clippy and formatting; upstream event_conditional in both states; external Icarus/Verilator and installed xezim probes with strict retained evidence. The current pinned xezim Nix build is unavailable due to its dependency lock.
Change-Id: I83ccf80ceaca2d6131834c7496ccbcf370b7107b
@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 27, 2026

@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: 9f0707bb08

ℹ️ 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".

Record whether both iff operands are plain variables independently of global gate counters. Automatic clock pulses with module-level gates now observe each assignment; continuous and expression operands still wait for settling.

The new regression failed on all six configurations before the fix and passes afterward. Full SV: 6185 passed; Clippy, NAPI/JS435 and retained evidence checks passed. Standalone external Top/Wrapped results retain the exact unsupported/disagreement outcomes.

Change-Id: I5cf7b95d7a66a1bd4d30777197678472381c5ed7

@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: 99618af6d5

ℹ️ 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".

@tignear tignear removed the merge-ready Request merging through Mergify after required checks label Oct 27, 2026
Reject unobserved function writes to direct activation-local gated-wait operands, matching the existing event-probe restriction. Replay tracked host pulses against the waiting activation gate when no gate counter preserves them; retain false-gate baseline updates.

Both new regressions failed before the fix. Final timing regressions: 1277 passed, including interpreter/native/Cranelift/Wasm host pulses and state-file replay; Clippy and NAPI/JS435 passed. Shared language fixtures are unchanged.

Change-Id: I8f5f03c395769d784bb92da31af6ab91c72220b8
@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 27, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 27, 2026
@mergify

mergify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into master as f3834e5 at 23:23 UTC

12 min in the queue, 9 min of it CI.

So far

Merge conditions: 7 of 7 met

The batch, tested on draft #2338

Condition Required by
✅ check-success = Conventional Commit title —
✅ check-success = Queue validation —
✅ any of: check-success = @github-actions/Lint & Format, check-neutral = @github-actions/Lint & Format, check-skipped = @github-actions/Lint & Format GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/Rust Test & NAPI Build, check-neutral = @github-actions/Rust Test & NAPI Build, check-skipped = @github-actions/Rust Test & NAPI Build GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/JS Test (Ubuntu), check-neutral = @github-actions/JS Test (Ubuntu), check-skipped = @github-actions/JS Test (Ubuntu) GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/Conventional Commit title, check-neutral = @github-actions/Conventional Commit title, check-skipped = @github-actions/Conventional Commit title GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/Queue validation, check-neutral = @github-actions/Queue validation, check-skipped = @github-actions/Queue validation GitHub repository ruleset rule master

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot mentioned this pull request Oct 27, 2026
32 of 55 tasks
@mergify
mergify Bot merged commit f3834e5 into master Oct 27, 2026
24 checks passed
@mergify
mergify Bot deleted the feature/feat/sv-iff-event-controls branch October 27, 2026 23:23
@mergify mergify Bot removed the queued Mergify queue entry label Oct 27, 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.

feat(sv): support iff-qualified event controls in processes

1 participant