Skip to content

Commit 59930a0

Browse files
committed
Fix error detection of Cadence HAL.
* verilog-mode.el (verilog-error-font-lock-keywords, verilog-error-regexp-emacs-alist, verilog-error-regexp-xemacs-alist): Fix error detection of Cadence HAL, reported by David Asher. Repair drift between the three similar error variables. git-svn-id: file:///verilog-mode-svn/trunk@606 db5bb42b-8904-0410-88e9-aa7026cf2ec3
1 parent c4ab916 commit 59930a0

File tree

4 files changed

+72
-82
lines changed

4 files changed

+72
-82
lines changed

Makefile

+2-16
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,8 @@ $(eval $(call test_xemacs_sub,test_xemacs_5,5of5))
5959
test_errors:
6060
@echo
6161
@echo == test_errors
62-
@echo emit a bunch of error messages that Emacs should
63-
@echo "recognize if you type C-x \` and take you to the correct line of error_file.v"
64-
@echo "Warning: code located there (error_file.v line 9) is dangerous"
65-
@echo "(W1800) error_file.v 21: Problems"
66-
@echo "f*E,1364 (error_file.v,2) Issues"
67-
@echo "Error: code located here (error_file.v line 8) is fatal"
68-
@echo "ERROR : error_file.v, line 1: erroneous"
69-
@echo "INFO : error_file.v, line 7: informational"
70-
@echo "WARNING : error_file.v, line 6: curious"
71-
@echo "In file error_file.v line 5:"
72-
@echo "a"
73-
@echo "b"
74-
@echo "Failure was obsevred"
75-
@echo la di da
76-
@echo syntax error: problems
77-
@echo error_file.v 7: here is where they are
62+
-# The multiline errors must be in one read()s output or the comint may not match it
63+
-cat error_msgs.out
7864

7965
test_batch: e/verilog-mode.elc
8066
@echo == test_batch

error_file.v

+3-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
39;
4040
40;
4141

42-
43-
44-
45-
42+
// Local Variables:
43+
// compile-command: "make test_errors "
44+
// End:

error_msgs.out

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
A bunch of error messages that Emacs should
2+
recognize if you type C-x ` and take you to the correct line of error_file.v
3+
Note the 'gnu' compilation-error-regexp-alist in messes some up - to be fixed.
4+
(setq compilation-error-regexp-alist (delete 'gnu compilation-error-regexp-alist))
5+
6+
Warning: code located there (error_file.v line 9) is dangerous
7+
(W1800) error_file.v 21: Problems
8+
f*E,1364 (error_file.v,2) Issues
9+
Error: code located here (error_file.v line 8) is fatal
10+
ERROR : error_file.v, line 1: erroneous
11+
INFO : error_file.v, line 7: informational
12+
WARNING : error_file.v, line 6: curious
13+
nctool: *E,UNDIDN (error_file.v,11|22): 'zz': the message [12.5(IEEE)].
14+
nctool: *W,TRUNCZ (error_file.v,14|0): a W message.
15+
nctool: *W,URDREG[CN_ABSTR] (error_file.v,15|0): another W message in 'foo'.
16+
Verilog-Perl: %Error: error_file.v:16: Some message from Verilog-Perl etc.
17+
Verilog-Perl: %Warning: ./error_file.v:17: Some message from Verilog-Perl etc.
18+
%Warning: ./error_file.v:17: Some message from Verilator etc.
19+
# This must be in one echo, or the comint may not match it
20+
In file error_file.v line 5:
21+
a
22+
b
23+
Failure was obsevred
24+
la di da
25+
syntax error: problems
26+
error_file.v 7: here is where they are
27+
28+
// Local Variables:
29+
// compile-command: "make test_errors "
30+
// End:

verilog-mode.el

+37-62
Original file line numberDiff line numberDiff line change
@@ -644,17 +644,15 @@ always be saved."
644644
;;; Compile support
645645
(require 'compile)
646646
(defvar verilog-error-regexp-added nil)
647-
; List of regexps for Verilog compilers, like verilint. See compilation-error-regexp-alist
648-
; for the formatting.
649-
; Here is the version for Emacs 22:
647+
650648
(defvar verilog-error-regexp-emacs-alist
651649
'(
652650
(verilog-xl-1
653651
"\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 3)
654652
(verilog-xl-2
655653
"([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\(line[ \t]+\\)?\\([0-9]+\\):.*$" 1 3)
656654
(verilog-IES
657-
".*\\*[WE],[0-9A-Z]+ (\\([^ \t,]+\\),\\([0-9]+\\)" 1 2)
655+
".*\\*[WE],[0-9A-Z]+\\(\[[0-9A-Z_,]+\]\\)? (\\([^ \t,]+\\),\\([0-9]+\\)" 2 3)
658656
(verilog-surefire-1
659657
"[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 1 2)
660658
(verilog-surefire-2
@@ -676,87 +674,64 @@ always be saved."
676674
(verilog-verilator
677675
"%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 4)
678676
(verilog-leda
679-
"In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):
680-
.*
681-
.*
682-
.*
683-
\\(Warning\\|Error\\|Failure\\)" 1 2)
684-
))
685-
;; And the version for XEmacs:
686-
(defvar verilog-error-regexp-xemacs-alist
687-
'(verilog
688-
("[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 1 2)
689-
("\\(WARNING\\|ERROR\\|INFO\\)[^:]*: \\([^,]+\\),\\s-+\\(line \\)?\\([0-9]+\\):" 2 4 )
690-
("\
691-
\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\
692-
:\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 2 5)
693-
; xsim
694-
; Error! in file /homes/mac/Axis/Xsim/test.v at line 13 [OBJ_NOT_DECLARED]
695-
("\\(Error\\|Warning\\).*in file (\\([^ \t]+\\) at line *\\([0-9]+\\))" 2 3)
696-
; vcs
697-
("\\(Error\\|Warning\\):[^(]*(\\([^ \t]+\\) line *\\([0-9]+\\))" 2 3)
698-
("Warning:.*(port.*(\\([^ \t]+\\) line \\([0-9]+\\))" 1 2)
699-
("\\(Error\\|Warning\\):[\n.]*\\([^ \t]+\\) *\\([0-9]+\\):" 2 3)
700-
("syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 1 2)
701-
; Verilator
702-
("%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 4)
703-
; verilog-xl
704-
("\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 3)
705-
("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\([0-9]+\\):.*$" 1 2) ; vxl
706-
("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+line[ \t]+\\([0-9]+\\):.*$" 1 2)
707-
; nc-verilog
708-
(".*\\*[WE],[0-9A-Z]+ (\\([^ \t,]+\\),\\([0-9]+\\)|" 1 2)
709-
; Leda
710-
("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 2)
677+
"^In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\(Warning\\|Error\\|Failure\\)[^\n]*" 1 2)
711678
)
712-
)
679+
"List of regexps for Verilog compilers.
680+
See `compilation-error-regexp-alist' for the formatting. For Emacs 22+.")
681+
682+
(defvar verilog-error-regexp-xemacs-alist
683+
;; Emacs form is '((v-tool "re" 1 2) ...)
684+
;; XEmacs form is '(verilog ("re" 1 2) ...)
685+
;; So we can just map from Emacs to Xemacs
686+
(list 'verilog (mapcar 'cdr verilog-error-regexp-emacs-alist))
687+
"List of regexps for Verilog compilers.
688+
See `compilation-error-regexp-alist' for the formatting. For XEmacs.")
713689

714690
(defvar verilog-error-font-lock-keywords
715691
'(
692+
;; verilog-xl-1
693+
("\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 bold t)
694+
("\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 bold t)
695+
;; verilog-xl-2
696+
("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\(line[ \t]+\\)?\\([0-9]+\\):.*$" 1 bold t)
697+
("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\(line[ \t]+\\)?\\([0-9]+\\):.*$" 3 bold t)
698+
;; verilog-IES (nc-verilog)
699+
(".*\\*[WE],[0-9A-Z]+\\(\[[0-9A-Z_,]+\]\\)? (\\([^ \t,]+\\),\\([0-9]+\\)|" 2 bold t)
700+
(".*\\*[WE],[0-9A-Z]+\\(\[[0-9A-Z_,]+\]\\)? (\\([^ \t,]+\\),\\([0-9]+\\)|" 3 bold t)
701+
;; verilog-surefire-1
716702
("[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 1 bold t)
717703
("[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 2 bold t)
718-
704+
;; verilog-surefire-2
719705
("\\(WARNING\\|ERROR\\|INFO\\): \\([^,]+\\), line \\([0-9]+\\):" 2 bold t)
720706
("\\(WARNING\\|ERROR\\|INFO\\): \\([^,]+\\), line \\([0-9]+\\):" 3 bold t)
721-
707+
;; verilog-verbose
722708
("\
723709
\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\
724710
:\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 bold t)
725711
("\
726712
\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\
727713
:\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 bold t)
728-
714+
;; verilog-vcs-1
729715
("\\(Error\\|Warning\\):[^(]*(\\([^ \t]+\\) line *\\([0-9]+\\))" 2 bold t)
730716
("\\(Error\\|Warning\\):[^(]*(\\([^ \t]+\\) line *\\([0-9]+\\))" 3 bold t)
731-
732-
("%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 bold t)
733-
("%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 4 bold t)
734-
717+
;; verilog-vcs-2
735718
("Warning:.*(port.*(\\([^ \t]+\\) line \\([0-9]+\\))" 1 bold t)
736719
("Warning:.*(port.*(\\([^ \t]+\\) line \\([0-9]+\\))" 1 bold t)
737-
720+
;; verilog-vcs-3
738721
("\\(Error\\|Warning\\):[\n.]*\\([^ \t]+\\) *\\([0-9]+\\):" 2 bold t)
739722
("\\(Error\\|Warning\\):[\n.]*\\([^ \t]+\\) *\\([0-9]+\\):" 3 bold t)
740-
723+
;; verilog-vcs-4
741724
("syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 1 bold t)
742725
("syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 2 bold t)
743-
; vxl
744-
("\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 bold t)
745-
("\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 bold t)
746-
747-
("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\([0-9]+\\):.*$" 1 bold t)
748-
("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\([0-9]+\\):.*$" 2 bold t)
749-
750-
("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+line[ \t]+\\([0-9]+\\):.*$" 1 bold t)
751-
("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+line[ \t]+\\([0-9]+\\):.*$" 2 bold t)
752-
; nc-verilog
753-
(".*[WE],[0-9A-Z]+ (\\([^ \t,]+\\),\\([0-9]+\\)|" 1 bold t)
754-
(".*[WE],[0-9A-Z]+ (\\([^ \t,]+\\),\\([0-9]+\\)|" 2 bold t)
755-
; Leda
756-
("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 bold t)
757-
("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 2 bold t)
726+
;; verilog-verilator
727+
(".*%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 bold t)
728+
(".*%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 4 bold t)
729+
;; verilog-leda
730+
("^In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\(Warning\\|Error\\|Failure\\)[^\n]*" 1 bold t)
731+
("^In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\(Warning\\|Error\\|Failure\\)[^\n]*" 2 bold t)
758732
)
759-
"*Keywords to also highlight in Verilog *compilation* buffers.")
733+
"*Keywords to also highlight in Verilog *compilation* buffers.
734+
Only used in XEmacs; GNU Emacs uses `verilog-error-regexp-emacs-alist'.")
760735

761736
(defcustom verilog-library-flags '("")
762737
"*List of standard Verilog arguments to use for /*AUTOINST*/.

0 commit comments

Comments
 (0)