From b593ec63966934398425490a2eb38aacefdb305d Mon Sep 17 00:00:00 2001 From: Desmond Kirkpatrick Date: Thu, 21 Mar 2024 08:31:04 -0700 Subject: [PATCH] parallel prefix documentation updates (#82) * 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 --- .../lib/hcl/view/screen/content_widget.dart | 4 +- .../lib/hcl/view/screen/sidebar_widget.dart | 5 +- confapp/pubspec.yaml | 4 +- doc/README.md | 2 +- doc/components/parallel_prefix_operations.md | 47 ++++++++++++++++--- .../config_parallel_prefix_adder.dart | 4 +- 6 files changed, 49 insertions(+), 17 deletions(-) diff --git a/confapp/lib/hcl/view/screen/content_widget.dart b/confapp/lib/hcl/view/screen/content_widget.dart index de283732c..69e6d2b99 100644 --- a/confapp/lib/hcl/view/screen/content_widget.dart +++ b/confapp/lib/hcl/view/screen/content_widget.dart @@ -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(); diff --git a/confapp/lib/hcl/view/screen/sidebar_widget.dart b/confapp/lib/hcl/view/screen/sidebar_widget.dart index bfe5bf97c..135ca160f 100644 --- a/confapp/lib/hcl/view/screen/sidebar_widget.dart +++ b/confapp/lib/hcl/view/screen/sidebar_widget.dart @@ -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; diff --git a/confapp/pubspec.yaml b/confapp/pubspec.yaml index fb477913a..fe9d3fd54 100644 --- a/confapp/pubspec.yaml +++ b/confapp/pubspec.yaml @@ -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: @@ -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 diff --git a/doc/README.md b/doc/README.md index 89473dd84..7533a346f 100644 --- a/doc/README.md +++ b/doc/README.md @@ -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 diff --git a/doc/components/parallel_prefix_operations.md b/doc/components/parallel_prefix_operations.md index 334879d13..2c01f72ac 100644 --- a/doc/components/parallel_prefix_operations.md +++ b/doc/components/parallel_prefix_operations.md @@ -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 . +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 +. 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) diff --git a/lib/src/component_config/components/config_parallel_prefix_adder.dart b/lib/src/component_config/components/config_parallel_prefix_adder.dart index 97fa4f78c..193072078 100644 --- a/lib/src/component_config/components/config_parallel_prefix_adder.dart +++ b/lib/src/component_config/components/config_parallel_prefix_adder.dart @@ -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(