Skip to content

Netlist synthesizer#654

Closed
desmonddak wants to merge 85 commits into
intel:mainfrom
desmonddak:netlist
Closed

Netlist synthesizer#654
desmonddak wants to merge 85 commits into
intel:mainfrom
desmonddak:netlist

Conversation

@desmonddak

Copy link
Copy Markdown
Contributor

Description & Motivation

This is a netlist synthesizer that uses central naming to match the names of our SystemVerilog synthesizer but outputs in the Yosys JSON format for external use.

Also added are examples, pushed into lib/src so that we can access them with tests.

One exhaustive example is filter_bank which has all elements of ROHD included.

Related Issue(s)

This PR includes all changes from PR #652, so we should merge that first to be clean.

Testing

Netlist tests are included using the examples.

Backwards-compatibility

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

No.

Documentation

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

Yes, it is a new capability. Basic documentation is in architecture.md and in one of the tutorials.

@desmonddak

Copy link
Copy Markdown
Contributor Author

Note that I moved examples into lib/src to enable them to be used as part of tests. The example directory has the outer main and tests for these examples.

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.
Adds a complete netlist synthesis pipeline that converts ROHD module
hierarchies into Yosys-compatible JSON netlists. Key additions:

- NetlistSynthesizer: traverses module hierarchy producing cell/wire JSON
- NetlistService: async factory that registers with ModuleServices
- NetlistOptions: configurable post-processing passes (DCE, struct
  grouping, concat collapsing, etc.)
- NetlistPasses: optimization and structural transformations
- LeafCellMapper: maps ROHD gates to standard cell definitions
- NetlistUtils: wire naming, bit-range formatting, JSON helpers

Also extends Module.build() with optional netlistOptions parameter,
updates ModuleServices with netlistService field, and refactors
examples into lib/src/examples/ for reuse in tests.

Comprehensive test coverage across 11 new/updated test files (146 tests).
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.
Adds a complete netlist synthesis pipeline that converts ROHD module
hierarchies into Yosys-compatible JSON netlists. Key additions:

- NetlistSynthesizer: traverses module hierarchy producing cell/wire JSON
- NetlistService: async factory that registers with ModuleServices
- NetlistOptions: configurable post-processing passes (DCE, struct
  grouping, concat collapsing, etc.)
- NetlistPasses: optimization and structural transformations
- LeafCellMapper: maps ROHD gates to standard cell definitions
- NetlistUtils: wire naming, bit-range formatting, JSON helpers

Also extends Module.build() with optional netlistOptions parameter,
updates ModuleServices with netlistService field, and refactors
examples into lib/src/examples/ for reuse in tests.

Comprehensive test coverage across 11 new/updated test files (146 tests).
# Conflicts:
#	lib/src/diagnostics/module_services.dart
#	lib/src/synthesizers/systemverilog/sv_service.dart
#	lib/src/synthesizers/utilities/synth_module_definition.dart
#	lib/src/synthesizers/utilities/synth_sub_module_instantiation.dart
#	lib/src/utilities/namer.dart
#	test/module_services_test.dart
# Conflicts:
#	lib/src/synthesizers/utilities/synth_module_definition.dart
#	lib/src/synthesizers/utilities/synth_sub_module_instantiation.dart
#	lib/src/utilities/namer.dart
# Conflicts:
#	lib/src/synthesizers/utilities/synth_module_definition.dart
# Conflicts:
#	lib/src/synthesizers/utilities/synth_module_definition.dart
# Conflicts:
#	tool/gh_codespaces/install_dart.sh
# 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.
…in central_naming

instanceNameOf and _instanceNames were added here independently, with
incidental trailing-comma removals.  central_naming is now the canonical
home for both; revert namer.dart to match central_naming exactly.
…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
Introduce ModuleService/OutputService/CodegenService base types and replace
the leaky ModuleServices singleton (per-service getters and inspection
interfaces) with a generic register<T>/lookup<T> registry keyed by service
type. SvService now extends CodegenService, exposes a stable cached
synthOutput, and registers itself via the new registry. WaveformService
registers as a ModuleService. Rewrites module_services_test.dart to the new
API.
# Conflicts:
#	lib/rohd.dart
#	lib/src/diagnostics/module_services.dart
#	lib/src/synthesizers/systemverilog/sv_service.dart
#	test/module_services_test.dart
Defer deprecation of Module.generateSynth so simcompare need not migrate per-branch; keeps simcompare.dart matching base and removes a recurring cross-branch merge conflict.
@desmonddak desmonddak closed this Jun 24, 2026
@desmonddak desmonddak deleted the netlist branch June 24, 2026 14:46
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