-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright (C) 2024 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// config_priority_arbiter.dart | ||
// Configurator for a PriorityArbiter. | ||
// | ||
// 2024 February 7 | ||
// Author: Max Korbel <[email protected]> | ||
|
||
import 'dart:collection'; | ||
|
||
import 'package:rohd/rohd.dart'; | ||
import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
||
/// A [Configurator] for [Find]. | ||
class FindConfigurator extends Configurator { | ||
/// A knob controlling the width of the bus. | ||
final IntConfigKnob busWidthKnob = IntConfigKnob(value: 8); | ||
|
||
/// A knob controlling whether it should count ones or zeros. | ||
final ToggleConfigKnob countOneKnob = ToggleConfigKnob(value: true); | ||
|
||
/// A knob controlling the generation of an error signal. | ||
final ToggleConfigKnob generateErrorKnob = ToggleConfigKnob(value: false); | ||
|
||
/// A knob controlling whether it should have `n` as an input. | ||
final ToggleConfigKnob includeNKnob = ToggleConfigKnob(value: false); | ||
|
||
@override | ||
late final Map<String, ConfigKnob<dynamic>> knobs = UnmodifiableMapView({ | ||
'Bus Width': busWidthKnob, | ||
'Count Ones': countOneKnob, | ||
'Generate Error': generateErrorKnob, | ||
'Include N': includeNKnob, | ||
}); | ||
|
||
@override | ||
Module createModule() => Find( | ||
Logic(width: busWidthKnob.value), | ||
countOne: countOneKnob.value, | ||
generateError: generateErrorKnob.value, | ||
n: includeNKnob.value | ||
? Logic(width: log2Ceil(busWidthKnob.value)) | ||
: null, | ||
); | ||
|
||
@override | ||
final String name = 'Find'; | ||
} |
This file contains 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