-
Notifications
You must be signed in to change notification settings - Fork 33
Implement fixed-point Fast Fourier Transform #207
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
Conversation
Signed-off-by: Ethan Uppal <[email protected]>
Signed-off-by: Ethan Uppal <[email protected]>
Signed-off-by: Ethan Uppal <[email protected]>
Signed-off-by: Ethan Uppal <[email protected]>
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.
Good start!
| @@ -0,0 +1,225 @@ | |||
| // Copyright (C) 2021-2024 Intel Corporation | |||
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.
Try to keep the headers consistent and accurate:
- Make sure you update copyright years
- Most files should have some header describing what the file is, and you can put your name as the author for files you create if you wish
See other files or CONTRIBUTING.md for examples
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.
When you add new components/files that should be publicly visible, make sure to export them (e.g. see lib/src/arithmetic/signals/signals.dart, or the appropriate one per-file)
| } | ||
|
|
||
| Logic _realPart() => | ||
| getRange(0, _fixedPointWidth(signed, integerBits, fractionalBits)); |
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.
Conceptually, the getRange function creates a new module which extracts the requested bits from the original signal and produces an output that results from that operation. Assigning to that output (as you did in some functions above) doesn't make sense and you'll (hopefully) get an error or at least X.
I think a more convenient way to structure a grouping of two FixedPoints would be to create a LogicStructure which contains two FixedPoints as elements. Then they can be individually referenced, assigned, etc. without needing to extract bits each time or manage widths yourself.
| class ComplexFixedPoint extends Logic { | ||
| final bool signed; | ||
|
|
||
| final int integerBits; |
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.
for consistency (including with #208), better might be to call *Width
|
|
||
| // mux(this[-1], mux(other[-1], ), mux()) | ||
|
|
||
| FixedPoint.of(sum, signed: signed, m: m + 1, n: n); |
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.
looks incomplete?
| import 'package:rohd/rohd.dart'; | ||
| import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
|
||
| @immutable |
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.
i think you'll want to implement == and hashCode as well
| import 'package:rohd/rohd.dart'; | ||
| import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
|
||
| int bitReverse(int value, int bits) { |
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.
you could make this private (_bitReverse) if this isn't something we want to expose in the library. Alternatively, you could use LogicValue's reversed to do the work (which also then would cover values >64 bits as well)
|
Closing in favor of a fully-pipelined floating-point implementation (#210). |
Description & Motivation
I made this at the start of my Intel internship to learn about ROHD components. I have been polishing it up afterward to turn it into a PR.
I added:
LogicArraysRelated Issue(s)
Testing
Backwards-compatibility
Documentation