Repository navigation
feat(sv): pass unpacked structures by reference - #2473
mergify[bot] merged 1 commit into
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: c841a15f04
ℹ️ 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 ↓. |
dc72e4c to
6484baa
Compare
c841a15 to
31d6b3f
Compare
Revision history
|
6484baa to
ac30379
Compare
31d6b3f to
43e8dc3
Compare
A `ref` or `const ref` formal of unpacked structure type was rejected, which blocks UVM: `uvm_reg_adapter::reg2bus(const ref uvm_reg_bus_op rw)` and `bus2reg(..., ref uvm_reg_bus_op rw)` are elaborated with every `uvm_pkg`. A structure is a set of member variables, so its reference formal is now one reference per member, bound to the matching member of the actual (IEEE 1800-2023 13.5.2): writes through the formal are seen at once in both directions, also across task suspensions. - The analyzer records the members of a structure formal in `SubroutineParam::leaves`. A reference formal gets no copy-in or copy-out. The body that dispatches a virtual method forwards the members, so a call through a pure virtual method binds the override's members to the caller's. - Actuals: structure variables, members that are structures, class properties of structure type and their members. A scalar member of a structure is now also an ordinary reference actual (`bump(x.a)`). - Type equivalence (6.22.2) compares structure types by identity, also for containers of structures (`ref s_t q[$]`). - `const ref` writes, nonblocking writes and fork uses are checked per member. - The frontend binds each member like a scalar reference. A concatenation assignment to members bound to class properties writes temporaries in their place, so every destination position is taken before any write, then stores each property. A formal bound to a property and passed on to an `output` or `inout` structure argument copies each member back. - A receiver with a side effect (a pop, `$urandom`, a call) is rejected for a structure property actual, as for its whole reads, since each member would evaluate it again. Tests cover callee whole assignment, patterns, comparisons and passing on by reference or value; enumeration, string, class handle and 4-state members; handle members across heap collections; pure virtual `reg2bus`/`bus2reg`; and a task holding the reference across delays. Verilator 5.052 rejects two cases that bind a class property in a function that constructs an object (`%Error-IMPURE`, also with a scalar `ref`). xezim 0.11.3 shows its known copy semantics and padded string properties. Icarus does not support unpacked structures. The docs state that structure members may not be dynamic containers. Change-Id: I41a3098eb3b4359ca618580fb4de6bff25676be4
43e8dc3 to
e0c060f
Compare
ac30379 to
9fd32cc
Compare
✅ Merged into
|
| Condition | |
|---|---|
| ✅ | depends-on = celox-sim/celox#2424 |
The batch, tested on draft #2496
| 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
A
reforconst refformal of unpacked structure type was rejected,which blocks UVM:
uvm_reg_adapter::reg2bus(const ref uvm_reg_bus_op rw)and
bus2reg(..., ref uvm_reg_bus_op rw)are elaborated with everyuvm_pkg. A structure is a set of member variables, so its referenceformal is now one reference per member, bound to the matching member of
the actual (IEEE 1800-2023 13.5.2): writes through the formal are seen at
once in both directions, also across task suspensions.
SubroutineParam::leaves. A reference formal gets no copy-in orcopy-out. The body that dispatches a virtual method forwards the members,
so a call through a pure virtual method binds the override's members to
the caller's.
properties of structure type and their members. A scalar member of a
structure is now also an ordinary reference actual (
bump(x.a)).for containers of structures (
ref s_t q[$]).const refwrites, nonblocking writes and fork uses are checked permember.
assignment to members bound to class properties writes temporaries in
their place, so every destination position is taken before any write,
then stores each property. A formal bound to a property and passed on
to an
outputorinoutstructure argument copies each member back.$urandom, a call) is rejectedfor a structure property actual, as for its whole reads, since each
member would evaluate it again.
Tests cover callee whole assignment, patterns, comparisons and passing
on by reference or value; enumeration, string, class handle and 4-state
members; handle members across heap collections; pure virtual
reg2bus/bus2reg; and a task holding the reference across delays.Verilator 5.052 rejects two cases that bind a class property in a
function that constructs an object (
%Error-IMPURE, also with a scalarref). xezim 0.11.3 shows its known copy semantics and padded stringproperties. Icarus does not support unpacked structures. The docs state
that structure members may not be dynamic containers.
Depends-On: #2424