Unsigned and Signed#271
Conversation
ab25267 to
58d2fbc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #271 +/- ##
=======================================
Coverage 91.72% 91.72%
=======================================
Files 23 23
Lines 1317 1317
Branches 330 330
=======================================
Hits 1208 1208
Misses 47 47
Partials 62 62 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
58d2fbc to
58074e5
Compare
4454dc3 to
5529b4b
Compare
614a164 to
8bd0455
Compare
3be274a to
3bb9234
Compare
3bb9234 to
a5b17ca
Compare
ktbarrett
left a comment
There was a problem hiding this comment.
The shape looks good.
| for (auto const& bit : other) { | ||
| temp_bit = bit ? 1 : 0; | ||
| value_ = (value_ << 1) | temp_bit; | ||
| } |
There was a problem hiding this comment.
Welp, I guess we should move BitArray over to Bits as well now.
There was a problem hiding this comment.
Wrap BitArray around Bits? A packed Bitarray rework was mentioned in the unsigned signed docs. That is a similar thing?
There was a problem hiding this comment.
Yeah it's similar. Right now the implicit upcast is kind of an expensive operation. If everything was just Bits under the hood, we can just copy/move the Bits object around.
Closes #191.
These are useful for implementing a bunch of features currently found in cocotb's
LogicArray(e.g.from_unsigned,to_unsigned) that we for binding coconext'sDynLogicArrayto Python in a way it can sit in place of cocotb's using the patcher.This just uses
uint64_tandint64_t. We will adaptUInt, andSIntfrom #278 once it's done.