Skip to content

fix(sv): distribute interface array port connections - #1622

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/fix/sv-interface-array-ports/distribute-interface-array-port-conns--51a5d79d
Oct 21, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/fix/sv-interface-array-ports/distribute-interface-array-port-conns--51a5d79d

Conversation

@tignear

@tignear tignear commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Interface instance arrays connected every element to the same full actual,
so scalar inputs could observe the same truncated bit and outputs could
produce overlapping drivers. Distribute packed connections MSB-first in
instance declaration order; match unpacked dimensions left-to-left, retain
single-port broadcasts and reject incompatible shapes or widths.

Keep the caller's selected port types available while binding connections.
Convert slices back to the authored coordinates of single packed dimensions,
including ascending and offset ranges, and preserve part-select origins.
Local interfaces with ordinary ports use native scope binding independently
of module interface contracts. Collect required contracts selectively so named
and generic module interface ports can coexist with local scalar and array
interface connections; existing contract validation remains active.

Add shared cases for named/positional input and output connections, ascending
and descending ranges, wider ports, broadcasts, output part-selects, generate
scopes, unpacked actuals and array ports, and multidimensional instances.
Diagnostic regressions reject incorrect connection widths and dimensions.
A mixed-design regression covers typed and generic module interface ports
alongside ordinary local interface connections.

Fixes #1498.

Validation on the current master base:

  • All five new shared cases pass five Celox execution variants (25 tests).
  • Full SV integration: 3,199 passed; 90 existing ignores.
  • Analyzer: 759 passed; 3 existing ignores; 2 doctests passed.
  • Shared-suite with external feature: 46 passed; 2 existing ignores.
    Formatting, analyzer/suite Clippy
    with warnings denied, retained-evidence links and diff checks pass.
  • The unchanged cases previously passed Verilator 5.052 for the three
    one-dimensional cases and the mixed case; it rejects the 2x2 packed
    connection after counting only the inner instance dimension.
  • Icarus 13.0 passes packed connections, but rejects unpacked actuals and
    multidimensional instances and aborts on interface array ports.
    Exact tool/case exclusions retain these pre-exclusion compile diagnostics
    under verification/repros/sv_interface_array_connections_*.json and are
    documented in LIMITATIONS.md. All original shared assertions remain active
    for Celox; historical simulation results remain unchanged.

The mixed-case Icarus port-declaration failure is retained separately in
verification/repros/sv_mixed_interface_connections_icarus.json and added to
the existing exact-case interface-port limitation.

The master rebase retains both sets of analyzer regressions and all existing
external-tool limitation entries. Shared case sources and retained diagnostics
are unchanged, so external simulation was not repeated for the rebase.

Record all five reviewed tool/case exclusions in the retained interface-group
reports, and synchronize the evidence link added to the existing Icarus
interface issue. This fixes the CI retained-report coverage contract without
refreshing unrelated results. The failed-before retained-report tests (3)
and the full shared suite with the external feature pass locally.

Place the added analyzer regression beside the interface-array tests and
the new limitations beside the interface entries, avoiding shared tail
insertion points when other pull requests add unrelated regressions.

@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: 78a7163389

ℹ️ 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 on lines +3106 to +3107
} else {
Design::collect(&files)?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Exclude port-bearing interfaces when contracts are also needed

When any module has an interface port, needs_plan is true and this falls back to Design::collect(&files), which calls InterfaceDecl::collect for every interface and rejects every interface with ordinary ports. Consequently, a design combining a traditional zero-port interface contract (for example, module Child(Bus b)) with the newly supported local interface Wire(input logic x) array still fails in plan_interfaces before connection distribution runs. Keep contract planning enabled for the module interface ports without collecting unrelated port-bearing local interfaces.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 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 ⚠️ Failed 2026-10-20T22:28:12.016157Z
We couldn’t complete this review. Comment @codex review to try again.
9a199fd 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.

@tignear
tignear force-pushed the stack/tignear/fix/sv-interface-array-ports/distribute-interface-array-port-conns--51a5d79d branch from 78a7163 to c8bfe0f Compare October 20, 2026 14:24
@tignear

tignear commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial c8bfe0f 2026-10-20 15:49 UTC
2 content c8bfe0f → 5021b01 Resolve PR #1622 conflicts with current master while preserving interface array distribution and mixed-contract regressions 2026-10-20 15:49 UTC
3 content 5021b01 → 43ef165 Fix CI retained-report contract: register five reviewed interface exclusions and synchronize changed issue evidence metadata 2026-10-20 20:52 UTC
4 content 43ef165 → 9a199fd Resolve renewed PR #1622 conflicts with current master, preserving reviewed exclusions and interface regression coverage 2026-10-20 22:27 UTC

@tignear
tignear force-pushed the stack/tignear/fix/sv-interface-array-ports/distribute-interface-array-port-conns--51a5d79d branch from c8bfe0f to 5021b01 Compare October 20, 2026 15:49
@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 20, 2026
@tignear
tignear force-pushed the stack/tignear/fix/sv-interface-array-ports/distribute-interface-array-port-conns--51a5d79d branch from 5021b01 to 43ef165 Compare October 20, 2026 20:53
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Interface instance arrays connected every element to the same full actual,
so scalar inputs could observe the same truncated bit and outputs could
produce overlapping drivers. Distribute packed connections MSB-first in
instance declaration order; match unpacked dimensions left-to-left, retain
single-port broadcasts and reject incompatible shapes or widths.

Keep the caller's selected port types available while binding connections.
Convert slices back to the authored coordinates of single packed dimensions,
including ascending and offset ranges, and preserve part-select origins.
Local interfaces with ordinary ports use native scope binding independently
of module interface contracts. Collect required contracts selectively so named
and generic module interface ports can coexist with local scalar and array
interface connections; existing contract validation remains active.

Add shared cases for named/positional input and output connections, ascending
and descending ranges, wider ports, broadcasts, output part-selects, generate
scopes, unpacked actuals and array ports, and multidimensional instances.
Diagnostic regressions reject incorrect connection widths and dimensions.
A mixed-design regression covers typed and generic module interface ports
alongside ordinary local interface connections.

Fixes #1498.

Validation on the current master base:
- All five new shared cases pass five Celox execution variants (25 tests).
- Full SV integration: 3,199 passed; 90 existing ignores.
- Analyzer: 759 passed; 3 existing ignores; 2 doctests passed.
- Shared-suite with external feature: 46 passed; 2 existing ignores.
  Formatting, analyzer/suite Clippy
  with warnings denied, retained-evidence links and diff checks pass.
- The unchanged cases previously passed Verilator 5.052 for the three
  one-dimensional cases and the mixed case; it rejects the 2x2 packed
  connection after counting only the inner instance dimension.
- Icarus 13.0 passes packed connections, but rejects unpacked actuals and
  multidimensional instances and aborts on interface array ports.
  Exact tool/case exclusions retain these pre-exclusion compile diagnostics
  under verification/repros/sv_interface_array_connections_*.json and are
  documented in LIMITATIONS.md. All original shared assertions remain active
  for Celox; historical simulation results remain unchanged.

The mixed-case Icarus port-declaration failure is retained separately in
verification/repros/sv_mixed_interface_connections_icarus.json and added to
the existing exact-case interface-port limitation.

The master rebase retains both sets of analyzer regressions and all existing
external-tool limitation entries. Shared case sources and retained diagnostics
are unchanged, so external simulation was not repeated for the rebase.

Record all five reviewed tool/case exclusions in the retained interface-group
reports, and synchronize the evidence link added to the existing Icarus
interface issue. This fixes the CI retained-report coverage contract without
refreshing unrelated results. The failed-before retained-report tests (3)
and the full shared suite with the external feature pass locally.

Place the added analyzer regression beside the interface-array tests and
the new limitations beside the interface entries, avoiding shared tail
insertion points when other pull requests add unrelated regressions.

Change-Id: I51a5d79d2c5d47eb2e4abb94d39bf2ea276d3ea4
@tignear
tignear force-pushed the stack/tignear/fix/sv-interface-array-ports/distribute-interface-array-port-conns--51a5d79d branch from 43ef165 to 9a199fd Compare October 20, 2026 22:28
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@mergify mergify Bot added the queued Mergify queue entry label Oct 20, 2026
@mergify

mergify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 36 minutes 15 seconds in the queue, including 1 hour 22 minutes 36 seconds running CI.

Required conditions to merge
  • check-success = Conventional Commit title
  • check-success = Queue validation
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Lint & Format
    • check-neutral = @github-actions/Lint & Format
    • check-skipped = @github-actions/Lint & Format
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-neutral = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-skipped = @github-actions/NAPI Build (Linux ARM64 GNU)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Windows)
    • check-neutral = @github-actions/NAPI Build (Windows)
    • check-skipped = @github-actions/NAPI Build (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Rust Test & NAPI Build
    • check-neutral = @github-actions/Rust Test & NAPI Build
    • check-skipped = @github-actions/Rust Test & NAPI Build
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Ubuntu)
    • check-neutral = @github-actions/JS Test (Ubuntu)
    • check-skipped = @github-actions/JS Test (Ubuntu)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Windows)
    • check-neutral = @github-actions/JS Test (Windows)
    • check-skipped = @github-actions/JS Test (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Conventional Commit title
    • check-neutral = @github-actions/Conventional Commit title
    • check-skipped = @github-actions/Conventional Commit title

@mergify
mergify Bot merged commit 250122f into master Oct 21, 2026
30 checks passed
@mergify
mergify Bot deleted the stack/tignear/fix/sv-interface-array-ports/distribute-interface-array-port-conns--51a5d79d branch October 21, 2026 00:45
@mergify mergify Bot removed the queued Mergify queue entry label Oct 21, 2026
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.

fix(sv): distribute interface array port connections by element

1 participant