veripool / verilog-mode

Verilog-Mode for Emacs with Indentation, Hightlighting and AUTOs. Master repository for pushing to GNU, verilog.com and veripool.org.
http://veripool.org/verilog-mode
GNU General Public License v3.0
246 stars 90 forks source link

The regular expression .\(.*\) will result in an error if used alone. #1869

Closed 1371906755 closed 3 months ago

1371906755 commented 3 months ago

for example:

/*test AUTO_TEMPLATE(
.\(\.*\)  (a_\1[]),
);*/
test u_test(
/*AUTOINST*/);
wsnyder commented 3 months ago

You have too many backslashes there. You want:

  /* test AUTO_TEMPLATE (
    .\(.*\)     (\1[]),
    ); */

Full example here: https://github.com/veripool/verilog-mode/blob/master/tests/autoinst_dedefine.v

1371906755 commented 3 months ago

verilog_mode have a error

wsnyder commented 3 months ago

Please attach a complete example as text (not screen shot) and say what the error is.

1371906755 commented 3 months ago
module example
#(
parameter ID_WIDTH     = 6
) 
(/*AUTOINPUT*/ 
/*AUTOOUTPUT*/ 
); 

/*test AUTO_TEMPLATE(
.clk            (clk),
.reset_n        (reset_n),
.\\(.\*\\)         (alloc_\1[]),
);*/

test #(
/*AUTOINSTPARAM*/)u_test(
/*AUTOINST*/);

endmodule

module test
#(
parameter ID_WIDTH     = 6
) 
(
output[ID_WIDTH    -1:0] data_id,
input                   clk,             
input                   reset_n   
);
endmodule
1371906755 commented 3 months ago

This example will result in an error

wsnyder commented 3 months ago

See my example in the answer above. You have too many backslashes.