Skip to content
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

Closed
wants to merge 60 commits into from
Closed
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
10ba13d
schematic generation
desmonddak May 10, 2023
3eb2576
no lint on LICENSE file
desmonddak May 10, 2023
300b118
more markdown linting ignore
desmonddak May 10, 2023
c7c617f
try HTML generation in run checks flow
desmonddak May 10, 2023
1f79ee9
path fix
desmonddak May 10, 2023
e29402f
direct path for yosys
desmonddak May 10, 2023
9984f8a
forgot synthesis
desmonddak May 10, 2023
e947354
permission error or apt
desmonddak May 10, 2023
be6fb15
yosys is installed at top of source, not /
desmonddak May 10, 2023
f9b65b8
Use a binary yosys rather than building.
desmonddak May 12, 2023
0941a1a
github submodules
desmonddak May 12, 2023
50d9898
github submodules (untabify)
desmonddak May 12, 2023
51905db
more ignore lint entries
desmonddak May 12, 2023
f3dfe50
remove redundant elkjs
desmonddak May 12, 2023
bf3eb49
forgot directory add
desmonddak May 12, 2023
8bc8ee0
formatting
desmonddak May 13, 2023
1e2e42b
dart cleanup
desmonddak May 13, 2023
b4d0297
Merge pull request #1 from desmonddak/synthesis
desmonddak May 13, 2023
155ae9b
remove empty file
desmonddak May 13, 2023
6d91fae
updated workflow
desmonddak May 13, 2023
b78aba6
migrated schem generation to deploy stage
desmonddak May 13, 2023
492d6e8
Push documentation of api one directory lower
desmonddak May 13, 2023
6c51f4d
need a home dir
desmonddak May 13, 2023
d6e0700
attempt to link schematic
desmonddak May 13, 2023
bd93c4c
htmls need doc area setup
desmonddak May 13, 2023
8c18efc
partition schem support
desmonddak May 13, 2023
06e1a6f
sudo issue
desmonddak May 13, 2023
ab25690
hw schematic not schematic
desmonddak May 13, 2023
2fce1ec
npm typo
desmonddak May 13, 2023
675e028
remove quotes
desmonddak May 13, 2023
fbe11ae
each component gets a schematic
desmonddak May 13, 2023
6696b3c
format complaint
desmonddak May 13, 2023
7c7d888
fix write flushing
desmonddak May 13, 2023
90eaede
add one-hot codec documentation
desmonddak May 13, 2023
38f01a8
quieter generator, fixed onehot doc
desmonddak May 13, 2023
aabbbac
feedback fixes
desmonddak May 16, 2023
2a2993d
redirect links
desmonddak May 17, 2023
60a8878
filename not correct inside file
desmonddak May 17, 2023
55c6d61
line length issue
desmonddak May 17, 2023
6d7082d
no more puts
desmonddak May 17, 2023
de2f6e6
formatting
desmonddak May 17, 2023
2e7e435
merge from intel
desmonddak Oct 1, 2023
1423819
parallel prefix operations
desmonddak Oct 3, 2023
0c26868
doc lint fixes
desmonddak Oct 3, 2023
6eb11ff
doc lint fixes
desmonddak Oct 3, 2023
5a0b1b0
remove links to deployment area for now
desmonddak Oct 3, 2023
78e2c8f
fix bug in verilog generation for PPAdder flavors
desmonddak Oct 3, 2023
529a9d5
Merge branch 'main' of https://github.com/intel/rohd-hcl into prefix-…
desmonddak Oct 3, 2023
7e6fd8a
updated documentation, clearer naming, using Random()
desmonddak Oct 5, 2023
6601e6b
Merge branch 'prefix-tree' of https://github.com/desmonddak/rohd-hcl …
desmonddak Nov 3, 2023
4bbe8a8
doc fixes
desmonddak Feb 2, 2024
171bdbc
Merge branch 'main' of https://github.com/desmonddak/rohd-hcl
desmonddak Feb 2, 2024
659037e
merge conflict fixes
desmonddak Feb 2, 2024
b198e3c
touch file
desmonddak Feb 2, 2024
837712a
merge fixes from prefix-tree
desmonddak Feb 2, 2024
8065052
merge fixes
desmonddak Feb 5, 2024
9d335e0
Merge branch 'desmonddak-prefix-tree2' into desmonddak-prefix-tree
desmonddak Feb 5, 2024
ddce8ed
fix conflicts
desmonddak Feb 5, 2024
c71c351
removed old one_hot.dart
desmonddak Feb 5, 2024
7f73322
reverted to main CONTRIBUTING.md
desmonddak Feb 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Lint Markdown files
uses: DavidAnson/markdownlint-cli2-action@v11
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Copy link
Contributor

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 with main does this go away?

Copy link
Contributor Author

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.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ doc/api/
tmp*
*.vcd
.vscode/
*~

# Exceptions
!.vscode/extensions.json
!.vscode/extensions.json
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,4 @@ Here are some links to help guide you on style as recommended by Dart:
* Design: <https://dart.dev/guides/language/effective-dart/design>

We recommend following these same guidelines for any of your own packages you may create for the ecosystem, as well.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,5 @@ Some examples of component categories include:
- Models

----------------

Copyright (C) 2023 Intel Corporation
SPDX-License-Identifier: BSD-3-Clause
1 change: 0 additions & 1 deletion build/README.md

This file was deleted.

34 changes: 34 additions & 0 deletions conflicts.txt
desmonddak marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From https://github.com/intel/rohd-hcl
* branch main -> FETCH_HEAD
Auto-merging .github/workflows/general.yml
Auto-merging doc/components/arbiter.md
CONFLICT (content): Merge conflict in doc/components/arbiter.md
Auto-merging doc/components/memory.md
CONFLICT (content): Merge conflict in doc/components/memory.md
CONFLICT (modify/delete): doc/fifo.md deleted in 861c4ad955af5ac6f2099eb3e1270fe83f40ac26 and modified in HEAD. Version HEAD of doc/fifo.md left in tree.
Auto-merging gen/arbiter_gen.dart
CONFLICT (add/add): Merge conflict in gen/arbiter_gen.dart
Auto-merging gen/fifo_gen.dart
CONFLICT (add/add): Merge conflict in gen/fifo_gen.dart
Auto-merging gen/generate.dart
CONFLICT (add/add): Merge conflict in gen/generate.dart
Auto-merging gen/one_hot_gen.dart
CONFLICT (add/add): Merge conflict in gen/one_hot_gen.dart
Auto-merging gen/rf_gen.dart
CONFLICT (add/add): Merge conflict in gen/rf_gen.dart
Auto-merging gen/rotate_gen.dart
CONFLICT (add/add): Merge conflict in gen/rotate_gen.dart
Auto-merging test/one_hot_test.dart
Auto-merging tool/converters/verilog_html.sh
CONFLICT (add/add): Merge conflict in tool/converters/verilog_html.sh
Auto-merging tool/converters/verilog_json.sh
CONFLICT (add/add): Merge conflict in tool/converters/verilog_json.sh
Auto-merging tool/gh_actions/install_d3_hwschematic.sh
CONFLICT (add/add): Merge conflict in tool/gh_actions/install_d3_hwschematic.sh
Auto-merging tool/gh_actions/install_opencadsuite.sh
CONFLICT (add/add): Merge conflict in tool/gh_actions/install_opencadsuite.sh
Auto-merging tool/gh_codespaces/run_setup.sh
CONFLICT (content): Merge conflict in tool/gh_codespaces/run_setup.sh
Auto-merging tool/synthesize.sh
CONFLICT (add/add): Merge conflict in tool/synthesize.sh
Automatic merge failed; fix conflicts and then commit the result.
16 changes: 16 additions & 0 deletions doc/components/parallel_prefix_operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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'] tree structures:

desmonddak marked this conversation as resolved.
Show resolved Hide resolved
- ['Ripple']
- ['Sklansky]
- ['KoggeStone']
- ['BrentKung]

[ParallelPrefixAdder (BrentKung) Schematic]

[ParallelPrefixPriorityEncoder (KoggeStone) Schematic]
15 changes: 15 additions & 0 deletions doc/onehot.md
desmonddak marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# One Hot Codecs

ROHD HCL implements a set of one hot encoder and decoders.

For example, we have an encoder [`BinaryToOneHot`](https://intel.github.io/rohd-hcl/rohd_hcl/BinaryToOneHot-class.html) class, and a couple of implementations of decoder classes like [`OneHotToBinary`](https://intel.github.io/rohd-hcl/rohd_hcl/OneHotToBinary-class.html) and a more performant [`TreeBinaryToOneHot`](https://intel.github.io/rohd-hcl/rohd_hcl/TreeOneHotToBinary-class.html).

The encoders take a Logic bitvector, with the constraint that only a single bit is set to '1' and outputs the bit position in binary.

The decoders take a Logic input representing the bit position to be set to '1', and returns a Logic bitvector with that bit position set to '1', and all others set to '0'

[BinaryToOneHot Schematic](https://intel.github.io/rohd-hcl/BinaryToOneHot.html)

[OneHotToBinary Schematic](https://intel.github.io/rohd-hcl/OneHotToBinary.html)

[TreeOneHotToBinary Schematic](https://intel.github.io/rohd-hcl/TreeOneHotToBinary.html)
2 changes: 2 additions & 0 deletions gen/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import 'arbiter_gen.dart';
import 'fifo_gen.dart';
import 'one_hot_gen.dart';
import 'parallel_prefix_operations_gen.dart';
import 'rf_gen.dart';
import 'rotate_gen.dart';

Expand All @@ -22,4 +23,5 @@ void main() async {
await oneHotGen();
await rfGen();
await rotateGen();
await parallelPrefixGen();
}
35 changes: 35 additions & 0 deletions gen/parallel_prefix_operations_gen.dart
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;
}
}
2 changes: 1 addition & 1 deletion lib/src/one_hot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Implementation of one hot codec for Logic
//
// 2023 February 24
// Author: Desmond Kirkpatrick
// Author: Desmond Kirkpatrick <[email protected]>

import 'dart:math';
import 'package:rohd/rohd.dart';
Expand Down
Loading