Add src parameter to WireVector, Output, and Register - #512
Conversation
d4d3b26 to
60185e6
Compare
60185e6 to
5c9666c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #512 +/- ##
=============================================
+ Coverage 93.8% 93.8% +0.1%
=============================================
Files 30 30
Lines 7174 7178 +4
=============================================
+ Hits 6724 6729 +5
+ Misses 450 449 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for putting this together! Some questions/comments:
|
Agreed, no need to break backwards compatability
That is fine with me, I was trying to use the naming we already had internally for source, but don't feel strongly. Maybe it makes it more clear they are different to have it be "source".
Agreed, keyword only is fine with me
The const one seems funny, but but it is longer than doing it the "right" way, and catching that style difference actively could make things more confusing because now you have to enumerate which cases are warned in yet another place and the constant might be coming from another variable. Because With regard to the
Originally I liked the uniformity with the other constructors in case I ever want to call them in abstract, but I certainly see how would be confusing for it to be source... yes I think you are right it should be next. |
Summary
srcparameter toWireVector,Output, andRegisterconstructors, allowing wire connections at construction time.WireVectorandOutput,src=xis equivalent towire <<= x.Register,src=xis equivalent toreg.next <<= x.Example
Notes
InputandConstdo not acceptsrc(raisesTypeError).reg = Register(src=reg + 1)are not possible; usereg.next <<= reg + 1for those cases.blockparameter is moved to the last position in all affected constructors for consistency.Test plan
WireVector,Output, andRegistersrcusage, bitwidth inference, coercion, and negative cases