[Types] Support wiring Bit and Bits[1]#1070
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.
btw, why is this not in Digital? why do we need to override it in Bit?
There was a problem hiding this comment.
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?