Skip to content

Commit

Permalink
Add tests that configurator modules build (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorbel1 authored Sep 10, 2024
1 parent 063c66e commit 05e4fa3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .pubignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ tmp*
*.vcd
.vscode/*
confapp/.vscode/*
*tracker.json
*tracker.log

# Exceptions
!.vscode/extensions.json
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# ROHD Hardware Component Libary

A hardware component library developed with [ROHD](https://github.com/intel/rohd). This library aims to collect a set of reusable, configurable components that can be leveraged in other designs. These components are also intended as good examples of ROHD hardware implementations.
A hardware component library developed with [ROHD](https://intel.github.io/rohd-website/). This library aims to collect a set of reusable, configurable components that can be leveraged in other designs. These components are also intended as good examples of ROHD hardware implementations.

Check out the [generator web app](https://intel.github.io/rohd-hcl/confapp/), which lets you explore some of the available components, configure them, and generate SystemVerilog.

Expand Down
4 changes: 2 additions & 2 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Some in-development items will have opened issues, as well. Feel free to create
- Encoders & Decoders
- [1-hot to Binary](./components/onehot.md)
- [Binary to 1-hot](./components/onehot.md)
- Gray to Binary
- Binary to Gray
- [Binary to Gray](./components/binary_gray.md#binary-to-gray)
- [Gray to Binary](./components/binary_gray.md#gray-to-binary)
- Priority
- PLAs
- Arbiters
Expand Down
24 changes: 24 additions & 0 deletions test/configurator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@
//
// 2023 December 6

import 'package:rohd/rohd.dart';
import 'package:rohd_hcl/rohd_hcl.dart';
import 'package:rohd_hcl/src/component_config/components/component_registry.dart';
import 'package:test/test.dart';

import '../confapp/test/example_component.dart';

/// A module that just wraps a hierarchy around a given module.
class Wrapper extends Module {
Wrapper(Module m) {
final mOut = m.outputs.values.first;
addOutput('dummy', width: mOut.width) <= mOut;
}
}

void main() {
test('to and from json', () {
final cfg = ExampleConfigurator();
Expand Down Expand Up @@ -274,4 +284,18 @@ void main() {
final sv = await cfg.generateSV();
expect(sv, contains('swizzle'));
});

group('configurator builds', () {
for (final componentConfigurator in componentRegistry) {
test(componentConfigurator.name, () async {
// generates verilog stand-alone
await componentConfigurator.generateSV();

// generates within a wrapping module (check for input/output rules)
final mod = Wrapper(componentConfigurator.createModule());
await mod.build();
mod.generateSynth();
});
}
});
}

0 comments on commit 05e4fa3

Please sign in to comment.