You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm struggling with indentation again and feel like I've been here before but haven't managed to find anything that works. All the examples and similar issues all point at using verilog-typedef-regexp but I haven't managed to get it to work yet. I do recall that on previous issues where this didn't work, I realised I had to set it in the child module for AUTO's to work, but in this case I've tried pretty much every permutation and it still fails.
As an example, how do I get my_special_t to be indented correctly?
packagetest_pkg;
typedef enumlogic{
StateOne =1'b0,
StateTwo =1'b1}my_special_t;
endpackagemoduletestimport test_pkg::*;
#(
parameter int TestParam =1
)(
inputlogic clk,
inputlogic rst_n,
inputmy_special_t special
);
endmodule// Local Variables:// verilog-library-directories:(".")// verilog-typedef-regexp:"_t$"// End:
The text was updated successfully, but these errors were encountered:
@wsnyder might help me out here, but I think that the variable verilog-typedef-regexp is only used for AUTOs.
For indentation/alignment you have two options:
Set the value of verilog-align-typedef-regexp to the Elisp regexp of your typedefs. E.g:
;; For typedefs that end with *_t:
(setq verilog-align-typedef-regexp (concat"\\<" verilog-identifier-re "_\\(t\\)\\>"))
;; For typedefs that end with *_t, *_if or *_vif:
(setq verilog-align-typedef-regexp (concat"\\<" verilog-identifier-re "_\\(t\\|if\\|vif\\)\\>"))
Set the value of verilog-align-typedef-words to a list of strings that should be considered as typedefs. E.g:
;; For this issue snippet:
(setq verilog-align-typedef-words '("my_special_t"))
;; Multiple typedefs:
(setq verilog-align-typedef-words '("my_typedef_1""my_typedef_2""my_typedef_3"))
Running verilog-pretty-declarations on the line input my_special_t special should align it correctly. However, the second method is not recommended if you need to add many words since it will slow down your Emacs session on files under verilog-mode.
If you want to also fontify/syntax highlight the typedefs set by previous two variables you can have a look at the verilog-ext package.
I'm struggling with indentation again and feel like I've been here before but haven't managed to find anything that works. All the examples and similar issues all point at using
verilog-typedef-regexp
but I haven't managed to get it to work yet. I do recall that on previous issues where this didn't work, I realised I had to set it in the child module for AUTO's to work, but in this case I've tried pretty much every permutation and it still fails.As an example, how do I get
my_special_t
to be indented correctly?The text was updated successfully, but these errors were encountered: