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 all 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
13 changes: 10 additions & 3 deletions .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
@@ -1,3 +1,5 @@
# NOTE: Be sure to update .pubignore as well!

# Files and directories created by pub
.dart_tool/
.packages
Expand All @@ -7,12 +9,17 @@ pubspec.lock
build/

# Directory created by dartdoc
doc/api/
doc/api

# Other stuff
tmp*
*.vcd
.vscode/
.vscode/*
confapp/.vscode/*
*tracker.json
*tracker.log

# Exceptions
!.vscode/extensions.json
!.vscode/extensions.json
!confapp/.vscode/extensions.json
!confapp/.vscode/launch.json
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
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.

14 changes: 14 additions & 0 deletions doc/components/parallel_prefix_operations.md
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)
Copy link
Contributor

Choose a reason for hiding this comment

The 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)
19 changes: 9 additions & 10 deletions gen/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
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;
}
}
95 changes: 0 additions & 95 deletions lib/src/one_hot.dart

This file was deleted.

Loading
Loading