rohd icon indicating copy to clipboard operation
rohd copied to clipboard

`Logic.zeroExtend` should return `this` if `width` is the same as `newWidth`, and `Swizzle` optimization in SV generation

Open mkorbel1 opened this issue 1 year ago • 1 comments

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

mkorbel1 avatar Oct 04 '23 16:10 mkorbel1

Will work on this :)

mjayasim9 avatar Dec 01 '23 23:12 mjayasim9