Module services#669
Open
desmonddak wants to merge 45 commits into
Open
Conversation
…al/instance naming routine names
Introduces a singleton service registry (ModuleServices) that provides a unified query surface for DevTools and inspection tools. Module.build() now registers the root module with ModuleServices.instance. Also adds SvService which wraps SystemVerilog synthesis and registers with ModuleServices for DevTools access to SV metadata. This is a clean separation: no netlist code is included. The netlist branch will later extend ModuleServices with a netlistService field.
Clarify comment Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This aligns central_naming with the simplified naming approach already adopted by all downstream branches (module_services, netlist, source_debug, systemc_trace, fst-writer). Changes: - Remove Namer._instanceNames cache field - Remove Namer.instanceNameOf(Module) method - Update synthesizers to use Namer.allocateName(String) directly - Remove destination tracking from _BusSubsetForStructSlice Benefit: Eliminates duplication across 5+ branches, making each branch truly orthogonal and mergeable without conflicts. Trade-off: Instance names no longer cached across synthesis passes, but all downstreams already use this simpler approach.
# Conflicts: # lib/src/synthesizers/utilities/synth_module_definition.dart # lib/src/synthesizers/utilities/synth_sub_module_instantiation.dart # lib/src/utilities/namer.dart
# Conflicts: # tool/gh_codespaces/install_dart.sh
Uses dart:io (File, Directory, Process) which requires the Dart VM. Matches the pattern used in wave_dumper_test.dart and vcd_parser_test.dart.
…ming
- namer.dart: update docstring ('allocateName' → 'instanceNameOf');
_instanceNames and instanceNameOf method are identical to central_naming
- naming_consistency_test: update comment and add 'stable across repeated
definitions' test — both moved to central_naming where they belong
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
This is a new API for dealing with services after a module has been built. Rather than adding more methods to
Module, we create services that can operate on a builtModule, like writing out waveforms, or synthesizing outputs like SystemVerilog.So instead of
'module.generateSynth(outputPath: 'build/${module.definitionName}.sv')for outputing SystemVerilog andWaveDumper(module, outputPath: 'build/${module.definitionName}.vcd')for outputing Waveforms, we use:As we add more services, this is a more consistent API with fewer surprises.
Related Issue(s)
None
Testing
Tests are converted to the new Service apis and run through.
Backwards-compatibility
No. But eventually, we would like to deprecate existing methods in favor of a services model.
Documentation
Small changes in the README.md and throughout the tutorial and tests.