Skip to content

Commit

Permalink
parallel prefix documentation updates (#82)
Browse files Browse the repository at this point in the history
* parallel prefix documentation updates

* removed blank lines for lint

* formatting problem

* test in src file confused CI

* formatting

* google fonts version

* google fonts issue needs to be locked to 6.1.0

* use_super_parameters for key

* use_super_parameters for key (second source)

* google_fonts experiment

* google_fonts fix version to 6.1.0
  • Loading branch information
desmonddak authored Mar 21, 2024
1 parent 20d897a commit b593ec6
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 17 deletions.
4 changes: 2 additions & 2 deletions confapp/lib/hcl/view/screen/content_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class SVGenerator extends StatefulWidget {
final SidebarXController controller;

const SVGenerator({
Key? key,
super.key,
required this.controller,
}) : super(key: key);
});

@override
State createState() => _SVGeneratorState();
Expand Down
5 changes: 2 additions & 3 deletions confapp/lib/hcl/view/screen/sidebar_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ class ComponentsSidebar extends StatefulWidget {
final Function(void) updateForm;

const ComponentsSidebar({
Key? key,
super.key,
required SidebarXController controller,
required this.updateForm,
}) : _controller = controller,
super(key: key);
}) : _controller = controller;

final SidebarXController _controller;

Expand Down
4 changes: 2 additions & 2 deletions confapp/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
sidebarx: ^0.16.0
flutter_bloc: ^8.1.3
bloc: ^8.1.2
google_fonts: ^6.0.0
google_fonts: 6.1.0

dependency_overrides:
rohd_hcl:
Expand All @@ -30,7 +30,7 @@ dev_dependencies:
sdk: flutter
test: ^1.20.0

flutter_lints: ^2.0.0
flutter_lints: ^3.0.1

flutter:
uses-material-design: true
2 changes: 1 addition & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Some in-development items will have opened issues, as well. Feel free to create
- Sort
- [Bitonic sort](./components/sort.md#bitonic-sort)
- Arithmetic
- Prefix Trees
- [Prefix Trees](./components/parallel_prefix_operations.md)
- [Adders](./components/adder.md)
- Subtractors
- Multipliers
Expand Down
47 changes: 40 additions & 7 deletions doc/components/parallel_prefix_operations.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
# 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.
Parallel prefix or 'scan' trees are useful for efficient
implementation of computations which involve associative
operators. They are used in computations like encoding, or-reduction,
and addition. By leveraging advanced programming idioms, like
functors, allowing for passing of function that generates prefix trees
into an scan-based generator for that computation, we can have a wide
variety of that computation supported by our component library. For
example, we have tree patterns defined by ripple, Sklanksy,
Kogge-Stone, and Brent-Kung which gives us those four varieties of
prefix reduction trees we can use across addition, or-reduction, and
priority encoding.

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>.
ROHD HCL implements a set of parallel prefix compute operations using
different parallel prefix computation trees based on the
['ParallelPrefix'](https://intel.github.io/rohd-hcl/rohd_hcl/ParallelPrefix-class.html)
node class.

Each of these operations can be implemented with different ['ParallelPrefix'] types:
For example, we have unary operations like a word-level 'or'
[`ParallelPrefixOrScan`](https://intel.github.io/rohd-hcl/rohd_hcl/ParallelPrefixOrScan-class.html)
class, and a priority encoder
[`ParallelPrefixPriorityEncoder`](https://intel.github.io/rohd-hcl/rohd_hcl/ParallelPrefixPriorityEncoder-class.html)
class which computes the position of the first bit set to '1'. We have
simple unary arithmetic operations like an increment
[`ParallelPrefixIncr`](https://intel.github.io/rohd-hcl/rohd_hcl/ParallelPrefixIncr-class.html)
class, and a decrement
[`ParallelPrefixDecr`](https://intel.github.io/rohd-hcl/rohd_hcl/ParallelPrefixDecr-class.html)
class. Finally, we have a binary adder
[`ParallelPrefixAdder`](https://intel.github.io/rohd-hcl/rohd_hcl/ParallelPrefixAdder-class.html)
class. For background on basic parallel prefix adder structures, see
<https://en.wikipedia.org/wiki/Kogge%E2%80%93Stone_adder>. In this
case, the prefix trees are carrying two-bit words at each node.

- ['Ripple']
- ['Sklansky]
- ['KoggeStone']
- ['BrentKung]
Each of these operations can be implemented with different
['ParallelPrefix'](https://intel.github.io/rohd-hcl/rohd_hcl/ParallelPrefix-class.html)
types:

- ['Ripple'](https://intel.github.io/rohd-hcl/rohd_hcl/Ripple-class.html)
- ['Sklansky](https://intel.github.io/rohd-hcl/rohd_hcl/Sklansky-class.html)
- ['KoggeStone'](https://intel.github.io/rohd-hcl/rohd_hcl/KoggeStone-class.html)
- ['BrentKung](https://intel.github.io/rohd-hcl/rohd_hcl/BrentKung-class.html)

Here is an example adder schematic:
[ParallelPrefixAdder Schematic](https://intel.github.io/rohd-hcl/ParallelPrefixAdder.html)
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class ParallelPrefixAdderConfigurator extends Configurator {

/// Controls the type of [ParallelPrefix] tree used in the adder.
final prefixTreeKnob =
ChoiceConfigKnob(generatorMap.keys.toList(), value: BrentKung);
ChoiceConfigKnob(generatorMap.keys.toList(), value: KoggeStone);

/// Controls the width of the data.!
final IntConfigKnob dataWidthKnob = IntConfigKnob(value: 8);
final IntConfigKnob dataWidthKnob = IntConfigKnob(value: 4);

@override
Module createModule() => ParallelPrefixAdder(
Expand Down

0 comments on commit b593ec6

Please sign in to comment.