Skip to content

No way to control padding inside or outside of slice brackets #2583

Description

@markusdd

Test case

...
input logic [WIDTH-1:0] data_i,
input logic [3:0] sel_i,
input logic [SOME_PARAM+2:0] wide_o,
...

--port_declarations_alignment=align

Actual output

input logic [     WIDTH-1:0] data_i,
input logic [           3:0] sel_i,
input logic [SOME_PARAM+2:0] wide_o,

This is - in general - fine and might be desired.

Expected or suggested output

We use bigger parameter expressions for some of our stuff and then the padding for slices
that only have numbers can look excessive. Hence it would be good to have an option to request the padding outside or the left bracket:

...
input logic      [WIDTH-1:0] data_i,
input logic            [3:0] sel_i,
input logic [SOME_PARAM+2:0] wide_o,
...

So basically something like --pad-dimensions-outside-of-brackets would be desirable for such cases.

At the same time, it might be sensible to be able to control whether the dimensions should be aligned on the left or on the right bracket as this might differ stylistically as well - I have seen both variants used in the wild.

I searched if something like this had been asked with 'padding' and 'slices' - sorry in case I overlooked an existing issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    formatterVerilog code formatter issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions