Skip to content

feat(sv): support unpacked structures - #2415

Open
tignear wants to merge 1 commit into
masterfrom
stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures--9a94c0cc
Open

tignear wants to merge 1 commit into
masterfrom
stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures--9a94c0cc

Conversation

@tignear

@tignear tignear commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Unpacked structures (IEEE 1800-2023 7.2) were rejected. A variable of
an unpacked structure type is now a set of leaf variables, one per
member that is not itself an unpacked structure, named by the member
path (s.a.b). Each leaf keeps its member's type, so string, class
handle, enumeration and 2-state or 4-state integral members behave like
variables of those types, and the heap collector finds handle members
through their own slots. A whole structure value is the concatenation
of its leaves; it only lives within one evaluation.

Supported:

  • module variables, procedural locals, and subroutine arguments of any
    direction and results (a structure argument is passed flat and copied
    into and out of its members' variables);
  • member reads and writes, whole assignment (also continuous, in
    always_comb and nonblocking), ==, !=, ===, !==, ?:;
  • assignment patterns: positional, by member name, default (applied
    recursively to nested structures, 10.9.2) and typed T'{...}.

Only patterns and values of the same structure type may be assigned
(6.22.3); other operators, selects and casts of a whole structure are
rejected. Ports, nets, parameters, class properties, arrays and
container elements of an unpacked structure type, and members with
unpacked dimensions or default values, are rejected with dedicated
diagnostics; unpacked unions stay unsupported (#440).

The concatenation parts of an assignment target now take the raw bits
of the value, so a string member receives its handle instead of the
bytes of an integral value. sv-tests chapter-7/structures/unpacked/basic
now passes in both state modes. Icarus 13.0 does not support unpacked
structures, Verilator 5.052 misapplies a nested default, and xezim
0.11.3 shows four defects on the new cases; these are retained as
reviewed limitations and xezim review entries.

@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-28T19:27:35.713884Z 5618438 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: 4167642da2

ℹ️ 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/analyze.rs
Comment thread crates/celox-sv-analyzer/src/ast/procedural.rs
Comment thread crates/celox-sv-analyzer/src/ast/procedural.rs Outdated
Comment thread crates/celox-sv-analyzer/src/ast/procedural.rs
Comment thread crates/celox-sv-analyzer/src/ast/procedural.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-unpacked-structures--9a94c0cc branch from 4167642 to a9fdc69 Compare October 28, 2026 09:24
@tignear

tignear commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial 4167642 2026-10-28 09:24 UTC
2 content 4167642 → a9fdc69 Address review: module declaration initializers, results assigned through the function name, return values before inout copy-back, struct defaults of formals, one-time static initializers 2026-10-28 09:24 UTC
3 content a9fdc69 → 9f1d0a1 2026-10-28 10:10 UTC
4 content 9f1d0a1 → cf97c42 2026-10-28 12:46 UTC
5 content cf97c42 → 24785f2 2026-10-28 13:51 UTC
6 content 24785f2 → 31dd1c3 Rebased onto master after #2411 (ref arguments): output copy-out keeps the structure concat flag beside forwarded properties; ref formals of unpacked structure type are rejected. Review fixes: nested… 2026-10-28 16:16 UTC
7 content 31dd1c3 → 764af58 Rebased onto master after #2390, #2407, #2429 and #2444. Review fix: members of structure formals and results share the subroutine's lifetime (static tasks). The obsolete rejection of a static nested… 2026-10-28 18:14 UTC
8 content 764af58 → 5618438 2026-10-28 19:23 UTC

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

ℹ️ 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/procedural.rs
Comment thread crates/celox-sv-analyzer/src/ast/procedural.rs
Comment thread crates/celox-sv-analyzer/src/ast/unpacked_structs.rs
Comment thread crates/celox-sv-analyzer/src/ast/expression_binding/direct.rs
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures--9a94c0cc branch from a9fdc69 to 9f1d0a1 Compare October 28, 2026 10:11

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

ℹ️ 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/procedural.rs
Comment thread crates/celox-sv-analyzer/src/ast/patterns/binding.rs
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures--9a94c0cc branch from 9f1d0a1 to cf97c42 Compare October 28, 2026 12:49

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

ℹ️ 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/unpacked_structs.rs Outdated
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures--9a94c0cc branch from cf97c42 to 24785f2 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: 24785f259b

ℹ️ 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/unpacked_structs.rs Outdated
Comment thread crates/celox-sv-analyzer/src/ast/patterns/binding.rs
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures--9a94c0cc branch from 24785f2 to 31dd1c3 Compare October 28, 2026 16:17

@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: 31dd1c3940

ℹ️ 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/procedural.rs
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures--9a94c0cc branch from 31dd1c3 to 764af58 Compare October 28, 2026 18:15

@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.

ℹ️ 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/patterns/binding.rs
Comment thread crates/celox-sv-analyzer/src/ast/procedural.rs
Comment thread crates/celox-sv-analyzer/src/ast/expression_binding/direct.rs
Unpacked structures (IEEE 1800-2023 7.2) were rejected. A variable of
an unpacked structure type is now a set of leaf variables, one per
member that is not itself an unpacked structure, named by the member
path (`s.a.b`). Each leaf keeps its member's type, so `string`, class
handle, enumeration and 2-state or 4-state integral members behave like
variables of those types, and the heap collector finds handle members
through their own slots. A whole structure value is the concatenation
of its leaves; it only lives within one evaluation.

Supported:
- module variables, procedural locals, and subroutine arguments of any
  direction and results (a structure argument is passed flat and copied
  into and out of its members' variables);
- member reads and writes, whole assignment (also continuous, in
  `always_comb` and nonblocking), `==`, `!=`, `===`, `!==`, `?:`;
- assignment patterns: positional, by member name, `default` (applied
  recursively to nested structures, 10.9.2) and typed `T'{...}`.

Only patterns and values of the same structure type may be assigned
(6.22.3); other operators, selects and casts of a whole structure are
rejected. Ports, nets, parameters, class properties, arrays and
container elements of an unpacked structure type, and members with
unpacked dimensions or default values, are rejected with dedicated
diagnostics; unpacked unions stay unsupported (#440).

The concatenation parts of an assignment target now take the raw bits
of the value, so a string member receives its handle instead of the
bytes of an integral value. sv-tests chapter-7/structures/unpacked/basic
now passes in both state modes. Icarus 13.0 does not support unpacked
structures, Verilator 5.052 misapplies a nested `default`, and xezim
0.11.3 shows four defects on the new cases; these are retained as
reviewed limitations and xezim review entries.

Change-Id: I9a94c0cc4394766e17f949f72af405c2a3442b0f
@tignear
tignear force-pushed the stack/tignear/feat/sv-uvm-unpacked-structs/support-unpacked-structures--9a94c0cc branch from 764af58 to 5618438 Compare October 28, 2026 19:23
@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 28, 2026
@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

⏳ Checks deferred · conflict with a pull request ahead

So far

  • ✅ Entered the queue Wed 28 Oct, 20:13 · rule changes · triggered by rule Queue explicitly requested merges
  • ⏳ Checks deferred — conflict with a PR ahead in the queue
    • Checks resume if the PR ahead doesn't merge
    • This PR is dequeued if the PR ahead merges

Reason

The pull request conflicts with at least one of the pull requests ahead in queue: #2402, #2403

Conflicting files: crates/celox-test-suite/LIMITATIONS.md, crates/celox-test-suite/verification/sv/limitations.json, crates/celox-test-suite/verification/xezim-review.json

Times in UTC · dashboard · how the merge queue works

This branch has not been deployed

No deployments
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 queued Mergify queue entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant