Skip to content

Module services#669

Open
desmonddak wants to merge 45 commits into
intel:mainfrom
desmonddak:module_services
Open

Module services#669
desmonddak wants to merge 45 commits into
intel:mainfrom
desmonddak:module_services

Conversation

@desmonddak

Copy link
Copy Markdown
Contributor

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 built Module, like writing out waveforms, or synthesizing outputs like SystemVerilog.

So instead of 'module.generateSynth(outputPath: 'build/${module.definitionName}.sv') for outputing SystemVerilog and WaveDumper(module, outputPath: 'build/${module.definitionName}.vcd') for outputing Waveforms, we use:

  final sv = SvService(module, outputPath: 'build/${module.definitionName}');
  final waves = WaveformService(module, outputPath: 'build/${module.definitionName}.vcd');

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

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

No. But eventually, we would like to deprecate existing methods in favor of a services model.

Documentation

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

Small changes in the README.md and throughout the tutorial and tests.

desmonddak and others added 30 commits April 17, 2026 08:30
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
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.

1 participant