Skip to content

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

Description

@mkorbel1

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions