Skip to content

Central synthesizer naming#652

Merged
mkorbel1 merged 54 commits into
intel:mainfrom
desmonddak:central_naming
Jul 1, 2026
Merged

Central synthesizer naming#652
mkorbel1 merged 54 commits into
intel:mainfrom
desmonddak:central_naming

Conversation

@desmonddak

Copy link
Copy Markdown
Contributor

Description & Motivation

Migrate synthesis naming to a central namer so that all synthesizers (and even WaveDumper) can agree on signal naming.
This is needed for a new synthesizer to be added (netlist).

Related Issue(s)

None.

Testing

I ran existing examples in ROHD and compared SV.

I added extensive test matrix test/naming_cases_test.dart for the combinations of naming options (reserved, mergeable, etc) for which I generated tests that pass before and after the central naming.

Two bugs were filed: bug #648 and bug #649 which are fixed in PR # 650 for the traditional SV code as well as in this PR for central naming).

I ran a very, very, very large design example and compared SV before and after.

Backwards-compatibility

Is this a breaking change that will not be backwards-compatible? If yes, how so?

Naming is slightly different due to ordering, so when we do have collisions, we will see _0, _1 on different signals. Plus the two bug fixes involving unnamed substructures and repeated const names.

Documentation

Does the change require any updates to documentation? If so, where? Are they included?

No. None needed.

@desmonddak desmonddak mentioned this pull request Apr 17, 2026

@mkorbel1 mkorbel1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I haven't finished reading it all yet, but first pass a few questions

Comment thread lib/src/synthesizers/synthesizer.dart Outdated
Comment thread lib/src/synthesizers/utilities/synth_sub_module_instantiation.dart Outdated
Comment thread lib/src/synthesizers/synthesizer.dart Outdated
@desmonddak desmonddak requested a review from mkorbel1 April 20, 2026 05:32

@mkorbel1 mkorbel1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is looking pretty good, thank you for refactoring it this way, I can see how it helps your other upcoming changes!

Comment thread lib/src/synthesizers/utilities/synth_logic.dart Outdated
Comment thread lib/src/utilities/namer.dart Outdated
Comment thread lib/src/utilities/namer.dart Outdated
Comment thread lib/src/utilities/namer.dart Outdated
Comment thread lib/src/utilities/namer.dart Outdated
Comment thread lib/src/utilities/namer.dart Outdated
Comment thread lib/src/utilities/namer.dart Outdated
Comment thread lib/src/utilities/namer.dart Outdated
Comment thread test/name_test.dart Outdated
Comment thread test/signal_registry_test.dart Outdated
@desmonddak desmonddak requested a review from mkorbel1 May 3, 2026 19:47

@mkorbel1 mkorbel1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking close now to mergeable!

Comment thread lib/src/utilities/namer.dart Outdated
Comment thread lib/src/synthesizers/utilities/synth_module_definition.dart Outdated
Comment thread test/name_test.dart Outdated
Comment thread test/signal_registry_test.dart
Comment thread lib/src/synthesizers/utilities/synth_sub_module_instantiation.dart Outdated
Two new tests in 'shared instance and signal namespace':

1. 'instance name wins the shared namespace; signal gets the suffix'
   Asserts deterministic ordering: non-reserved instances are picked
   before non-reserved signals, so the instance keeps the bare name
   and the colliding signal is uniquified to inner_0.

2. 'instance-signal collision resolution is stable across repeated
   synthesis passes'
   Calls generateSynth() twice and verifies the module body is
   identical (timestamp stripped). Guards against name drift where
   the second pass would assign different suffixes.
Comment thread lib/src/synthesizers/utilities/synth_module_definition.dart
Comment thread lib/src/synthesizers/utilities/synth_module_definition.dart Outdated
Comment thread lib/src/utilities/namer.dart Outdated
Comment thread lib/src/synthesizers/utilities/synth_logic.dart
Comment thread lib/src/utilities/namer.dart Outdated
Comment thread lib/src/module.dart
Comment thread lib/src/utilities/namer.dart
Comment thread lib/src/synthesizers/utilities/synth_module_definition.dart Outdated
Comment thread lib/src/synthesizers/systemverilog/systemverilog_synth_module_definition.dart Outdated
Comment thread lib/src/utilities/namer.dart
@desmonddak

Copy link
Copy Markdown
Contributor Author

I use Resolve if I think I have fixed. I accidentally thought I had resolved one I had not in the last round. But otherwise, you may not know I have read and attempted a fix.

Add regression test for _BusSubsetForStructSlice.instanceNameKey.
Each SynthModuleDefinition pass creates fresh _BusSubsetForStructSlice
instances for any submodule with a LogicStructure output port.  Without
the instanceNameKey override those instances use 'this' as the cache key,
so the namer allocates a new suffix every pass ('struct_slice' → 'struct_slice_0').
Restoring _destination and overriding instanceNameKey => _destination pins
the cache to the stable destination Logic, keeping names consistent.

Fixes: _BusSubsetForStructSlice._destination removed in 249b210.
Records which Logic the namer chose as the source of each signal name
(an additive reverse map; does not influence naming). Lets source-trace
and cross-probe callers attribute a merged net to its declared signal
rather than an arbitrary internal signal that merged into the same net.
Comment thread lib/src/utilities/namer.dart
Comment thread lib/src/synthesizers/systemverilog/systemverilog_synth_module_definition.dart Outdated
Comment thread tool/gh_codespaces/install_dart.sh
Comment thread lib/src/synthesizers/utilities/synth_module_definition.dart Outdated

@mkorbel1 mkorbel1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

some feedback not addressed, and also new weird thing added?

Comment thread lib/src/utilities/namer.dart Outdated

@mkorbel1 mkorbel1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great!

@mkorbel1 mkorbel1 merged commit d1c2a3d into intel:main Jul 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants