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

prevent merging single-line statements without begin/end onto the same line of if/else #2361

Open
Liuliuliu7 opened this issue Mar 2, 2025 · 0 comments
Labels
formatter Verilog code formatter issues

Comments

@Liuliuliu7
Copy link

Test case

// Input to the formatter, preferably a reduced test case.
        if (test) 
          test_reg <= 1'b1;
        else
          test_reg <= 1'b0;

Include any options or configuration used.
--indentation_spaces=2
--assignment_statement_alignment=align
--case_items_alignment=align --named_port_alignment=align
--port_declarations_alignment=align
--module_net_variable_alignment=align
--wrap_end_else_clauses --line_break_penalty=0
--compact_indexing_and_selections=false
--column_limit=80

Actual output

// This doesn't look right.
        if (test) test_reg <= 1'b1;
        else test_reg <= 1'b0;

Expected or suggested output

// This result would look better from the formatter.
        if (test) 
          test_reg <= 1'b1;
        else
          test_reg <= 1'b0;

I don’t want single-line statements without begin/end to be forcibly merged onto the same line as if/else. Is there an existing option in verible-verilog-format ?

@Liuliuliu7 Liuliuliu7 added the formatter Verilog code formatter issues label Mar 2, 2025
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