-
Notifications
You must be signed in to change notification settings - Fork 28
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
Reduction module #180
base: main
Are you sure you want to change the base?
Reduction module #180
Conversation
final Logic Function(List<Logic> inputs, {String name}) _operation; | ||
|
||
/// Specified width of input to each reduction node (e.g., binary: radix=2) | ||
late final int _radix; |
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.
primitive types like int
and bool
, or really any non-hardware-signal/module thing (even Function
s like operation
), especially when they are directly passed from the user, can be just public final
variables with this.radix
type of syntax in the constructor. That's also better for when you reference those variables in documentation comments [radix]
vs [_radix]
Logic? clk, | ||
Logic? enable, | ||
Logic? reset, | ||
super.name = 'reduction_tree'}) | ||
: super(definitionName: 'ReductionTree_R${radix}_L${sequence.length}}') { | ||
if (sequence.isEmpty) { |
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.
does this now support empty sequences?
Description & Motivation
Modified tree reduction to create modules instead of inline assignments.
Related Issue(s)
None
Testing
ran existing tree reduction tests
Backwards-compatibility
No. API and naming match.
Documentation
None required.