rohd
rohd copied to clipboard
`Logic.zeroExtend` should return `this` if `width` is the same as `newWidth`, and `Swizzle` optimization in SV generation
Describe the bug
When zero-extending a signal, if there's nothing to zero-extend, we can just immediately return this
rather than go through a Swizzle
.
Additionally, when Swizzle
gets only one signal with width >0, it shouldn't still add the {}
around it.
To Reproduce
- Call
zeroExtend
on aLogic
with thenewWidth
equal to thewidth
. Note that it creates aswizzle
unnecessarily. - Swizzle two signals, one of which is 0-width, and observe generated SV to contain
{}
around the one remaining signal.
Expected behavior
No response
Actual behavior
No response
Additional: Dart SDK info
No response
Additional: pubspec.yaml
No response
Additional: Context
No response
Will work on this :)