Repository navigation
Improve synthesized inter-module wiring and driver-name selection - #726
Merged
Merged
Conversation
desmonddak
reviewed
Oct 5, 2026
desmonddak
approved these changes
Oct 5, 2026
desmonddak
left a comment
Contributor
There was a problem hiding this comment.
Just one comment as I walked through the optimizations and curious if they could be moved to synth. I do have some netlist vs SV code I use for validation, so I could look at this later along with a whole bunch of netlist optimizations which are too risky to push into synth without extensive corner case testing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description & Motivation
Improve generated SystemVerilog for connections between modules, eliminating redundant intermediate signals and assignments where the complete connection can be represented directly at a port.
assignSubset,swizzle, andrswizzle, including clearable alias chains and interior bits beside constants.The additional synthesis cases also exposed two correctness issues addressed here: pruning could remove an inline slice driver still referenced by a synthesized range assignment, and preserved-name scalar Z constants could become undriven X in SystemVerilog. The fixes retain the required drivers without broadly retaining floating array helpers or changing net cleanup.
The optimizations retain guards for preserved names, additional readers, fanout, overlapping or incomplete coverage, constants, and net/inout boundaries. Cases outside the supported transformations keep their existing wiring.
Related Issue(s)
N/A.
Testing
Synthetic regressions check emitted declarations and port mappings, functional equivalence, bit order, partial destinations, constants and X/Z, naming stability across SV/netlist synthesis, custom module behavior, and 33/65-bit boundaries. Icarus is used for ordinary four-state HDL checks. Unpacked-array integration uses Verilator for two-state simulation and ROHD for four-state checks.
The initially exhaustive structural matrices were too expensive. Replace their 2,304 combinations with 424 targeted cases, preserving range/name/fanout interactions, producer variants, boundary slices, constant positions, and named-Z regressions. Each retained case uses 28 routing-focused vectors, with full 256-vector enumeration retained for seven representative cases. Dedicated safety and minimal bug regressions remain active.
Separate source checks, native VM and Node tests, and dev-container VM and Node tests into independent CI jobs. Keep the existing
Run Checksstatus as an aggregate gate that fails when any constituent job fails, is cancelled, or is skipped. Test-platform splitting preserves the existing default runner behavior and all benchmark and platform checks; it does not merely raise the combined timeout. Stub-based shell tests cover platform selection and failure propagation.The Verilator helper's expected missing-tool and warning self-tests capture their deliberate diagnostics, without suppressing unexpected compiler warnings or errors.
Backwards Compatibility
Design-construction APIs are unchanged. Generated SystemVerilog may contain fewer declarations, assignments, and redundant selections, and different canonical internal names. Downstream tooling that depends on exact generated text or internal signal names may need updates.
SimCompare.checkVerilatorVectoradds an optionalonSkipcallback; its default still marks the current test skipped.tool/gh_actions/run_tests.shacceptsall,vm, ornode; invocation without arguments still runs both platforms.Documentation
Naming precedence is documented in the shared namer. Comments beside the test-matrix filters explain the retained representative coverage. No changes to design-authoring workflows are required.