`Logic.zeroExtend` should return `this` if `width` is the same as `newWidth`, and `Swizzle` optimization in SV generation
- Dominant language
- Dart
- Stars
- 489
- Forks
- 88
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 10
Description
### 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 a `Logic` with the `newWidth` equal to the `width`. Note that it creates a `swizzle` 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_
Contributor guide
Assessment
This issue has not been assessed yet.