-
Notifications
You must be signed in to change notification settings - Fork 88
Add helper function for binary to 1-hot #466
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## development #466 +/- ##
=============================================
+ Coverage 91.9% 91.9% +0.1%
=============================================
Files 24 24
Lines 6413 6417 +4
=============================================
+ Hits 5888 5893 +5
+ Misses 525 524 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Thank you for your contribution! Looks good overall, just some comments on documentation and code readability
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 great, just a couple more minor comments, sorry I didn't catch these the first time :(
pyrtl/helperfuncs.py
Outdated
| required input). Example inputs: ``0b10``, ``0b1000``, ``4``. | ||
| :param max_bitwidth: Optional integer maximum bitwidth for the resulting one-hot WireVector. | ||
| :return: WireVector with the bit position given by the input set to 1 and all other bits | ||
| set to 0 (bit position 0 being the least significant bit). |
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 the alignment is off here, four spaces are needed before set so Sphinx understands that this is a continuation of the :return: above, and not a new paragraph (see generated docs)
Takes an input representing a bit position and returns a WireVector with that bit position set to 1 and the others to 0.
Closes #465