Skip to content

feat(sv): support nested dynamic containers and class handle keys - #2424

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/sv-uvm-unpacked-structs/support-nested-dynamic-containers-class-handle--54576c9f
Oct 28, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/sv-uvm-unpacked-structs/support-nested-dynamic-containers-class-handle--54576c9f

Conversation

@tignear

@tignear tignear commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

A dynamic container with several dynamic dimensions (int m[string][$],
T m[C][C][E], int grid[][]) was rejected, as was an associative array
indexed by a class (IEEE 1800-2023 7.4.5, 7.8.5), which UVM uses for its
comparer, copier and recorder recursion state.

An element of a container of containers is the inner container's handle.
Containers are immutable heap values, so m[a] reads the inner container,
an absent one being empty, and an update of an element's element, such as
m[a][b] = v, m[a].push_back(x) or m[a].delete(b), writes the updated
inner container back into m[a], and so on outwards. An element of
container type takes a container value, so grid[1] = new[3] works.

A class index is a handle; associative keys of object handles are traced
by the heap collector (container parameter bit 46), so an object referred
to only as a key stays alive. foreach and traversal methods take an
index variable of the class type. sv-tests
chapter-7/arrays/associative/class now passes in both state modes.

Containers of fixed-size unpacked arrays stay unsupported. Icarus 13.0
rejects type-name indices; xezim 0.11.3 misreads two of the new cases,
which the review retains.

Depends-On: #2422

@tignear

tignear commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(sv): support unpacked structures #2415
2 feat(sv): support class properties of unpacked structure type #2419
3 feat(sv): support unpacked structures as dynamic container elements #2422
4 feat(sv): support nested dynamic containers and class handle keys #2424 👈
5 feat(sv): pass unpacked structures by reference #2473

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-28T22:36:20.050460Z 9fd32cc 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: 89558495ce

ℹ️ 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 thread crates/celox-frontend-sv/src/lowering/ff/containers.rs
Comment thread crates/celox-sv-analyzer/src/ast/containers.rs
Comment thread crates/celox-sv-analyzer/src/ast/containers.rs
@mergify

mergify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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

@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-nested-dynamic-containers-class-handle--54576c9f branch from 8955849 to d4cfcb3 Compare October 28, 2026 12:49
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures-dynamic-container--ac820f46 branch from 79d36ee to 437b350 Compare October 28, 2026 12:49
@tignear

tignear commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial 8955849 2026-10-28 12:46 UTC
2 content 8955849 → d4cfcb3 Rebase onto #2322: guard process handles in method lookup, keep record operands flat in object calls 2026-10-28 12:46 UTC
3 rebase d4cfcb3 → 5076963 (rebase only) Address review: typed patterns checked against the target, aggregate names hidden in class scope, packed fields, record purity, process storage and element member bounds 2026-10-28 13:51 UTC
4 content 5076963 → da1cc68 Rebased onto master. Review fixes: class compatibility of associative keys and traversal variables; pops of nested queues are containers. 2026-10-28 16:16 UTC
5 rebase da1cc68 → dc72e4c (rebase only) Rebased onto master. 2026-10-28 18:14 UTC
6 rebase dc72e4c → 6484baa (rebase only) 2026-10-28 19:23 UTC
7 rebase 6484baa → ac30379 (rebase only) 2026-10-28 20:25 UTC
8 content ac30379 → 9fd32cc 2026-10-28 22:32 UTC

@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-nested-dynamic-containers-class-handle--54576c9f branch from d4cfcb3 to 5076963 Compare October 28, 2026 13:52
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures-dynamic-container--ac820f46 branch from 437b350 to 53dedc6 Compare October 28, 2026 13:52

@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: 5076963e22

ℹ️ 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 thread crates/celox-sv-analyzer/src/ast/containers.rs
Comment thread crates/celox-sv-analyzer/src/ast/containers.rs
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-nested-dynamic-containers-class-handle--54576c9f branch from 5076963 to da1cc68 Compare October 28, 2026 16:17
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures-dynamic-container--ac820f46 branch from 53dedc6 to 15e6872 Compare October 28, 2026 16:17
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-nested-dynamic-containers-class-handle--54576c9f branch from da1cc68 to dc72e4c Compare October 28, 2026 18:15
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures-dynamic-container--ac820f46 branch from 15e6872 to 8e65031 Compare October 28, 2026 18:15
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures-dynamic-container--ac820f46 branch from 8e65031 to b431e1e Compare October 28, 2026 19:23
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-nested-dynamic-containers-class-handle--54576c9f branch 2 times, most recently from 6484baa to ac30379 Compare October 28, 2026 20:25
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures-dynamic-container--ac820f46 branch from b431e1e to 5f7b93b Compare October 28, 2026 20:25
A dynamic container with several dynamic dimensions (`int m[string][$]`,
`T m[C][C][E]`, `int grid[][]`) was rejected, as was an associative array
indexed by a class (IEEE 1800-2023 7.4.5, 7.8.5), which UVM uses for its
comparer, copier and recorder recursion state.

An element of a container of containers is the inner container's handle.
Containers are immutable heap values, so `m[a]` reads the inner container,
an absent one being empty, and an update of an element's element, such as
`m[a][b] = v`, `m[a].push_back(x)` or `m[a].delete(b)`, writes the updated
inner container back into `m[a]`, and so on outwards. An element of
container type takes a container value, so `grid[1] = new[3]` works.

A class index is a handle; associative keys of object handles are traced
by the heap collector (container parameter bit 46), so an object referred
to only as a key stays alive. `foreach` and traversal methods take an
index variable of the class type. sv-tests
chapter-7/arrays/associative/class now passes in both state modes.

Containers of fixed-size unpacked arrays stay unsupported. Icarus 13.0
rejects type-name indices; xezim 0.11.3 misreads two of the new cases,
which the review retains.

Change-Id: I54576c9fc206a0a46ff5a3e7a4782eaf5be449d3
@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 28, 2026
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures-dynamic-container--ac820f46 branch from 5f7b93b to a37c612 Compare October 28, 2026 22:32
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-nested-dynamic-containers-class-handle--54576c9f branch from ac30379 to 9fd32cc Compare October 28, 2026 22:32

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

ℹ️ 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 thread crates/celox-frontend-sv/src/lowering/ff/containers.rs
@mergify mergify Bot added the queued Mergify queue entry label Oct 28, 2026
@mergify

mergify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into master as 98feeac at 23:19 UTC

Merged together with #2473. 14 min in the queue, 11 min of it CI.

So far

Merge conditions: 9 of 9 met

This pull request

Condition
✅ depends-on=celox-sim/celox#2424
✅ any of: depends-on = celox-sim/celox#2422, number != 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

Base automatically changed from stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures-dynamic-container--ac820f46 to master October 28, 2026 23:18
@mergify
mergify Bot merged commit 98feeac into master Oct 28, 2026
24 of 44 checks passed
@mergify
mergify Bot deleted the stack/tignear/feat/sv-uvm-unpacked-structs/support-nested-dynamic-containers-class-handle--54576c9f branch October 28, 2026 23:19
@mergify mergify Bot removed the queued Mergify queue entry label Oct 28, 2026
tignear added a commit that referenced this pull request Oct 29, 2026
… reads

Review findings on the unpacked structure stack (#2415, #2422, #2424)
that arrived after it merged:

- A `default` pattern item descends into a structure member unless the
  value is a structure of that member's type (IEEE 1800-2023 10.9.2), so
  `c = '{default: a}` initializes the nested members of `a`'s type
  instead of rejecting it.
- 4-state object fields store their complemented value and mask planes
  masked to the field width. Padding bits stay zero, so a default record
  of a field that is not byte-aligned (`logic flag`) is all zero bytes,
  and `finish_record` keeps it `null`: `d = new[1]; d[0] = d[0];` no
  longer wakes `@(d)`.
- `q.pop_front` and `q.pop_back` without parentheses are whole elements
  of a queue of structures.
- A `$` index of a queue read through a receiver with a side effect, such
  as `m[f()][$]`, is rejected: the size behind `$` reads the receiver
  again, which could name another queue.

Change-Id: Ibd97e9c73adb7703a0734ca9fcdedeb66c0a2189
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