Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
82e900e
move synthesis naming to a common naming utility so all synthesizers …
desmonddak Apr 17, 2026
85f88ce
dart 3.11 parameter_assignments pickiness
desmonddak Apr 17, 2026
b1de1e5
Merge branch 'main' into central_naming
desmonddak Apr 17, 2026
b7087c4
conflict resolved and dart format . works
desmonddak Apr 17, 2026
4a55214
properly assign naming spaces for instances vs signals
desmonddak Apr 18, 2026
ed7be36
format issue
desmonddak Apr 18, 2026
ab09aed
Controllable enforcement of signal vs instance name uniqueness.
desmonddak Apr 19, 2026
520d280
Refactored to Namer class. No external API changes for ROHD
desmonddak Apr 19, 2026
61d0319
signal registry
desmonddak Apr 20, 2026
becdb36
module context name uniquification instead of signal/instance split
desmonddak May 1, 2026
a86f80c
Merge branch 'main' into central_naming
desmonddak May 3, 2026
d5904a6
cleanup of port vs signal name assumptions, constant merging and sign…
desmonddak May 3, 2026
3645293
Add ModuleServices singleton and SvService
desmonddak May 6, 2026
510ee01
Add netlist synthesizer, NetlistService, and supporting infrastructure
desmonddak May 6, 2026
2f7f0d1
formatting
desmonddak May 6, 2026
6dfe0f9
simplified forModule, improved code doc
desmonddak May 12, 2026
3800624
Merge branch 'central_naming' into netlist
desmonddak May 12, 2026
3c90e5d
more coverage for Namer
desmonddak May 12, 2026
49d196d
Merge branch 'central_naming' into netlist
desmonddak May 12, 2026
b2c9715
streamlined netlist optimization passes
desmonddak May 12, 2026
3e103f9
Add ModuleServices singleton and SvService
desmonddak May 6, 2026
d985446
Add netlist synthesizer, NetlistService, and supporting infrastructure
desmonddak May 6, 2026
831e3da
formatting
desmonddak May 6, 2026
38cf2aa
Merge branch 'central_naming' into netlist
desmonddak May 12, 2026
5e40679
Merge branch 'central_naming' into netlist
desmonddak May 12, 2026
be67018
streamlined netlist optimization passes
desmonddak May 12, 2026
674f518
fix: use tearoff for tearDown (unnecessary_lambdas)
desmonddak May 12, 2026
7c11aa5
Merge branch 'netlist' of https://github.com/desmonddak/rohd into net…
desmonddak May 12, 2026
1e0f9b7
fix: use tearoff for tearDown (unnecessary_lambdas)
desmonddak May 12, 2026
f890ce9
structures in FST
desmonddak May 14, 2026
f46d177
fix: restore async tearDown in module_services_test (reverts overly-a…
desmonddak May 14, 2026
f8bca95
feat(netlist): add orphaned-netname DCE cleanup, structural validatio…
desmonddak May 17, 2026
6492d68
feat(netlist): multi-dim array handling, array_slice wire separation,…
desmonddak May 21, 2026
880cf05
remove override in doc
desmonddak May 21, 2026
a2d5d3c
fixed failure, added versioning
desmonddak May 21, 2026
6d80b8e
Merge branch 'central_naming' into module_services
desmonddak May 21, 2026
99474ca
dart v3.12 analysis
desmonddak May 21, 2026
42fba62
canonical names at last, even in the comments
desmonddak Jun 12, 2026
6a41f8d
pesky override rule surfaced again on tutorials file
desmonddak Jun 12, 2026
139280f
new keyring-based installation for dart in codespaces
desmonddak Jun 12, 2026
62e4a2c
new keyring-based installation for dart in codespaces
desmonddak Jun 12, 2026
caecb02
keyring-style dart installation rather than holding keys
desmonddak Jun 14, 2026
089faf8
new dart analyzer failure with bad override
desmonddak Jun 14, 2026
e015889
Merge branch 'override-bug' into new-dart
desmonddak Jun 14, 2026
1232afb
Potential fix for pull request finding
desmonddak Jun 15, 2026
e558a4d
Orthogonalize: simplify Namer by removing instance name caching
desmonddak Jun 17, 2026
5e56bd4
Merge updated central_naming with simplified Namer
desmonddak Jun 17, 2026
82663d8
Merge updated central_naming with simplified Namer
desmonddak Jun 17, 2026
8ef6820
Fix orthogonalized Namer: remove stale instanceNameOf method
desmonddak Jun 17, 2026
d019f42
Fix orthogonalized Namer: remove stale instanceNameOf method
desmonddak Jun 17, 2026
99cf339
Fix orthogonalized Namer: remove stale instanceNameOf method
desmonddak Jun 17, 2026
f75950d
cleanup of SvService
desmonddak Jun 17, 2026
a1ad631
Convert netlist service to constructor style
desmonddak Jun 17, 2026
7720b14
cleaner SvService maintaining backward compat
desmonddak Jun 17, 2026
93dfdcd
simplify services with direct options
desmonddak Jun 18, 2026
90da30a
Apply integration overlay updates for netlist
desmonddak Jun 19, 2026
68e27c4
Match folded files to integration merge output
desmonddak Jun 19, 2026
675de40
Fix netlist analyzer findings
desmonddak Jun 20, 2026
973300c
Formalize module service inspection contracts
desmonddak Jun 20, 2026
726763e
Merge branch 'module_services' into netlist
desmonddak Jun 20, 2026
601bdb0
Clean DevTools extension analysis
desmonddak Jun 20, 2026
1225df1
Clean DevTools extension analysis and formatting
desmonddak Jun 20, 2026
6284152
Clean DevTools extension analysis
desmonddak Jun 20, 2026
c8440c4
Keep DevTools extension changes on owning branches
desmonddak Jun 20, 2026
cc64482
Keep DevTools extension changes on owning branches
desmonddak Jun 20, 2026
252be4c
Keep DevTools extension changes on owning branches
desmonddak Jun 20, 2026
f3e039a
Merge branch 'central_naming' into module_services
desmonddak Jun 20, 2026
2957aa9
Merge branch 'module_services' into netlist
desmonddak Jun 20, 2026
02f1426
Restore stable instance name caching
desmonddak Jun 20, 2026
0149b0e
Merge branch 'module_services' into netlist
desmonddak Jun 20, 2026
a87fa5c
added back pubkeys, and made a wget a fallback solution with loud war…
desmonddak Jun 21, 2026
c1dc826
trailing comma reduction
desmonddak Jun 22, 2026
7aa1178
trailing comma reduction
desmonddak Jun 22, 2026
14f01a7
Keep DevTools formatting on devtools branch
desmonddak Jun 22, 2026
7889fd4
Make synthesizeToJson synchronous, add packageRoot parameter
desmonddak Jun 22, 2026
1e8acc6
Merge branch 'new-dart' into netlist
desmonddak Jun 22, 2026
f12c3a9
Merge branch 'new-dart' into module_services
desmonddak Jun 22, 2026
f30baf7
Restrict module_services_test to VM platform
desmonddak Jun 22, 2026
dba5beb
Remove duplicate instanceNameOf and trailing-comma reformatting: now …
desmonddak Jun 22, 2026
3677153
Remove duplicate instanceNameOf and stability test: now in central_na…
desmonddak Jun 22, 2026
887e541
Slim ModuleServices to a type-keyed service registry
desmonddak Jun 23, 2026
a88bd70
Merge branch 'module_services' into netlist
desmonddak Jun 23, 2026
1bf9303
Keep generateSynth as a non-deprecated facade over SvService
desmonddak Jun 23, 2026
77f220c
Handle wrapped moduleJson in slim canonical test
desmonddak Jun 24, 2026
81163fa
Clean up Namer allocation API
desmonddak Jun 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ You can also open this repository in a GitHub Codespace to run the example in yo
- Easy **IP integration** and **interfaces**; using an IP is as easy as an import. Reduces tedious, redundant, and error prone aspects of integration
- **Simple and fast build**, free of complex build systems and EDA vendor tools
- Can use the excellent pub.dev **package manager** and all the packages it has to offer
- Built-in event-based **fast simulator** with **4-value** (0, 1, X, and Z) support and a **waveform dumper** to .vcd file format
- Conversion of modules to equivalent, human-readable, structurally similar **SystemVerilog** for integration or downstream tool consumption
- Built-in event-based **fast simulator** with **4-value** (0, 1, X, and Z) support and a **waveform capture service** to .vcd file format
- Conversion of modules to equivalent, human-readable, structurally similar **SystemVerilog** for integration or downstream tool consumption via **SvService**
- **Run-time dynamic** module port definitions (numbers, names, widths, etc.) and internal module logic, including recursive module contents
- Leverage the [ROHD Hardware Component Library (ROHD-HCL)](https://github.com/intel/rohd-hcl) with reusable and configurable design and verification components.
- Simple, free, **open source tool stack** without any headaches from library dependencies, file ordering, elaboration/analysis options, +defines, etc.
Expand Down
2 changes: 1 addition & 1 deletion benchmark/many_submodules_benchmark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ManySubmodulesBenchmark extends AsyncBenchmarkBase {
Future<void> run() async {
final dut = ManySubmodulesModule(Logic(), numSubModules: 10000);
await dut.build();
dut.generateSynth();
SvService(dut).synthOutput;
}
}

Expand Down
2 changes: 1 addition & 1 deletion benchmark/wave_dump_benchmark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class WaveDumpBenchmark extends AsyncBenchmarkBase {
_mod = _ModuleToDump(Logic(), _clk);
await _mod.build();

WaveDumper(_mod, outputPath: _vcdTemporaryPath);
WaveformService(_mod, outputPath: _vcdTemporaryPath);

await Simulator.run();

Expand Down
3 changes: 2 additions & 1 deletion doc/tutorials/chapter_2/helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import 'package:rohd/rohd.dart';

Future<void> displaySystemVerilog(Module mod) async {
await mod.build();
print('\nYour System Verilog Equivalent Code: \n ${mod.generateSynth()}');
print('\nYour System Verilog Equivalent Code: \n'
'${SvService(mod).synthOutput}');
}

class LogicInitialization extends Module {
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/chapter_3/answers/exercise_sv.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void main() async {
await fSub.build();

// ignore: avoid_print
print(fSub.generateSynth());
print(SvService(fSub).synthOutput);

test('should return 0 when a and b equal 1', () async {
a.put(1);
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/chapter_3/full_adder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ void main() async {
final mod = FullAdderModule(a, b, cIn, faOps);
await mod.build();

print(mod.generateSynth());
print(SvService(mod).synthOutput);
}
2 changes: 1 addition & 1 deletion doc/tutorials/chapter_4/answers/exercise_1_sv.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void main() async {
final mod = NBitAdder(a, b);
await mod.build();

print(mod.generateSynth());
print(SvService(mod).synthOutput);

test('should return 255 when both inputs are added', () {
a.put(127);
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/chapter_4/answers/exercise_2_sv.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void main() async {

final mod = NBitSubtractor(a, b);
await mod.build();
print(mod.generateSynth());
print(SvService(mod).synthOutput);

test('should return 5 when a is 25 and b is 20', () {
a.put(25);
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/chapter_4/basic_generation_sv.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void main() async {

await nbitAdder.build();

print(nbitAdder.generateSynth());
print(SvService(nbitAdder).synthOutput);

test('should return 10 when both inputs are 5.', () async {
a.put(5);
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/chapter_5/answers/full_adder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void main() async {
final mod = FullAdder(a: a, b: b, carryIn: cIn);
await mod.build();

print(mod.generateSynth());
print(SvService(mod).synthOutput);

test('should return true if result sum similar to truth table.', () async {
for (var i = 0; i <= 1; i++) {
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/chapter_5/answers/full_subtractor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Future<void> main() async {

await diff.build();

print(diff.generateSynth());
print(SvService(diff).synthOutput);

test('should return true if results matched truth table', () async {
for (var i = 0; i <= 1; i++) {
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/chapter_5/answers/n_bit_subtractor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Future<void> main() async {
final mod = NBitFullSubtractor(a, b);
await mod.build();

print(mod.generateSynth());
print(SvService(mod).synthOutput);

test('should return 1 when a is 8 and b is 7.', () {
a.put(8);
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/chapter_5/n_bit_adder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void main() async {

await nbitAdder.build();

// print(nbitAdder.generateSynth());
// print(SvService(nbitAdder).synthOutput);

test('should return 20 when A and B perform add.', () async {
a.put(15);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import '../../chapter_3/answers/helper.dart';
import '../../chapter_5/answers/full_subtractor.dart';

class FullSubtractorComb extends FullSubtractor {
@override
FullSubtractorComb(super.a, super.b, super.borrowIn) {
// Declare input and output
final a = input('a');
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorials/chapter_7/answers/exercise_1_d_flip_flop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Future<void> main() async {
final dff = DFlipFlop(data, reset, clk);
await dff.build();

print(dff.generateSynth());
print(SvService(dff).synthOutput);

data.inject(1);
reset.inject(1);
Expand All @@ -60,7 +60,7 @@ Future<void> main() async {

unawaited(Simulator.run());

WaveDumper(dff,
WaveformService(dff,
outputPath: 'doc/tutorials/chapter_7/answers/d_flip_flop.vcd');

printFlop('Before');
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/chapter_7/shift_register.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void main() async {
// kick-off the simulator, but we don't want to wait
unawaited(Simulator.run());

WaveDumper(shiftReg,
WaveformService(shiftReg,
outputPath: 'doc/tutorials/chapter_7/shift_register.vcd');

printFlop('Before');
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorials/chapter_8/answers/exercise_1_spi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void main() async {

await tb.build();

print(tb.generateSynth());
print(SvService(tb).synthOutput);

testInterface.cs.inject(0);
testInterface.sdi.inject(0);
Expand All @@ -163,7 +163,7 @@ void main() async {
Simulator.setMaxSimTime(100);
unawaited(Simulator.run());

WaveDumper(peri, outputPath: 'doc/tutorials/chapter_8/spi-new.vcd');
WaveformService(peri, outputPath: 'doc/tutorials/chapter_8/spi-new.vcd');

await drive(LogicValue.ofString('01010101'));
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ Future<void> main(List<String> args) async {
final toyCap = ToyCapsuleFSM(clk, reset, dispenseBtn, coin);
await toyCap.build();

print(toyCap.generateSynth());
print(SvService(toyCap).synthOutput);

toyCap.toyCapsuleStateMachine.generateDiagram();

reset.inject(1);

WaveDumper(toyCap, outputPath: 'toyCapsuleFSM.vcd');
WaveformService(toyCap, outputPath: 'toyCapsuleFSM.vcd');

Simulator.setMaxSimTime(100);
Simulator.registerAction(25, () {
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorials/chapter_8/answers/exercise_3_pipeline.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ void main(List<String> args) async {
final pipe = Pipeline4Stages(clk, reset, a);
await pipe.build();

// print(pipe.generateSynth());
// print(SvService(pipe).synthOutput);

a.inject(5);
reset.inject(1);

Simulator.registerAction(10, () => reset.put(0));

WaveDumper(pipe, outputPath: 'answer_1.vcd');
WaveformService(pipe, outputPath: 'answer_1.vcd');

Simulator.registerAction(50, () async {
// stage 4 / result: 30 + (30 * 3) = 120
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/chapter_8/carry_save_multiplier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void main() async {
reset.inject(1);

// Attach a waveform dumper so we can see what happens.
WaveDumper(csm, outputPath: 'csm.vcd');
WaveformService(csm, outputPath: 'csm.vcd');

Simulator.registerAction(10, () {
reset.inject(0);
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorials/chapter_8/counter_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ Future<void> main() async {

await counter.build();

print(counter.generateSynth());
print(SvService(counter).synthOutput);

WaveDumper(counter,
WaveformService(counter,
outputPath: 'doc/tutorials/chapter_8/counter_interface.vcd');
Simulator.registerAction(25, () {
intf.en.put(1);
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/chapter_8/oven_fsm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Future<void> main({bool noPrint = false}) async {

// Attach a waveform dumper so we can see what happens.
if (!noPrint) {
WaveDumper(oven, outputPath: 'doc/tutorials/chapter_8/oven.vcd');
WaveformService(oven, outputPath: 'doc/tutorials/chapter_8/oven.vcd');
}

if (!noPrint) {
Expand Down
15 changes: 7 additions & 8 deletions doc/tutorials/chapter_9/rohd_vf_example/lib/counter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ class MyCounterInterface extends Interface<CounterDirection> {

final int width;
MyCounterInterface({this.width = 8}) {
setPorts(
[Logic.port('en'), Logic.port('reset')], [CounterDirection.inward]);
setPorts([Port('en'), Port('reset')], [CounterDirection.inward]);

setPorts([
Logic.port('val', width),
Port('val', width),
], [
CounterDirection.outward
]);

setPorts([Logic.port('clk')], [CounterDirection.misc]);
setPorts([Port('clk')], [CounterDirection.misc]);
}

@override
MyCounterInterface clone() => MyCounterInterface(width: width);
}

Expand All @@ -38,9 +36,10 @@ class MyCounter extends Module {
late final MyCounterInterface counterintf;

MyCounter(MyCounterInterface intf) : super(name: 'counter') {
counterintf = addInterfacePorts(counterintf,
inputTags: {CounterDirection.inward, CounterDirection.misc},
outputTags: {CounterDirection.outward});
counterintf = MyCounterInterface(width: intf.width)
..connectIO(this, intf,
inputTags: {CounterDirection.inward, CounterDirection.misc},
outputTags: {CounterDirection.outward});

_buildLogic();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ Future<void> main({Level loggerLevel = Level.FINER}) async {
await tb.counter.build();

// dump wave here
WaveDumper(tb.counter);
WaveformService(tb.counter);

// Set a maximum simulation time so it doesn't run forever
Simulator.setMaxSimTime(300);
Expand Down
8 changes: 6 additions & 2 deletions doc/tutorials/chapter_9/rohd_vf_example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ environment:

# Add regular dependencies here.
dependencies:
rohd: ^0.4.2
rohd_vf: ^0.4.1
rohd: ^0.6.0
rohd_vf: ^0.6.0
logging: ^1.0.1

dependency_overrides:
rohd:
path: ../../../../

dev_dependencies:
lints: ^2.0.0
test: ^1.21.0
44 changes: 14 additions & 30 deletions example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,16 @@
// allow `print` messages (disable lint):
// ignore_for_file: avoid_print

// Import necessary dart packages for this file.
// Import necessary dart pacakges for this file.
import 'dart:async';

// Import the ROHD package.
import 'package:rohd/rohd.dart';

// Define a class Counter that extends ROHD's abstract Module class.
class Counter extends Module {
// For convenience, map interesting outputs to short variable names for
// consumers of this module.
Logic get val => output('val');

// This counter supports any width, determined at run-time.
final int width;

Counter(Logic en, Logic reset, Logic clk,
{this.width = 8, super.name = 'counter'}) {
// Register inputs and outputs of the module in the constructor.
// Module logic must consume registered inputs and output to registered
// outputs.
en = addInput('en', en);
reset = addInput('reset', reset);
clk = addInput('clk', clk);
addOutput('val', width: width);

// We can use the `flop` function to automate creation of a `Sequential`.
val <= flop(clk, reset: reset, en: en, val + 1);
}
}
// Re-export the Counter module from the library examples so that
// existing tests that `import 'example/example.dart'` still see it.
import 'package:rohd/src/examples/oven_fsm_modules.dart' show Counter;
export 'package:rohd/src/examples/oven_fsm_modules.dart' show Counter;

// Let's simulate with this counter a little, generate a waveform, and take a
// look at generated SystemVerilog.
Expand All @@ -61,7 +42,7 @@ Future<void> main({bool noPrint = false}) async {

// Let's see what this module looks like as SystemVerilog, so we can pass it
// to other tools.
final systemVerilogCode = counter.generateSynth();
final systemVerilogCode = SvService(counter).synthOutput;
if (!noPrint) {
print(systemVerilogCode);
}
Expand All @@ -70,14 +51,15 @@ Future<void> main({bool noPrint = false}) async {

// Attach a waveform dumper so we can see what happens.
if (!noPrint) {
WaveDumper(counter);
WaveformService(counter);
}

// Let's also print a message every time the value on the counter changes,
// just for this example to make it easier to see before we look at waves.
if (!noPrint) {
counter.val.changed
.listen((e) => print('@${Simulator.time}: Value changed: $e'));
counter.val.changed.listen(
(e) => print('@${Simulator.time}: Value changed: $e'),
);
}

// Start off with a disabled counter and asserting reset at the start.
Expand Down Expand Up @@ -115,7 +97,9 @@ Future<void> main({bool noPrint = false}) async {

// We can take a look at the waves now.
if (!noPrint) {
print('To view waves, check out waves.vcd with a waveform viewer'
' (e.g. `gtkwave waves.vcd`).');
print(
'To view waves, check out waves.vcd with a waveform viewer'
' (e.g. `gtkwave waves.vcd`).',
);
}
}
Loading
Loading