-
Notifications
You must be signed in to change notification settings - Fork 214
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
Wrong formatting of constraints blocks #445
Comments
b/168312418 |
Can I assign this to myself? |
Yes, thank you for volunteering! Tips: examine Feel free to ask any questions to help get you going. |
@vasantteja Checking in, need any help or have any questions? |
$ verible-verilog-format --version v0.0-620-gb46d580 Commit 2020-09-22 Built 2020-09-22T16:35:05Z Invocation: $ verible-verilog-format --formal_parameters_indentation=indent --named_parameter_indentation=indent --named_port_indentation=indent --port_declarations_indentation=indent --inplace ${filename}
@vasantteja Checking in, need any help or have any questions? |
@fangism sorry, I was traveling and I couldn't take a look at this. I will reach out to you if I have any doubts. Thanks for the patience. |
Hi @msfschaffner, For example I've found in an Ibex source code such line:
and I'm not sure how to procceed. Current PR expands all blocks except some simple one like that above: |
Hey @ldalek-antmicro, How about we standardize on something that only expands if the expression inside the outermost |
Thanks for an answer @msfschaffner Got one more question about multi item constraints like:
should them be fitted in one line (like you wrote above) or expanded (IMHO looks better expanded)? |
Yes, this also looks better to me in expanded form. How about we only compact onto one line if the conditions mentioned above hold, AND the brackets only contain one expression? |
Okay, to sum up:
|
Yes this SGTM! |
Expands constraints blocks with more than one partition, e.g. if-statements ``` constraint xx { if (a) b; } ``` But keeps constraints blocks with simple statements unexpanded, e.g. ``` constraint only_vec_instr_c {soft only_vec_instr == 0;} ``` Fixes #445
How will this get formatted? constraint foo_c {
foo inside {[0:1]};
} Looks like the formatter will ignore this? |
That would fit in one line so would be formatted compactly:
|
@sriyerg Expression inside constraint block doesn't have to be a conditional to force expansion of such block. |
Hm... I believe the question is how rule 1. should be interpreted. Should the expansion trigger on the conditional, or on the It looks like conditionals with If that is the case, shall we change that rule to only expand on conditional |
My preference TBH is to always expand constraints - i.e. put the expressions on a separate lines. It is the most consistent solution.
If the |
Verible erroneously reformats the following blocks into one-liners.
before:
after:
The text was updated successfully, but these errors were encountered: