Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter splits label from assertion on new line unnecessarily #2284

Open
hankhsu1996 opened this issue Oct 18, 2024 · 0 comments
Open

Formatter splits label from assertion on new line unnecessarily #2284

hankhsu1996 opened this issue Oct 18, 2024 · 0 comments
Labels
formatter Verilog code formatter issues

Comments

@hankhsu1996
Copy link

Test case

module add (
    input  logic        clk,
    input  logic        reset,
    input  logic [31:0] a,
    input  logic [31:0] b,
    output logic [31:0] sum,
    output logic        carry
);

  assign {carry, sum} = a + b;

  // If sum < a or sum < b, then carry = 1
  carry_check: assert property (
    @(posedge clk) disable iff (reset)
    (sum < a) |-> carry == 1);

endmodule

Actual output

carry_check :
assert property (@(posedge clk) disable iff (reset) (sum < a) |-> carry == 1);

Expected or suggested output

carry_check: assert property (
    @(posedge clk) disable iff (reset)
    (sum < a) |-> carry == 1);

I would prefer the label and the assertion to remain on the same line, and the assertion body to be formatted over multiple lines for readability. It seems there is currently no option in the formatter to control this behavior.

@hankhsu1996 hankhsu1996 added the formatter Verilog code formatter issues label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Verilog code formatter issues
Projects
None yet
Development

No branches or pull requests

1 participant