Repository navigation
feat(sv): implement built-in process handles and control - #2322
Conversation
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: 1d34ff42ca
ℹ️ 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".
1d34ff4 to
3dc93de
Compare
Revision history
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3dc93dee22
ℹ️ 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".
3dc93de to
bd7fc00
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd7fc00f5f
ℹ️ 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".
bd7fc00 to
38704d7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38704d785b
ℹ️ 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".
|
Queued — the merge queue status continues in this comment ↓. |
38704d7 to
9009832
Compare
9009832 to
e14f63f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e14f63f799
ℹ️ 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".
e14f63f to
5c4a094
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c4a09400a
ℹ️ 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".
5c4a094 to
8b7f1a6
Compare
🚫 Left the queue1 min in the queue, with no time running CI. So far
Reason The pull request conflicts with the base branch Hint You should update or rebase your pull request. If you want to requeue this pull request, you can post a Requeued — the merge queue status continues in this comment ↓. Times in UTC · dashboard · how the merge queue works |
8b7f1a6 to
9744c40
Compare
🚫 Left the queue2 min in the queue, with no time running CI. So far
Reason The pull request conflicts with the base branch Hint You should update or rebase your pull request. If you want to requeue this pull request, you can post a Requeued — the merge queue status continues in this comment ↓. Times in UTC · dashboard · how the merge queue works |
UVM stops at unknown package `process`. Bind the built-in process type, state enum and methods, and execute them against dynamic scheduler activations through a shared host-request family on every backend. Implement self/status/kill/await/suspend/resume and per-process RNG state (IEEE 1800-2023 9.7, 18.13.3-18.13.5). Support std::process and its state type (26.7). Keep process references independent of heap object IDs. Retain exposed identities after completion, preserve FINISHED on no-op controls, cancel all descendants through completed parents, and wake status/await observers. Suspended delays keep their original deadline; event waits rearm without consuming suspended edges; level waits recheck immediately. Conditional-event waits discard host pulses during suspension and rearm module counters and automatic gates after checkpoint restoration. Checkpoints preserve control state. Reject invalid construction, inheritance and calls. Pre-scan nested statements and omitted-argument defaults before classifying waits, so a process call later in a loop cannot leave earlier level waits insensitive on resume. Recompute activation-local event probes from current shared cells before taking resumed event baselines. Program exit clears suspended/awaiting/observer state; resume ignores dead activations, so saved delays cannot revive their continuations. User packages and classes named process retain their declarations, including package state constants, typedefs and self functions from another source file. The explicit std::process name remains unambiguous. Cancellation checks implicit program completion, including self-kill and descendant cancellation, and runs final procedures. Program $exit notifies observers of every sibling and descendant after the whole program has ended, including suspended targets and checkpoint-restored observers. Pending predicate reevaluations do not notify other status waiters. External kill releases the target frame and local bindings while preserving handle identity and RNG state; self-kill retires after saving the current frame. During finalization, kill does not trigger a second implicit finish that would skip cleanup. All final bodies share one process identity and RNG, including draw-only bodies and stop/resume; the identity remains RUNNING until the final phase ends (9.2.3). Save the running caller's frame before ancestor kill can retire it, retaining its latest RNG draw. set_randstate converts packed actuals to its string formal before storing handles. Typed heap-helper operands retain formal sizing, mutable receiver locations and GC roots across host boundaries. Support final procedures in timed shared cases. Check final output after all final procedures have run, preserving partial writes around simulator finish notices. Scripts must avoid reads of another final procedure's writes because final order is unspecified (9.2.3). External staging rejects post-finish signal reads unless every design final is empty or only prints literals or simulation time. Inspect emitted, cross-file preprocessed SV and conservatively reject function/argument effects, including implicit calls and escaped names. Output expectations and values captured before finish remain supported. A script starting with run_to_finish introduces no auxiliary settler program that could suppress implicit completion. Add eighteen process cases and two final-harness cases across native/image/parallel native, Cranelift/parallel Cranelift and WASM. Validation: - Full SV: 6,307 passed; 20 existing skipped. API regressions: 16 passed, including 2state/4state checkpoint/RNG, host/HDL final-kill tests, and shared final identity/RNG across a draw-only body and stop/resume, plus suspended iff waits with host pulses and checkpoint replay on all four backends in both state modes. The three resume review regressions replay checkpoints twice in each configuration, including nested calls and defaults, automatic event expressions and handles ended by program exit. Three private scheduler regressions verify bounded mutual-wait progress, frame/local-binding reclamation with RNG retention after 16 external kills, and program-exit suspension/wakeup cleanup, on native/interpreter/Cranelift/WASM in both state modes. - Units: design 17, frontend-core 23, runtime 80, SV analyzer 874 (3 ignored), SV frontend 11; shared-suite units 58 (3 ignored). Existing process/fork/ state-file integration: 37 passed. Affected and consumer Clippy passed. - NAPI/JS: 435 passed. Retained-report tests: 4; report-gate tests: 7. - Original six process cases retain exactly 13 external failures. Fourteen review and final-harness cases pass 5/14 in Verilator, 3/14 in Icarus and 5/14 in pinned xezim. The qualified-package typedef case passes all three tools; shared final identity/RNG passes Verilator. Their twenty-nine exact failures are retained with original assertions intact. The nine fresh selected reports for the resume cases pass the comparison gate; prior rows, assertions and exclusions are preserved. xezim's automatic compound wait already wakes at time0, isolated with observations before and during suspension; classify that startup failure separately from resume. Final-order staging regressions cover direct/indirect writes, macro expansion, hierarchy, argument effects and safe output/captured-value checks; the entire existing SV catalogue satisfies the restriction. Both final-output cases were rerun with Verilator, Icarus and pinned xezim; their fresh reports match the retained failure contracts without changing evidence. Default/external suite Clippy and both suite doctests pass. - Fourteen adapter-free Top/Wrapped repro sources accompany process discrepancies; the eight review repros also pass Celox in both state modes (32 runs). The two resume probes also pass both tops in both state modes (8 runs). Static function state across three finals also passes both state modes. - sv-tests CI reported exactly eight improvements: four chapter-9 process cases in both state modes. Each also passes local simulation. Update only those eight expectations; the resulting file matches all 3,300 CI rows. - UVM in both state modes passes unknown process and stops at the existing class type parameter value blocker. Full UVM execution is not claimed. Exposed identities remain allocated until simulation teardown. Portable state files reject exposed process handles; in-memory checkpoints support them. This is an independent master-based change without a Depends-On stack. Preserve four-state class properties alongside process fields. Process handles remain two-state and null-initialized; only logic/reg/implicit integral fields store unknown planes. Added a native and interpreter checkpoint regression with a process field between two four-state logic fields. Full SV 6,336 passed (20 existing ignored), process API 17 passed, analyzer 879 passed (3 existing ignored), affected/API Clippy, NAPI/JS 435 and plugin integrations passed. Both sets of retained external validation records are preserved; shared case sources are unchanged. Integration with concurrent assertions on master e7ec496: full SV 6,362 passed (20 existing ignored), process API 17 and concurrent assertion API 5 passed, retained-report checks 4 passed, formatting passed. The only manual conflict was combining the two sets of xezim review records; code merged without manual changes. Change-Id: If6cc12a12722e66f75d4833a527ec1247b2a83ab
9744c40 to
7b53f28
Compare
✅ Merged into
|
| 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
Allow modules, packages and compilation-unit classes to request package-class specializations that the declaring package never names. This enables the UVM registry pattern `typedef Registry#(User) type_id`, including calls through `type_id::create()` that construct the supplied compilation-unit class. Bind explicit actuals in the requesting scope and defaults, inherited member types/constants and method bodies in their declaration scopes. Reuse one canonical specialization and package state across importing scopes, preserving nominal type identity, equivalent defaults, constructor defaults, static class handles and distinct per-file compilation-unit classes. Discover signatures before binding executable bodies with the supplied classes' metadata. Keep module-local class actuals unsupported until their identity can distinguish module instances. This change is independent of built-in process control and virtual-interface support. It does not remove the existing restriction on nonconstant package declaration initializers. Add nine portable shared cases and API regressions for native images and serialized checkpoints. Retain all 19 observed external-simulator failures with unchanged expectations, exact diagnostics, standard review and six standalone probes. xezim validation uses pinned source d491f948/core a25655a4 with a regenerated dependency lock in an isolated Nix package; no simulator or repository lock sources are changed. Validation: - All five backends: 50 foreign-specialization tests passed; class/package and concurrent-assertion regressions: 539 passed after syncing master. Package regressions: 70 passed after syncing master. Earlier full SV run: 6250 passed, 20 ignored. - Analyzer/frontend unit tests on master e7ec496: 896 passed, 3 ignored. - NAPI/JS: 435 tests, playground 132 tests, and plugin/watch integration passed. - Affected-crate Clippy, formatting and retained-report/gate checks passed. - Nine external cases: Verilator 5 pass/4 retained failures, Icarus 9 retained failures, xezim 3 pass/6 retained failures. Standalone Celox probes pass in both two-state and four-state modes. After syncing master 8c81192 (with #2322 and #2421): a scope without classes of its own discovers queries as before, since it has no class signatures to bind once; resolution keeps the built-in `process` fallback and its type spelling. Analyzer/frontend units: 886 passed, 3 ignored; full SV: 6,421 passed, 20 skipped; retained-report and gate tests pass. Retained Verilator/xezim diagnostics of the foreign cases follow their new case lines. Change-Id: I94cfcf52749ba3ad9d7e7d893e795c86bc146939
Allow modules, packages and compilation-unit classes to request package-class specializations that the declaring package never names. This enables the UVM registry pattern `typedef Registry#(User) type_id`, including calls through `type_id::create()` that construct the supplied compilation-unit class. Bind explicit actuals in the requesting scope and defaults, inherited member types/constants and method bodies in their declaration scopes. Reuse one canonical specialization and package state across importing scopes, preserving nominal type identity, equivalent defaults, constructor defaults, static class handles and distinct per-file compilation-unit classes. Discover signatures before binding executable bodies with the supplied classes' metadata. Keep module-local class actuals unsupported until their identity can distinguish module instances. This change is independent of built-in process control and virtual-interface support. It does not remove the existing restriction on nonconstant package declaration initializers. Add nine portable shared cases and API regressions for native images and serialized checkpoints. Retain all 19 observed external-simulator failures with unchanged expectations, exact diagnostics, standard review and six standalone probes. xezim validation uses pinned source d491f948/core a25655a4 with a regenerated dependency lock in an isolated Nix package; no simulator or repository lock sources are changed. Validation: - All five backends: 50 foreign-specialization tests passed; class/package and concurrent-assertion regressions: 539 passed after syncing master. Package regressions: 70 passed after syncing master. Earlier full SV run: 6250 passed, 20 ignored. - Analyzer/frontend unit tests on master e7ec496: 896 passed, 3 ignored. - NAPI/JS: 435 tests, playground 132 tests, and plugin/watch integration passed. - Affected-crate Clippy, formatting and retained-report/gate checks passed. - Nine external cases: Verilator 5 pass/4 retained failures, Icarus 9 retained failures, xezim 3 pass/6 retained failures. Standalone Celox probes pass in both two-state and four-state modes. After syncing master 8c81192 (with #2322 and #2421): a scope without classes of its own discovers queries as before, since it has no class signatures to bind once; resolution keeps the built-in `process` fallback and its type spelling. Analyzer/frontend units: 886 passed, 3 ignored; full SV: 6,421 passed, 20 skipped; retained-report and gate tests pass. Retained Verilator/xezim diagnostics of the foreign cases follow their new case lines. Review follow-ups: a request supplies only the caller's qualified routines (the methods of the classes its actual type arguments name), not its own unqualified functions; an unresolved name in a package class body binding to an importing module's function also happens without importing-scope specializations and is tracked in #2447. A compilation-unit typedef is named with its source file, as compilation-unit classes are, so the same enum typedef in two files gives two specializations; a Celox-only multi-file test covers it, since IEEE 1800-2023 3.12.1 also allows one compilation unit for all files (Verilator rejects the duplicate typedef). Analyzer/frontend 886, full SV 6,422 passed. Change-Id: I94cfcf52749ba3ad9d7e7d893e795c86bc146939
UVM stops at unknown package
process. Bind the built-in process type,state enum and methods, and execute them against dynamic scheduler
activations through a shared host-request family on every backend.
Implement self/status/kill/await/suspend/resume and per-process RNG state
(IEEE 1800-2023 9.7, 18.13.3-18.13.5). Support std::process and its state type
(26.7). Keep process references independent of heap object IDs. Retain exposed
identities after completion, preserve FINISHED on no-op controls, cancel
all descendants through completed parents, and wake status/await observers.
Suspended delays keep their original deadline; event waits rearm without
consuming suspended edges; level waits recheck immediately. Conditional-event
waits discard host pulses during suspension and rearm module counters and
automatic gates after checkpoint restoration. Checkpoints preserve control
state. Reject invalid construction, inheritance and calls. Pre-scan nested
statements and omitted-argument defaults before classifying waits, so a process
call later in a loop cannot leave earlier level waits insensitive on resume.
Recompute activation-local event probes from current shared cells before taking
resumed event baselines. Program exit clears suspended/awaiting/observer state;
resume ignores dead activations, so saved delays cannot revive their continuations.
User packages and classes named process retain their declarations, including
package state constants, typedefs and self functions from another source file. The
explicit std::process name remains unambiguous. Cancellation checks implicit
program completion, including self-kill and descendant cancellation, and
runs final procedures. Program $exit notifies observers of every sibling and
descendant after the whole program has ended, including suspended targets
and checkpoint-restored observers. Pending predicate reevaluations do not
notify other status waiters. External kill releases the target frame and local
bindings while preserving handle identity and RNG state; self-kill retires
after saving the current frame. During finalization, kill does not trigger a
second implicit finish that would skip cleanup. All final bodies share one
process identity and RNG, including draw-only bodies and stop/resume; the
identity remains RUNNING until the final phase ends (9.2.3). Save the running
caller's frame before ancestor kill can retire it, retaining its latest RNG
draw. set_randstate converts packed actuals to its string
formal before storing handles. Typed heap-helper operands retain formal
sizing, mutable receiver locations and GC roots across host boundaries.
Support final procedures in timed shared cases. Check final output after
all final procedures have run, preserving partial writes around simulator
finish notices. Scripts must avoid reads of another final procedure's writes
because final order is unspecified (9.2.3). External staging rejects post-finish
signal reads unless every design final is empty or only prints literals or
simulation time. Inspect emitted, cross-file preprocessed SV and conservatively
reject function/argument effects, including implicit calls and escaped names.
Output expectations and values captured before finish remain supported.
A script starting with
run_to_finish introduces no auxiliary settler program that could suppress
implicit completion. Add eighteen process cases and two final-harness cases
across native/image/parallel native, Cranelift/parallel Cranelift and WASM.
Validation:
including 2state/4state checkpoint/RNG, host/HDL final-kill tests, and
shared final identity/RNG across a draw-only body and stop/resume, plus
suspended iff waits with host pulses and checkpoint replay on all four
backends in both state modes. The three resume review regressions replay
checkpoints twice in each configuration, including nested calls and defaults,
automatic event expressions and handles ended by program exit.
Three private scheduler regressions verify bounded mutual-wait progress,
frame/local-binding reclamation with RNG retention after 16 external kills,
and program-exit suspension/wakeup cleanup,
on native/interpreter/Cranelift/WASM in both state modes.
SV frontend 11; shared-suite units 58 (3 ignored). Existing process/fork/
state-file integration: 37 passed. Affected and consumer Clippy passed.
and final-harness cases pass 5/14 in Verilator, 3/14 in Icarus and 5/14 in
pinned xezim. The qualified-package typedef case passes all three tools;
shared final identity/RNG passes Verilator. Their twenty-nine exact failures
are retained with original assertions intact.
The nine fresh selected reports for the resume cases pass the comparison
gate; prior rows, assertions and exclusions are preserved. xezim's automatic
compound wait already wakes at time0, isolated with observations before and
during suspension; classify that startup failure separately from resume.
Final-order staging regressions cover direct/indirect writes, macro expansion,
hierarchy, argument effects and safe output/captured-value checks; the entire
existing SV catalogue satisfies the restriction. Both final-output cases were
rerun with Verilator, Icarus and pinned xezim; their fresh reports match the
retained failure contracts without changing evidence. Default/external suite
Clippy and both suite doctests pass.
the eight review repros also pass Celox in both state modes (32 runs).
The two resume probes also pass both tops in both state modes (8 runs).
Static function state across three finals also passes both state modes.
cases in both state modes. Each also passes local simulation. Update only
those eight expectations; the resulting file matches all 3,300 CI rows.
class type parameter value blocker. Full UVM execution is not claimed.
Exposed identities remain allocated until simulation teardown. Portable state
files reject exposed process handles; in-memory checkpoints support them.
This is an independent master-based change without a Depends-On stack.
Preserve four-state class properties
alongside process fields. Process handles remain two-state and null-initialized;
only logic/reg/implicit integral fields store unknown planes. Added a native
and interpreter checkpoint regression with a process field between two
four-state logic fields. Full SV 6,336 passed (20 existing ignored), process API
17 passed, analyzer 879 passed (3 existing ignored), affected/API Clippy,
NAPI/JS 435 and plugin integrations passed. Both sets of retained external
validation records are preserved; shared case sources are unchanged.
Integration with concurrent assertions on master e7ec496: full SV 6,362
passed (20 existing ignored), process API 17 and concurrent assertion API 5
passed, retained-report checks 4 passed, formatting passed. The only manual
conflict was combining the two sets of xezim review records; code merged
without manual changes.