-
Notifications
You must be signed in to change notification settings - Fork 89
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
[BUG] macros breaking indentation #231
Comments
I sometimes feel that certain SystemVerilog features were developed by JavaScript engineers... |
The same if I do `uvm_analysis_imp_decl(_w)
class xxx;
endclass |
UVM is also done by JavaScript engineers 😝 |
Hey, I don't think it has to do with the semicolon inside constraints block, that seems to work OK. Some examples Removing macro, using constraint block per correct SV syntax works OK class my_class;
int my_var;
constraint reg_addr_c {
my_var == 2;
}
function new();
endfunction
endclass You can also try not including the semicolon, or including it after the brace (even though it doesn't compile, just to test the vim plugin) and indentation works OK. The problem happens when you have the macro inside the block |
I've copied that into an empty file and could not reproduce, it worked OK |
Oops, sorry. My bad, it turns about there is a `ifndef XXX
`define XXX
`uvm_analysis_imp_decl(_w) |
It's always a good day when what we thought was a bug in fact isn't! |
No, don't close, what I reported initially is a bug. What isn't, is what @ThunderMikey reported. |
Using macro inside constraints, is working fine. You code is working. Check this link and run the code https://edaplayground.com/x/MHuL |
@puliget Of course macros work inside constraints, who said they didn't? I'm reporting that this particular VIM indentation file does not handle well indentation for those cases. The document you linked is part of the verilog 2001 standard, which has no constraints in it... I don't get your point |
class my_class; rand int my_var;
endclass module tb; initial begin |
It is working, check once link :https://edaplayground.com/x/MHuL |
@puliget again, I agree on macros inside constraints being valid systemverilog constructs, I never said contrary. In fact, I opened this issue because I was making use of the feature. The bug is reported for a VIM syntax file, you are not getting the point. How can the problem be reproduced in eda playground if it is specific to the VIM editor? |
Eda playground for code editing and runing.many tools are available in eda playground for run codes . I use the mentor questa to run my code in eda playground and i shared that link to you. Vim editor is used for coding editing.on which tool,you are running the code .. |
Never learn , based on tools. Learn based on the syntax only. |
@puliget you really are not understanding the issue here |
@miguel9554 could I kindly ask you to take a test run of indent/skip_bracket_blocks branch? |
@miguel9554 Any updates? |
When using macros inside other syntax elements with their own indenting (module instantiation, fucntions, contraints etc) the indentation is broken, see following example
The
function
declaration should be at the level of constraint again, but it is at the level of the macro block.The text was updated successfully, but these errors were encountered: