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
Expected behavior: "end" is indented correctly with "if"
What happens: the "end" is indented to match with "always", when using
the parameter 's' in {s{1'b0}}. If I use the numeric value instead, it
indents correcty.
== The code: ==
module test (input a, input b, output c);
parameter s = 4;
reg [s:0] myreg;
always @(posedge a) begin
if (b) begin
r <= {s{1'b0}};
end // <-- this end will be improperly indented unless
's' is replaced with e.g. 4
end
end
Emacs : GNU Emacs 24.5.1 (x86_64-apple-darwin14.3.0, NS apple-appkit-1347.57)
of 2015-05-27 on alex-mbp.local
Package: verilog-mode v2015-06-26-832636e-vpo
Original Redmine Comment
Author Name: Alex Reed
Original Date: 2018-03-26T20:48:30Z
Yeah, I see this too. Unfortunately, I'm not in a great place to dig in to this (again) in the near term, due to looming tape-out schedules. Some of the indentation code is getting untenable (and I'm probably to blame for some of it!). Parsing a grammar as complex as Verilog/SystemVerilog with regexes is pretty ugly.
Whenever I've looked at this, it becomes a slippery slope. Anything that resolves to an elaboration-time constant should be legal for the replication value. That includes $system() functions, user functions/tasks, fancy macro magic, and other arbitrarily complex statements. Nested {} blocks can be found in multi-dimensional arrays, replication statements, and constraint blocks. Figuring out which is which always ends up breaking one of the other parsers, or killing performance.
The current behavior is definitely wrong, but I don't know how to fix it.
Author Name: Wilson Snyder (@wsnyder)
Original Redmine Issue: 955 from https://www.veripool.org
Reported via email from Alessandro Contreras-Grassi alcontre@terpmail.umd.edu
Please follow up by CCing him.
Expected behavior: "end" is indented correctly with "if"
What happens: the "end" is indented to match with "always", when using
the parameter 's' in {s{1'b0}}. If I use the numeric value instead, it
indents correcty.
== The code: ==
Emacs : GNU Emacs 24.5.1 (x86_64-apple-darwin14.3.0, NS apple-appkit-1347.57)
of 2015-05-27 on alex-mbp.local
Package: verilog-mode v2015-06-26-832636e-vpo
The text was updated successfully, but these errors were encountered: