-
Notifications
You must be signed in to change notification settings - Fork 24
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
[Types] Support wiring Bit and Bits[1] #1070
base: master
Are you sure you want to change the base?
Conversation
Two implementation issues: 1. Should we support wiring T to Array[1, T] in general? Or have this be a Bits/Bit specific feature 2. Is there a way to avoid a circular import in this logic? The naive solution is to have Bit check if the driver is Bits[1], but this clearly requires a circular import. Perhaps we could use some sort of `T.convert_to(other_T)` API?
Codecov Report
@@ Coverage Diff @@
## master #1070 +/- ##
==========================================
+ Coverage 85.31% 85.33% +0.01%
==========================================
Files 144 144
Lines 15162 15178 +16
==========================================
+ Hits 12936 12952 +16
Misses 2226 2226
Continue to review full report at Codecov.
|
I'm still not sure if we really want to support this pattern (our original ideas about type strictness). But if we do, I think we definitely should support all |
@@ -113,11 +110,20 @@ def ite(self, t_branch, f_branch): | |||
|
|||
@debug_wire | |||
def wire(self, o, debug_info): |
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.
btw, why is this not in Digital
? why do we need to override it in 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.
Right now this is just for Bit <-> Bits[1], if we wanted T <-> Array[1, T] then we would move it to Digital.
Perhaps we can investigate other options with the designers to avoid the issue without making this fundamental change. |
Two implementation issues:
a Bits/Bit specific feature
solution is to have Bit check if the driver is Bits[1], but this
clearly requires a circular import. Perhaps we could use some sort
of
T.convert_to(other_T)
API?