-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parallel prefix operations #51
Changes from all commits
10ba13d
3eb2576
300b118
c7c617f
1f79ee9
e29402f
9984f8a
e947354
be6fb15
f9b65b8
0941a1a
50d9898
51905db
f3dfe50
bf3eb49
8bc8ee0
1e2e42b
b4d0297
155ae9b
6d91fae
b78aba6
492d6e8
6c51f4d
d6e0700
bd93c4c
8c18efc
06e1a6f
ab25690
2fce1ec
675e028
fbe11ae
6696b3c
7c7d888
90eaede
38f01a8
aabbbac
2a2993d
60a8878
55c6d61
6d7082d
de2f6e6
2e7e435
1423819
0c26868
6eb11ff
5a0b1b0
78e2c8f
529a9d5
7e6fd8a
6601e6b
4bbe8a8
171bdbc
659037e
b198e3c
837712a
8065052
9d335e0
ddce8ed
c71c351
7f73322
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,21 @@ Here is an example of a recommended file header template: | |
// Author: Max Korbel <[email protected]> | ||
``` | ||
|
||
#### Adding a New Component | ||
|
||
To add a new component to the library, you can follow the steps below, referencing other components as examples. | ||
|
||
1. Create the dart code for constructing the module in `lib/src`. | ||
1. Create unit tests in `test/`. | ||
1. Create a `Configurator` for the component (enabling things like schematic generation, web-app generation, etc.). | ||
1. Create a new config in `lib/src/component_config/commponents`. | ||
1. Update the component registry in `lib/src/component_config/components/component_registry.dart`. | ||
1. Add documentation to `doc/components/name.md`. | ||
|
||
If you would like to generate and view schematics locally, you'll need to have access to some tools. You can either use the dev container (via Codespaces or VS Code) or install the software from `tool/gh_actions/install_opencadsuite.sh` and `tool/gh_actions/install_d3_hwschematic.sh`. Then you can just run `tool/gh_actions/create_htmls.sh`, which will generate component schematic HTML documents in the `build/` directory. | ||
|
||
The `confapp/` directory contains the source code for the Flutter configuration app, if you would like to run that locally. | ||
|
||
### Creating a New Package | ||
|
||
Not every new contribution has to go directly into the ROHD or ROHD-HCL frameworks! If you have an idea for a reusable piece of hardware, tooling, verification collateral, or anything else that helps the ROHD ecosystem but is somewhat standalone, you can make your own package that depends on ROHD. Building an ecosystem of reusable components is important to the success of ROHD. Reach out if you want some help or guidance deciding if or how you should create a new package. | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# 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: | ||
|
||
desmonddak marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- ['Ripple'](https://intel.github.io/rohd-hcl/rohd_hcl/Ripple-class.html) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're still hitting that link issue I guess since the links don't exist at the time of the PR. You could just ditch links that don't (yet) exist and list them as available types rather than link to them? Or we could just make this PR the one that disables link checking in markdown files? |
||
- ['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) | ||
|
||
[PPAdder_BrentKung Schematic](https://intel.github.io/rohd-hcl/PPAdder_BrentKung.html) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,16 +10,15 @@ | |
// 2023 May 09 | ||
// Author: Desmond Kirkpatrick <[email protected]> | ||
|
||
import 'arbiter_gen.dart'; | ||
import 'fifo_gen.dart'; | ||
import 'one_hot_gen.dart'; | ||
import 'rf_gen.dart'; | ||
import 'rotate_gen.dart'; | ||
import 'dart:io'; | ||
|
||
import 'package:rohd_hcl/src/component_config/components/component_registry.dart'; | ||
|
||
void main() async { | ||
await arbiterGen(); | ||
await fifoGen(); | ||
await oneHotGen(); | ||
await rfGen(); | ||
await rotateGen(); | ||
Directory('build').createSync(recursive: true); | ||
for (final configurator in componentRegistry) { | ||
final sv = await configurator.generateSV(); | ||
final name = configurator.createModule().definitionName; | ||
File('build/$name.v').writeAsStringSync(sv); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// one_hot_gen.dart | ||
// Generate one_hot codecs. | ||
// | ||
// 2023 Oct 02 | ||
// Author: Desmond Kirkpatrick <[email protected]> | ||
|
||
import 'dart:io'; | ||
import 'package:rohd/rohd.dart'; | ||
import 'package:rohd_hcl/src/parallel_prefix_operations.dart'; | ||
|
||
Future<void> parallelPrefixGen() async { | ||
const n = 8; | ||
final a = Logic(name: 'a', width: n); | ||
final b = Logic(name: 'b', width: n); | ||
|
||
final generators = [Ripple.new, Sklansky.new, KoggeStone.new, BrentKung.new]; | ||
final names = ['Ripple', 'Sklansky', 'KoggeStone', 'BrentKung']; | ||
var i = 0; | ||
for (final ppGen in generators) { | ||
final m1 = ParallelPrefixAdder(a, b, ppGen); | ||
await m1.build(); | ||
File('build/${m1.definitionName}_${names[i]}.v').writeAsStringSync(m1 | ||
.generateSynth() | ||
.replaceAll(m1.definitionName, '${m1.definitionName}_${names[i]}')); | ||
final m2 = ParallelPrefixPriorityEncoder(a, ppGen); | ||
await m2.build(); | ||
File('build/${m2.definitionName}_${names[i]}.v').writeAsStringSync(m2 | ||
.generateSynth() | ||
.replaceAll(m2.definitionName, '${m2.definitionName}_${names[i]}')); | ||
i = i + 1; | ||
} | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird that this (and some other) files are showing up as a diff from
main
. If you just do a merge or rebase withmain
does this go away?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The merge failed so it required manual changes. The PR is quite stale, so there are more and more conflicts.
Some files were moved in main (e.g. one_hot.dart), so I removed them from this branch.
We should go through a list of changed files before final merge and make sure this branch is not changing files we do not expect.