-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into example/gray-to-binary
- Loading branch information
Showing
42 changed files
with
2,074 additions
and
416 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
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,14 @@ | ||
# Error Correcting Codes (ECC) | ||
|
||
ROHD-HCL implements [Hamming codes](https://en.wikipedia.org/wiki/Hamming_code) for error correction and detection. The Wikipedia article does a good job explaining the background and functionality of Hamming codes, for those unfamiliar. | ||
|
||
An error correcting code is a code that can be included in a transmission with some data that enables the receiver to check whether there was an error (up to some number of bit flips), and possibly correct the error (up to a limit). There is a trade-off where increasing the number of additional bits included in the code improves error checking/correction, but costs more bits (area/power/storage). | ||
|
||
ROHD-HCL only has Hamming codes currently, but there are many types of error correcting codes. The `HammingEccTransmitter` and `HammingEccReceiver` can support any data width, and support the following configurations: | ||
|
||
| Type | Errors detectable | Errors correctable | Extra parity bit | | ||
|------|-------------------|--------------------|------------------| | ||
| Single Error Correction (SEC) | 1 | 1 | No | | ||
| Double Error Detection (SEDDED) | 2 | 0 | No | | ||
| Single Error Correction, Double Error Detection (SECDED) | 2 | 1 | Yes | | ||
| Triple Error Detection (SEDDEDTED) | 3 | 0 | Yes | |
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,3 @@ | ||
# Edge Detection | ||
|
||
The `EdgeDetector` is a simple utility to determine whether the current value of a 1-bit signal is different from the value in the previous cycle. It is a fully synchronous design, so it does not asynchronously detect edges. It optionally supports a reset, with an optional reset value. It can be configured to detect positive, negative, or "any" edges. |
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,12 @@ | ||
# Parallel Prefix Operations | ||
|
||
ROHD HCL implements a set of parallel prefix compute operations using different parallel prefix computation trees based on the ['ParallelPrefix'] node class carrying carry/save or generate/propagate bits. | ||
|
||
For example, we have unary operations like a word-level 'or' [`ParallelPrefixOrScan`] class, and a priority encoder [`ParallelPrefixPriorityEncoder`] class which computes the position of the first bit set to '1'. We have simple unary arithmetic operations like an increment [`ParallelPrefixIncr`] class, and a decrement [`ParallelPrefixDecr`] class. Finally, we have a binary adder [`ParallelPrefixAdder`] class. For background on basic parallel prefix adder structures, see <https://en.wikipedia.org/wiki/Kogge%E2%80%93Stone_adder>. | ||
|
||
Each of these operations can be implemented with different ['ParallelPrefix'] types: | ||
|
||
- ['Ripple'] | ||
- ['Sklansky] | ||
- ['KoggeStone'] | ||
- ['BrentKung] |
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,39 @@ | ||
// Copyright (C) 2024 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// config_ecc.dart | ||
// Configurator for ECC. | ||
// | ||
// 2024 January 18 | ||
// Author: Max Korbel <[email protected]> | ||
|
||
import 'package:rohd/rohd.dart'; | ||
import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
||
/// A [Configurator] for [HammingEccReceiver] and [HammingEccTransmitter]. | ||
class EccConfigurator extends Configurator { | ||
/// A knob controlling the [HammingType]. | ||
final ChoiceConfigKnob<HammingType> typeKnob = | ||
ChoiceConfigKnob(HammingType.values, value: HammingType.sec); | ||
|
||
/// A knob controlling the data width. | ||
final IntConfigKnob dataWidthKnob = IntConfigKnob(value: 4); | ||
|
||
@override | ||
Module createModule() => HammingEccReceiver( | ||
HammingEccTransmitter( | ||
Logic(width: dataWidthKnob.value), | ||
hammingType: typeKnob.value, | ||
).transmission, | ||
hammingType: typeKnob.value, | ||
); | ||
|
||
@override | ||
late final Map<String, ConfigKnob<dynamic>> knobs = { | ||
'Data Width': dataWidthKnob, | ||
'Hamming Type': typeKnob, | ||
}; | ||
|
||
@override | ||
final String name = 'ECC'; | ||
} |
51 changes: 51 additions & 0 deletions
51
lib/src/component_config/components/config_edge_detector.dart
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,51 @@ | ||
// Copyright (C) 2024 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// config_edge_detector.dart | ||
// Configurator for a EdgeDetector. | ||
// | ||
// 2024 January 29 | ||
// Author: Max Korbel <[email protected]> | ||
|
||
import 'dart:collection'; | ||
|
||
import 'package:rohd/rohd.dart'; | ||
import 'package:rohd_hcl/rohd_hcl.dart'; | ||
import 'package:rohd_vf/rohd_vf.dart'; | ||
|
||
/// A [Configurator] for [EdgeDetector]. | ||
class EdgeDetectorConfigurator extends Configurator { | ||
/// A knob controlling the type of edge detector. | ||
final ChoiceConfigKnob<Edge> edgeTypeKnob = | ||
ChoiceConfigKnob(Edge.values, value: Edge.pos); | ||
|
||
/// A knob controlling whether there is a reset. | ||
final ToggleConfigKnob hasResetKnob = ToggleConfigKnob(value: true); | ||
|
||
/// A knob controlling the reset value. | ||
final ChoiceConfigKnob<dynamic> resetValueKnob = | ||
ChoiceConfigKnob([0, 1, 'Input'], value: 0); | ||
|
||
@override | ||
Module createModule() => EdgeDetector( | ||
Logic(), | ||
clk: Logic(), | ||
reset: hasResetKnob.value ? Logic() : null, | ||
edgeType: edgeTypeKnob.value, | ||
resetValue: hasResetKnob.value | ||
? resetValueKnob.value == 'Input' | ||
? Logic() | ||
: resetValueKnob.value | ||
: null, | ||
); | ||
|
||
@override | ||
Map<String, ConfigKnob<dynamic>> get knobs => UnmodifiableMapView({ | ||
'Edge Type': edgeTypeKnob, | ||
'Has Reset': hasResetKnob, | ||
if (hasResetKnob.value) 'Reset Value': resetValueKnob, | ||
}); | ||
|
||
@override | ||
final String name = 'Edge Detector'; | ||
} |
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'; | ||
} |
Oops, something went wrong.