Skip to content

Commit

Permalink
Fix indentation of coverpoints (#1321) (#1766).
Browse files Browse the repository at this point in the history
* verilog-mode.el (verilog-at-constraint-p): Fix indentation of coverpoints (#1321) (#1766).

Signed-off-by: Gonzalo Larumbe <gonzalomlarumbe@gmail.com>
  • Loading branch information
gmlarumbe committed May 12, 2022
1 parent 252bff3 commit 95df088
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
78 changes: 39 additions & 39 deletions tests_ok/indent_covergroup_swan.v
Expand Up @@ -2,43 +2,43 @@ module m;
bit [0:0] a, b, c;
covergroup g;
cp_ab: coverpoint {a,b} {
bins one = {1};
bins two = {2};
}
cp_ab_if_c: coverpoint {a,b} iff c {
bins one = {1};
bins two = {2};
}
cp_ab_if_c_slice: coverpoint {a,b} iff c[0] {
bins one = {1};
bins two = {2};
}
cp_a_if_bc: coverpoint {a,b} iff {b,c} {
bins one = {1};
bins two = {2};
}
cp_a_slice : coverpoint a[0] {
bins one = {1};
bins two = {2};
}
cp_a_slice_if_b : coverpoint a[0] iff b {
bins one = {1};
bins two = {2};
}
cp_a_if_b_slice : coverpoint a iff b[0] {
bins one = {1};
bins two = {2};
}
cp_a_slice_if_b_slice : coverpoint a[0] iff b[0] {
bins one = {1};
bins two = {2};
}
endgroup
bins one = {1};
bins two = {2};
}

cp_ab_if_c: coverpoint {a,b} iff c {
bins one = {1};
bins two = {2};
}

cp_ab_if_c_slice: coverpoint {a,b} iff c[0] {
bins one = {1};
bins two = {2};
}

cp_a_if_bc: coverpoint {a,b} iff {b,c} {
bins one = {1};
bins two = {2};
}

cp_a_slice : coverpoint a[0] {
bins one = {1};
bins two = {2};
}

cp_a_slice_if_b : coverpoint a[0] iff b {
bins one = {1};
bins two = {2};
}

cp_a_if_b_slice : coverpoint a iff b[0] {
bins one = {1};
bins two = {2};
}

cp_a_slice_if_b_slice : coverpoint a[0] iff b[0] {
bins one = {1};
bins two = {2};
}
endgroup
endmodule
2 changes: 1 addition & 1 deletion verilog-mode.el
Expand Up @@ -6646,7 +6646,7 @@ Also move point to constraint."
))
;; if first word token not keyword, it maybe the instance name
;; check next word token
(if (looking-at "\\<\\w+\\>\\|\\s-*(\\s-*\\S-+")
(if (looking-at "\\<\\w+\\>\\|\\s-*[\[(}]\\s-*\\S-+")
(progn (verilog-beg-of-statement)
(if (and
(not (string-match verilog-named-block-re (buffer-substring pt (point)))) ;; Abort if 'begin' keyword is found
Expand Down

0 comments on commit 95df088

Please sign in to comment.