Repository navigation
feat(sv)!: support inherited randomization and rand_mode - #1787
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. |
5c1a97b to
aad2288
Compare
Revision history
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aad228888b
ℹ️ 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".
| } else if let Some(owner) = native_class(tree, *expression, native, dimensions) { | ||
| ( | ||
| None, | ||
| Some(owner), | ||
| bind_value(*expression, native, tree, dimensions, None)?, |
There was a problem hiding this comment.
Reject rand_mode through interface-class handles
When the receiver's static type is an interface class, native_class returns that interface here, so i.rand_mode(0) is accepted and the generated I::rand_mode dynamically mutates the implementing object's modes. Unlike randomize(), rand_mode() is not legal through an interface-class handle because the interface class has no data members, so this should produce a compile-time diagnostic rather than accepting nonconforming source (IEEE 1800-2017 §18.8).
Useful? React with 👍 / 👎.
|
Queued — the merge queue status continues in this comment ↓. |
aad2288 to
80d6a73
Compare
4b459d1 to
f301ea0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80d6a73b52
ℹ️ 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".
| ( | ||
| None, | ||
| Some(owner), | ||
| bind_value(*expression, native, tree, dimensions, None)?, |
There was a problem hiding this comment.
Handle
super.rand_mode(...) as a call on this
Inside a derived instance method, an object-wide call such as super.rand_mode(0) reaches this branch because native_class resolves super to the base class, but then bind_value(super) rejects the standalone super expression. The ordinary method binder already represents a super receiver as Receiver::This; this path needs the same treatment so valid inherited rand_mode calls are not rejected during analysis.
Useful? React with 👍 / 👎.
Randomize the concrete dynamic class through base handles, including inherited rand properties and hooks. Add object/property rand_mode controls and temporary randomize(member, ...) selection, with randomize(null) running hooks without drawing values. Preserve modes through checkpoint/restore and differential checks. Expose additional ObjectOp variants for random-mode heap operations. Constraints, randc randomization, and non-integral randomization remain unsupported. Add portable regressions plus wide-selection and checkpoint API tests, and update English/Japanese reference documentation. Retain narrow external-tool exclusions: Icarus cannot compile the four cases; Verilator passes two, but fails inherited srandom compilation and disagrees on truncation of rand_mode's bit argument. Validation: - Formatting and affected crate/test clippy checks pass. - Analyzer, heap, and SV frontend unit tests: 816 passed. - Differential SystemVerilog class tests: 159 passed. - Retained external evidence checks: 3 passed. - NAPI build and JS integration: 432 tests passed. - All four new shared cases exercised with Verilator and Icarus; tool limitations and original diagnostics retained in verification/repros. Randomization signature discovery defers unsupported unused class layouts instead of making unrelated interface class declarations fail. Add a regression for inherited typedef and parameterized interface declarations. CI regression validation: the release driver and unmodified official sv-tests runner match all 2054 checked-in 2state/4state expectations with no baseline changes. Analyzer unit tests (795), differential class tests (159), formatting, and analyzer Clippy also pass after this fix. Change-Id: Ia8213f0f33deda93f2a187b22504f6fbb6c3cb63
f301ea0 to
ea71f96
Compare
80d6a73 to
726db2b
Compare
Merge Queue Status
This pull request spent 1 hour 6 minutes 7 seconds in the queue, including 57 minutes 42 seconds running CI. Required conditions to merge
|
Randomize the concrete dynamic class through base handles, including inherited
rand properties and hooks. Add object/property rand_mode controls and temporary
randomize(member, ...) selection, with randomize(null) running hooks without
drawing values. Preserve modes through checkpoint/restore and differential checks.
Expose additional ObjectOp variants for random-mode heap operations. Constraints,
randc randomization, and non-integral randomization remain unsupported.
Add portable regressions plus wide-selection and checkpoint API tests, and update
English/Japanese reference documentation. Retain narrow external-tool exclusions:
Icarus cannot compile the four cases; Verilator passes two, but fails inherited
srandom compilation and disagrees on truncation of rand_mode's bit argument.
Validation:
and original diagnostics retained in verification/repros.
Randomization signature discovery defers unsupported unused class layouts instead
of making unrelated interface class declarations fail. Add a regression for
inherited typedef and parameterized interface declarations.
CI regression validation: the release driver and unmodified official sv-tests
runner match all 2054 checked-in 2state/4state expectations with no baseline
changes. Analyzer unit tests (795), differential class tests (159), formatting,
and analyzer Clippy also pass after this fix.
Depends-On: #1767