aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReto Zimmermann2013-05-16 00:56:46 -0700
committerGlenn Morris2013-05-16 00:56:46 -0700
commit6b9c2d852bfcd68114b8050d008c918ed75fddbd (patch)
tree75ab5472efbdbdb75504e0844e87665ed54ada87
parentcdd0de4b056b4612e055fa15f65af118dafc9b18 (diff)
downloademacs-6b9c2d852bfcd68114b8050d008c918ed75fddbd.tar.gz
emacs-6b9c2d852bfcd68114b8050d008c918ed75fddbd.zip
Sync with upstream vhdl mode v3.34.2.
* lisp/progmodes/vhdl-mode.el: Use `push' throughout. (vhdl-version, vhdl-time-stamp, vhdl-doc-release-notes): Update. (vhdl-compiler-alist): Replace "\t\n" by "\\t\\n". Add IBM & Quartus compiler. Enhance entry for ADVance MS compiler. (vhdl-actual-generic-name): New option to derive actual generic name. (vhdl-port-paste-signals): Replace formal by actual generics. (vhdl-beautify): New name for old group vhdl-align. Update users. (vhdl-beautify-options): New option. (vhdl-last-input-event): New compat alias. Use throughout. (vhdl-goto-line): Replace user level function `goto-line'. (vhdl-mode-map): Add bindings for vhdl-fix-statement-region, vhdl-fix-statement-buffer. (vhdl-create-mode-menu): Add some entries. (vhdl-align-region-groups): Respect vhdl-beautify-options. (vhdl-align-inline-comment-region-1): Handle "--" inside string. (vhdl-fixup-whitespace-region): Handle symbols at EOL. (vhdl-fix-statement-region, vhdl-fix-statement-buffer): New commands, to force statements on one line. (vhdl-remove-trailing-spaces-region): New, split from vhdl-remove-trailing-spaces. (vhdl-beautify-region): Fix statements, trailing spaces, ^M character. Respect vhdl-beautify-options. (vhdl-update-sensitivity-list-buffer): If non-interactive save buffer. (vhdl-update-sensitivity-list): Not add with index if exists without. Not include array index with signal. Ignore keywords in comments. (vhdl-get-visible-signals): Regexp tweaks. (vhdl-template-component-inst): Handle empty library. (vhdl-template-type): Add template for 'enum' type. (vhdl-port-paste-generic-map, vhdl-port-paste-constants): Use vhdl-replace-string. (vhdl-port-paste-signals): Use vhdl-prepare-search-1. (vhdl-speedbar-mode-map): Rename from vhdl-speedbar-key-map. (vhdl-speedbar-initialize): Update for above name change. (vhdl-compose-wire-components): Fix in handling of constants. (vhdl-error-regexp-emacs-alist): New variable. (vhdl-error-regexp-add-emacs): New function; adds support for new compile.el (Emacs 22+) (vhdl-generate-makefile-1): Change target order for single lib. units. Allow use of absolute file names.
-rw-r--r--lisp/ChangeLog43
-rw-r--r--lisp/progmodes/vhdl-mode.el809
2 files changed, 564 insertions, 288 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0b233385eb7..bb9dc479e94 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,46 @@
12013-05-16 Reto Zimmermann <reto@gnu.org>
2
3 Sync with upstream vhdl mode v3.34.2.
4 * progmodes/vhdl-mode.el: Use `push' throughout.
5 (vhdl-version, vhdl-time-stamp, vhdl-doc-release-notes): Update.
6 (vhdl-compiler-alist): Replace "\t\n" by "\\t\\n".
7 Add IBM & Quartus compiler. Enhance entry for ADVance MS compiler.
8 (vhdl-actual-generic-name): New option to derive actual generic name.
9 (vhdl-port-paste-signals): Replace formal by actual generics.
10 (vhdl-beautify): New name for old group vhdl-align. Update users.
11 (vhdl-beautify-options): New option.
12 (vhdl-last-input-event): New compat alias. Use throughout.
13 (vhdl-goto-line): Replace user level function `goto-line'.
14 (vhdl-mode-map): Add bindings for vhdl-fix-statement-region,
15 vhdl-fix-statement-buffer.
16 (vhdl-create-mode-menu): Add some entries.
17 (vhdl-align-region-groups): Respect vhdl-beautify-options.
18 (vhdl-align-inline-comment-region-1): Handle "--" inside string.
19 (vhdl-fixup-whitespace-region): Handle symbols at EOL.
20 (vhdl-fix-statement-region, vhdl-fix-statement-buffer): New commands,
21 to force statements on one line.
22 (vhdl-remove-trailing-spaces-region):
23 New, split from vhdl-remove-trailing-spaces.
24 (vhdl-beautify-region): Fix statements, trailing spaces, ^M character.
25 Respect vhdl-beautify-options.
26 (vhdl-update-sensitivity-list-buffer): If non-interactive save buffer.
27 (vhdl-update-sensitivity-list): Not add with index if exists without.
28 Not include array index with signal. Ignore keywords in comments.
29 (vhdl-get-visible-signals): Regexp tweaks.
30 (vhdl-template-component-inst): Handle empty library.
31 (vhdl-template-type): Add template for 'enum' type.
32 (vhdl-port-paste-generic-map, vhdl-port-paste-constants):
33 Use vhdl-replace-string.
34 (vhdl-port-paste-signals): Use vhdl-prepare-search-1.
35 (vhdl-speedbar-mode-map): Rename from vhdl-speedbar-key-map.
36 (vhdl-speedbar-initialize): Update for above name change.
37 (vhdl-compose-wire-components): Fix in handling of constants.
38 (vhdl-error-regexp-emacs-alist): New variable.
39 (vhdl-error-regexp-add-emacs): New function;
40 adds support for new compile.el (Emacs 22+)
41 (vhdl-generate-makefile-1): Change target order for single lib. units.
42 Allow use of absolute file names.
43
12013-05-16 Leo Liu <sdl.web@gmail.com> 442013-05-16 Leo Liu <sdl.web@gmail.com>
2 45
3 * simple.el (prog-indent-sexp): Indent enclosing defun. 46 * simple.el (prog-indent-sexp): Indent enclosing defun.
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 4bb388d4405..8b61ae400d2 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -13,10 +13,10 @@
13;; filed in the Emacs bug reporting system against this file, a copy 13;; filed in the Emacs bug reporting system against this file, a copy
14;; of the bug report be sent to the maintainer's email address. 14;; of the bug report be sent to the maintainer's email address.
15 15
16(defconst vhdl-version "3.33.28" 16(defconst vhdl-version "3.34.2"
17 "VHDL Mode version number.") 17 "VHDL Mode version number.")
18 18
19(defconst vhdl-time-stamp "2010-09-22" 19(defconst vhdl-time-stamp "2012-11-21"
20 "VHDL Mode time stamp for last update.") 20 "VHDL Mode time stamp for last update.")
21 21
22;; This file is part of GNU Emacs. 22;; This file is part of GNU Emacs.
@@ -72,8 +72,7 @@
72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
73;; Emacs Versions 73;; Emacs Versions
74 74
75;; supported: GNU Emacs 20.X/21.X/22.X,23.X, XEmacs 20.X/21.X 75;; this updated version was only tested on: GNU Emacs 20.4
76;; tested on: GNU Emacs 20.4/21.3/22.1,23.X, XEmacs 21.1 (marginally)
77 76
78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
79;; Installation 78;; Installation
@@ -84,7 +83,7 @@
84;; or into an arbitrary directory that is added to the load path by the 83;; or into an arbitrary directory that is added to the load path by the
85;; following line in your Emacs start-up file `.emacs': 84;; following line in your Emacs start-up file `.emacs':
86 85
87;; (setq load-path (cons (expand-file-name "<directory-name>") load-path)) 86;; (push (expand-file-name "<directory-name>") load-path)
88 87
89;; If you already have the compiled `vhdl-mode.elc' file, put it in the same 88;; If you already have the compiled `vhdl-mode.elc' file, put it in the same
90;; directory. Otherwise, byte-compile the source file: 89;; directory. Otherwise, byte-compile the source file:
@@ -96,7 +95,7 @@
96;; (not required in Emacs 20 and higher): 95;; (not required in Emacs 20 and higher):
97 96
98;; (autoload 'vhdl-mode "vhdl-mode" "VHDL Mode" t) 97;; (autoload 'vhdl-mode "vhdl-mode" "VHDL Mode" t)
99;; (setq auto-mode-alist (cons '("\\.vhdl?\\'" . vhdl-mode) auto-mode-alist)) 98;; (push '("\\.vhdl?\\'" . vhdl-mode) auto-mode-alist)
100 99
101;; More detailed installation instructions are included in the official 100;; More detailed installation instructions are included in the official
102;; VHDL Mode distribution. 101;; VHDL Mode distribution.
@@ -130,6 +129,7 @@
130;; Emacs 21+ handling 129;; Emacs 21+ handling
131(defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not (featurep 'xemacs))) 130(defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not (featurep 'xemacs)))
132 "Non-nil if GNU Emacs 21, 22, ... is used.") 131 "Non-nil if GNU Emacs 21, 22, ... is used.")
132;; Emacs 22+ handling
133(defconst vhdl-emacs-22 (and (<= 22 emacs-major-version) (not (featurep 'xemacs))) 133(defconst vhdl-emacs-22 (and (<= 22 emacs-major-version) (not (featurep 'xemacs)))
134 "Non-nil if GNU Emacs 22, ... is used.") 134 "Non-nil if GNU Emacs 22, ... is used.")
135 135
@@ -210,22 +210,25 @@ Overrides local variable `indent-tabs-mode'."
210 210
211(defcustom vhdl-compiler-alist 211(defcustom vhdl-compiler-alist
212 '( 212 '(
213 ;; 60: docal <= false;
214 ;; ^^^^^
215 ;; [Error] Assignment error: variable is illegal target of signal assignment
213 ("ADVance MS" "vacom" "-work \\1" "make" "-f \\1" 216 ("ADVance MS" "vacom" "-work \\1" "make" "-f \\1"
214 nil "valib \\1; vamap \\2 \\1" "./" "work/" "Makefile" "adms" 217 nil "valib \\1; vamap \\2 \\1" "./" "work/" "Makefile" "adms"
215 ("\\s-\\([0-9]+\\):" 0 1 0) ("Compiling file \\(.+\\)" 1) 218 ("^\\s-+\\([0-9]+\\):\\s-+" nil 1 nil) ("Compiling file \\(.+\\)" 1)
216 ("ENTI/\\1.vif" "ARCH/\\1-\\2.vif" "CONF/\\1.vif" 219 ("ENTI/\\1.vif" "ARCH/\\1-\\2.vif" "CONF/\\1.vif"
217 "PACK/\\1.vif" "BODY/\\1.vif" upcase)) 220 "PACK/\\1.vif" "BODY/\\1.vif" upcase))
218 ;; Aldec 221 ;; Aldec
219 ;; COMP96 ERROR COMP96_0078: "Unknown identifier "Addr_Bits"." "<filename>" 40 30 222 ;; COMP96 ERROR COMP96_0018: "Identifier expected." "test.vhd" 66 3
220 ("Aldec" "vcom" "-93 -work \\1" "make" "-f \\1" 223 ("Aldec" "vcom" "-work \\1" "make" "-f \\1"
221 nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "aldec" 224 nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "aldec"
222 (".+?[ \t]+\\(?:ERROR\\)[^:]+:.+?\\(?:.+\"\\(.+?\\)\"[ \t]+\\([0-9]+\\)\\)" 1 2 0) ("" 0) 225 (".* ERROR [^:]+: \".*\" \"\\([^ \\t\\n]+\\)\" \\([0-9]+\\) \\([0-9]+\\)" 1 2 3) ("" 0)
223 nil) 226 nil)
224 ;; Cadence Leapfrog: cv -file test.vhd 227 ;; Cadence Leapfrog: cv -file test.vhd
225 ;; duluth: *E,430 (test.vhd,13): identifier (POSITIV) is not declared 228 ;; duluth: *E,430 (test.vhd,13): identifier (POSITIV) is not declared
226 ("Cadence Leapfrog" "cv" "-work \\1 -file" "make" "-f \\1" 229 ("Cadence Leapfrog" "cv" "-work \\1 -file" "make" "-f \\1"
227 nil "mkdir \\1" "./" "work/" "Makefile" "leapfrog" 230 nil "mkdir \\1" "./" "work/" "Makefile" "leapfrog"
228 ("duluth: \\*E,[0-9]+ (\\(.+\\),\\([0-9]+\\)):" 1 2 0) ("" 0) 231 ("duluth: \\*E,[0-9]+ (\\([^ \\t\\n]+\\),\\([0-9]+\\)):" 1 2 nil) ("" 0)
229 ("\\1/entity" "\\2/\\1" "\\1/configuration" 232 ("\\1/entity" "\\2/\\1" "\\1/configuration"
230 "\\1/package" "\\1/body" downcase)) 233 "\\1/package" "\\1/body" downcase))
231 ;; Cadence Affirma NC vhdl: ncvhdl test.vhd 234 ;; Cadence Affirma NC vhdl: ncvhdl test.vhd
@@ -233,21 +236,27 @@ Overrides local variable `indent-tabs-mode'."
233 ;; (PLL_400X_TOP) is not declared [10.3]. 236 ;; (PLL_400X_TOP) is not declared [10.3].
234 ("Cadence NC" "ncvhdl" "-work \\1" "make" "-f \\1" 237 ("Cadence NC" "ncvhdl" "-work \\1" "make" "-f \\1"
235 nil "mkdir \\1" "./" "work/" "Makefile" "ncvhdl" 238 nil "mkdir \\1" "./" "work/" "Makefile" "ncvhdl"
236 ("ncvhdl_p: \\*E,\\w+ (\\(.+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0) 239 ("ncvhdl_p: \\*E,\\w+ (\\([^ \\t\\n]+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0)
237 ("\\1/entity/pc.db" "\\2/\\1/pc.db" "\\1/configuration/pc.db" 240 ("\\1/entity/pc.db" "\\2/\\1/pc.db" "\\1/configuration/pc.db"
238 "\\1/package/pc.db" "\\1/body/pc.db" downcase)) 241 "\\1/package/pc.db" "\\1/body/pc.db" downcase))
239 ;; ghdl vhdl: ghdl test.vhd 242 ;; ghdl vhdl: ghdl test.vhd
240 ("GHDL" "ghdl" "-i --workdir=\\1 --ieee=synopsys -fexplicit " "make" "-f \\1" 243 ("GHDL" "ghdl" "-i --workdir=\\1 --ieee=synopsys -fexplicit " "make" "-f \\1"
241 nil "mkdir \\1" "./" "work/" "Makefile" "ghdl" 244 nil "mkdir \\1" "./" "work/" "Makefile" "ghdl"
242 ("ghdl_p: \\*E,\\w+ (\\(.+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0) 245 ("ghdl_p: \\*E,\\w+ (\\([^ \\t\\n]+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0)
243 ("\\1/entity" "\\2/\\1" "\\1/configuration" 246 ("\\1/entity" "\\2/\\1" "\\1/configuration"
244 "\\1/package" "\\1/body" downcase)) 247 "\\1/package" "\\1/body" downcase))
248 ;; IBM Compiler
249 ;; 00 COACHDL* | [CCHDL-1]: File: adder.vhd, line.column: 120.6
250 ("IBM Compiler" "g2tvc" "-src" "precomp" "\\1"
251 nil "mkdir \\1" "./" "work/" "Makefile" "ibm"
252 ("[0-9]+ COACHDL.*: File: \\([^ \\t\\n]+\\), line.column: \\([0-9]+\\).\\([0-9]+\\)" 1 2 3) (" " 0)
253 nil)
245 ;; Ikos Voyager: analyze test.vhd 254 ;; Ikos Voyager: analyze test.vhd
246 ;; analyze test.vhd 255 ;; analyze test.vhd
247 ;; E L4/C5: this library unit is inaccessible 256 ;; E L4/C5: this library unit is inaccessible
248 ("Ikos" "analyze" "-l \\1" "make" "-f \\1" 257 ("Ikos" "analyze" "-l \\1" "make" "-f \\1"
249 nil "mkdir \\1" "./" "work/" "Makefile" "ikos" 258 nil "mkdir \\1" "./" "work/" "Makefile" "ikos"
250 ("E L\\([0-9]+\\)/C\\([0-9]+\\):" 0 1 2) 259 ("E L\\([0-9]+\\)/C\\([0-9]+\\):" nil 1 2)
251 ("^analyze +\\(.+ +\\)*\\(.+\\)$" 2) 260 ("^analyze +\\(.+ +\\)*\\(.+\\)$" 2)
252 nil) 261 nil)
253 ;; ModelSim, Model Technology: vcom test.vhd 262 ;; ModelSim, Model Technology: vcom test.vhd
@@ -257,29 +266,39 @@ Overrides local variable `indent-tabs-mode'."
257 ;; ** Error: adder.vhd(190): Unknown identifier: ctl_numb 266 ;; ** Error: adder.vhd(190): Unknown identifier: ctl_numb
258 ("ModelSim" "vcom" "-93 -work \\1" "make" "-f \\1" 267 ("ModelSim" "vcom" "-93 -work \\1" "make" "-f \\1"
259 nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "modelsim" 268 nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "modelsim"
260 ("\\(ERROR\\|WARNING\\|\\*\\* Error\\|\\*\\* Warning\\)[^:]*:\\( *\[[0-9]+\]\\)? \\(.+\\)(\\([0-9]+\\)):" 3 4 0) ("" 0) 269 ("\\(ERROR\\|WARNING\\|\\*\\* Error\\|\\*\\* Warning\\)[^:]*:\\( *\[[0-9]+\]\\)? \\([^ \\t\\n]+\\)(\\([0-9]+\\)):" 3 4 nil) ("" 0)
261 ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat" 270 ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat"
262 "\\1/_primary.dat" "\\1/body.dat" downcase)) 271 "\\1/_primary.dat" "\\1/body.dat" downcase))
263 ;; ProVHDL, Synopsys LEDA: provhdl -w work -f test.vhd 272 ;; ProVHDL, Synopsys LEDA: provhdl -w work -f test.vhd
264 ;; test.vhd:34: error message 273 ;; test.vhd:34: error message
265 ("LEDA ProVHDL" "provhdl" "-w \\1 -f" "make" "-f \\1" 274 ("LEDA ProVHDL" "provhdl" "-w \\1 -f" "make" "-f \\1"
266 nil "mkdir \\1" "./" "work/" "Makefile" "provhdl" 275 nil "mkdir \\1" "./" "work/" "Makefile" "provhdl"
267 ("\\([^ \t\n]+\\):\\([0-9]+\\): " 1 2 0) ("" 0) 276 ("\\([^ \\t\\n]+\\):\\([0-9]+\\): " 1 2 nil) ("" 0)
268 ("ENTI/\\1.vif" "ARCH/\\1-\\2.vif" "CONF/\\1.vif" 277 ("ENTI/\\1.vif" "ARCH/\\1-\\2.vif" "CONF/\\1.vif"
269 "PACK/\\1.vif" "BODY/BODY-\\1.vif" upcase)) 278 "PACK/\\1.vif" "BODY/BODY-\\1.vif" upcase))
279 ;; Quartus compiler
280 ;; Error: VHDL error at dvi2sdi.vhd(473): object k2_alto_out_lvl is used
281 ;; Error: Verilog HDL syntax error at otsuif_v1_top.vhd(147) near text
282 ;; Error: VHDL syntax error at otsuif_v1_top.vhd(147): clk_ is an illegal
283 ;; Error: VHDL Use Clause error at otsuif_v1_top.vhd(455): design library
284 ;; Warning: VHDL Process Statement warning at dvi2sdi_tst.vhd(172): ...
285 ("Quartus" "make" "-work \\1" "make" "-f \\1"
286 nil "mkdir \\1" "./" "work/" "Makefile" "quartus"
287 ("\\(Error\\|Warning\\): .* \\([^ \\t\\n]+\\)(\\([0-9]+\\))" 2 3 nil) ("" 0)
288 nil)
270 ;; QuickHDL, Mentor Graphics: qvhcom test.vhd 289 ;; QuickHDL, Mentor Graphics: qvhcom test.vhd
271 ;; ERROR: test.vhd(24): near "dnd": expecting: END 290 ;; ERROR: test.vhd(24): near "dnd": expecting: END
272 ;; WARNING[4]: test.vhd(30): A space is required between ... 291 ;; WARNING[4]: test.vhd(30): A space is required between ...
273 ("QuickHDL" "qvhcom" "-work \\1" "make" "-f \\1" 292 ("QuickHDL" "qvhcom" "-work \\1" "make" "-f \\1"
274 nil "mkdir \\1" "./" "work/" "Makefile" "quickhdl" 293 nil "mkdir \\1" "./" "work/" "Makefile" "quickhdl"
275 ("\\(ERROR\\|WARNING\\)[^:]*: \\(.+\\)(\\([0-9]+\\)):" 2 3 0) ("" 0) 294 ("\\(ERROR\\|WARNING\\)[^:]*: \\([^ \\t\\n]+\\)(\\([0-9]+\\)):" 2 3 nil) ("" 0)
276 ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat" 295 ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat"
277 "\\1/_primary.dat" "\\1/body.dat" downcase)) 296 "\\1/_primary.dat" "\\1/body.dat" downcase))
278 ;; Savant: scram -publish-cc test.vhd 297 ;; Savant: scram -publish-cc test.vhd
279 ;; test.vhd:87: _set_passed_through_out_port(IIR_Boolean) not defined for 298 ;; test.vhd:87: _set_passed_through_out_port(IIR_Boolean) not defined for
280 ("Savant" "scram" "-publish-cc -design-library-name \\1" "make" "-f \\1" 299 ("Savant" "scram" "-publish-cc -design-library-name \\1" "make" "-f \\1"
281 nil "mkdir \\1" "./" "work._savant_lib/" "Makefile" "savant" 300 nil "mkdir \\1" "./" "work._savant_lib/" "Makefile" "savant"
282 ("\\([^ \t\n]+\\):\\([0-9]+\\): " 1 2 0) ("" 0) 301 ("\\([^ \\t\\n]+\\):\\([0-9]+\\): " 1 2 nil) ("" 0)
283 ("\\1_entity.vhdl" "\\2_secondary_units._savant_lib/\\2_\\1.vhdl" 302 ("\\1_entity.vhdl" "\\2_secondary_units._savant_lib/\\2_\\1.vhdl"
284 "\\1_config.vhdl" "\\1_package.vhdl" 303 "\\1_config.vhdl" "\\1_package.vhdl"
285 "\\1_secondary_units._savant_lib/\\1_package_body.vhdl" downcase)) 304 "\\1_secondary_units._savant_lib/\\1_package_body.vhdl" downcase))
@@ -287,39 +306,39 @@ Overrides local variable `indent-tabs-mode'."
287 ;; Error: CSVHDL0002: test.vhd: (line 97): Invalid prefix 306 ;; Error: CSVHDL0002: test.vhd: (line 97): Invalid prefix
288 ("Simili" "vhdlp" "-work \\1" "make" "-f \\1" 307 ("Simili" "vhdlp" "-work \\1" "make" "-f \\1"
289 nil "mkdir \\1" "./" "work/" "Makefile" "simili" 308 nil "mkdir \\1" "./" "work/" "Makefile" "simili"
290 ("\\(Error\\|Warning\\): \\w+: \\(.+\\): (line \\([0-9]+\\)): " 2 3 0) ("" 0) 309 ("\\(Error\\|Warning\\): \\w+: \\([^ \\t\\n]+\\): (line \\([0-9]+\\)): " 2 3 nil) ("" 0)
291 ("\\1/prim.var" "\\2/_\\1.var" "\\1/prim.var" 310 ("\\1/prim.var" "\\2/_\\1.var" "\\1/prim.var"
292 "\\1/prim.var" "\\1/_body.var" downcase)) 311 "\\1/prim.var" "\\1/_body.var" downcase))
293 ;; Speedwave (Innoveda): analyze -libfile vsslib.ini -src test.vhd 312 ;; Speedwave (Innoveda): analyze -libfile vsslib.ini -src test.vhd
294 ;; ERROR[11]::File test.vhd Line 100: Use of undeclared identifier 313 ;; ERROR[11]::File test.vhd Line 100: Use of undeclared identifier
295 ("Speedwave" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1" 314 ("Speedwave" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1"
296 nil "mkdir \\1" "./" "work/" "Makefile" "speedwave" 315 nil "mkdir \\1" "./" "work/" "Makefile" "speedwave"
297 ("^ *ERROR\[[0-9]+\]::File \\(.+\\) Line \\([0-9]+\\):" 1 2 0) ("" 0) 316 ("^ *ERROR\[[0-9]+\]::File \\([^ \\t\\n]+\\) Line \\([0-9]+\\):" 1 2 nil) ("" 0)
298 nil) 317 nil)
299 ;; Synopsys, VHDL Analyzer (sim): vhdlan -nc test.vhd 318 ;; Synopsys, VHDL Analyzer (sim): vhdlan -nc test.vhd
300 ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context. 319 ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context.
301 ("Synopsys" "vhdlan" "-nc -work \\1" "make" "-f \\1" 320 ("Synopsys" "vhdlan" "-nc -work \\1" "make" "-f \\1"
302 nil "mkdir \\1" "./" "work/" "Makefile" "synopsys" 321 nil "mkdir \\1" "./" "work/" "Makefile" "synopsys"
303 ("\\*\\*Error: vhdlan,[0-9]+ \\(.+\\)(\\([0-9]+\\)):" 1 2 0) ("" 0) 322 ("\\*\\*Error: vhdlan,[0-9]+ \\([^ \\t\\n]+\\)(\\([0-9]+\\)):" 1 2 nil) ("" 0)
304 ("\\1.sim" "\\2__\\1.sim" "\\1.sim" "\\1.sim" "\\1__.sim" upcase)) 323 ("\\1.sim" "\\2__\\1.sim" "\\1.sim" "\\1.sim" "\\1__.sim" upcase))
305 ;; Synopsys, VHDL Analyzer (syn): vhdlan -nc -spc test.vhd 324 ;; Synopsys, VHDL Analyzer (syn): vhdlan -nc -spc test.vhd
306 ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context. 325 ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context.
307 ("Synopsys Design Compiler" "vhdlan" "-nc -spc -work \\1" "make" "-f \\1" 326 ("Synopsys Design Compiler" "vhdlan" "-nc -spc -work \\1" "make" "-f \\1"
308 nil "mkdir \\1" "./" "work/" "Makefile" "synopsys_dc" 327 nil "mkdir \\1" "./" "work/" "Makefile" "synopsys_dc"
309 ("\\*\\*Error: vhdlan,[0-9]+ \\(.+\\)(\\([0-9]+\\)):" 1 2 0) ("" 0) 328 ("\\*\\*Error: vhdlan,[0-9]+ \\([^ \\t\\n]+\\)(\\([0-9]+\\)):" 1 2 nil) ("" 0)
310 ("\\1.syn" "\\2__\\1.syn" "\\1.syn" "\\1.syn" "\\1__.syn" upcase)) 329 ("\\1.syn" "\\2__\\1.syn" "\\1.syn" "\\1.syn" "\\1__.syn" upcase))
311 ;; Synplify: 330 ;; Synplify:
312 ;; @W:"test.vhd":57:8:57:9|Optimizing register bit count_x(5) to a constant 0 331 ;; @W:"test.vhd":57:8:57:9|Optimizing register bit count_x(5) to a constant 0
313 ("Synplify" "n/a" "n/a" "make" "-f \\1" 332 ("Synplify" "n/a" "n/a" "make" "-f \\1"
314 nil "mkdir \\1" "./" "work/" "Makefile" "synplify" 333 nil "mkdir \\1" "./" "work/" "Makefile" "synplify"
315 ("@[EWN]:\"\\(.+\\)\":\\([0-9]+\\):\\([0-9]+\\):" 1 2 3) ("" 0) 334 ("@[EWN]:\"\\([^ \\t\\n]+\\)\":\\([0-9]+\\):\\([0-9]+\\):" 1 2 3) ("" 0)
316 nil) 335 nil)
317 ;; Vantage: analyze -libfile vsslib.ini -src test.vhd 336 ;; Vantage: analyze -libfile vsslib.ini -src test.vhd
318 ;; Compiling "test.vhd" line 1... 337 ;; Compiling "test.vhd" line 1...
319 ;; **Error: LINE 49 *** No aggregate value is valid in this context. 338 ;; **Error: LINE 49 *** No aggregate value is valid in this context.
320 ("Vantage" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1" 339 ("Vantage" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1"
321 nil "mkdir \\1" "./" "work/" "Makefile" "vantage" 340 nil "mkdir \\1" "./" "work/" "Makefile" "vantage"
322 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" 0 1 0) 341 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" nil 1 nil)
323 ("^ *Compiling \"\\(.+\\)\" " 1) 342 ("^ *Compiling \"\\(.+\\)\" " 1)
324 nil) 343 nil)
325 ;; VeriBest: vc vhdl test.vhd 344 ;; VeriBest: vc vhdl test.vhd
@@ -329,21 +348,21 @@ Overrides local variable `indent-tabs-mode'."
329 ;; [Error] Name BITA is unknown 348 ;; [Error] Name BITA is unknown
330 ("VeriBest" "vc" "vhdl" "make" "-f \\1" 349 ("VeriBest" "vc" "vhdl" "make" "-f \\1"
331 nil "mkdir \\1" "./" "work/" "Makefile" "veribest" 350 nil "mkdir \\1" "./" "work/" "Makefile" "veribest"
332 ("^ +\\([0-9]+\\): +[^ ]" 0 1 0) ("" 0) 351 ("^ +\\([0-9]+\\): +[^ ]" nil 1 nil) ("" 0)
333 nil) 352 nil)
334 ;; Viewlogic: analyze -libfile vsslib.ini -src test.vhd 353 ;; Viewlogic: analyze -libfile vsslib.ini -src test.vhd
335 ;; Compiling "test.vhd" line 1... 354 ;; Compiling "test.vhd" line 1...
336 ;; **Error: LINE 49 *** No aggregate value is valid in this context. 355 ;; **Error: LINE 49 *** No aggregate value is valid in this context.
337 ("Viewlogic" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1" 356 ("Viewlogic" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1"
338 nil "mkdir \\1" "./" "work/" "Makefile" "viewlogic" 357 nil "mkdir \\1" "./" "work/" "Makefile" "viewlogic"
339 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" 0 1 0) 358 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" nil 1 nil)
340 ("^ *Compiling \"\\(.+\\)\" " 1) 359 ("^ *Compiling \"\\(.+\\)\" " 1)
341 nil) 360 nil)
342 ;; Xilinx XST: 361 ;; Xilinx XST:
343 ;; ERROR:HDLParsers:164 - "test.vhd" Line 3. parse error 362 ;; ERROR:HDLParsers:164 - "test.vhd" Line 3. parse error
344 ("Xilinx XST" "xflow" "" "make" "-f \\1" 363 ("Xilinx XST" "xflow" "" "make" "-f \\1"
345 nil "mkdir \\1" "./" "work/" "Makefile" "xilinx" 364 nil "mkdir \\1" "./" "work/" "Makefile" "xilinx"
346 ("^ERROR:HDLParsers:[0-9]+ - \"\\(.+\\)\" Line \\([0-9]+\\)\." 1 2 0) ("" 0) 365 ("^ERROR:HDLParsers:[0-9]+ - \"\\([^ \\t\\n]+\\)\" Line \\([0-9]+\\)\." 1 2 nil) ("" 0)
347 nil) 366 nil)
348 ) 367 )
349 "List of available VHDL compilers and their properties. 368 "List of available VHDL compilers and their properties.
@@ -429,9 +448,13 @@ NOTE: Activate new error and file message regexps and reflect the new setting
429 (string :tag "ID string ") 448 (string :tag "ID string ")
430 (list :tag "Error message" :indent 4 449 (list :tag "Error message" :indent 4
431 (regexp :tag "Regexp ") 450 (regexp :tag "Regexp ")
432 (integer :tag "File subexp index") 451 (choice :tag "File subexp "
452 (integer :tag "Index")
453 (const :tag "No file name" nil))
433 (integer :tag "Line subexp index") 454 (integer :tag "Line subexp index")
434 (integer :tag "Column subexp idx")) 455 (choice :tag "Column subexp "
456 (integer :tag "Index")
457 (const :tag "No column number" nil)))
435 (list :tag "File message" :indent 4 458 (list :tag "File message" :indent 4
436 (regexp :tag "Regexp ") 459 (regexp :tag "Regexp ")
437 (integer :tag "File subexp index")) 460 (integer :tag "File subexp index"))
@@ -450,6 +473,7 @@ NOTE: Activate new error and file message regexps and reflect the new setting
450 (const :tag "Downcase" downcase)))))) 473 (const :tag "Downcase" downcase))))))
451 :set (lambda (variable value) 474 :set (lambda (variable value)
452 (vhdl-custom-set variable value 'vhdl-update-mode-menu)) 475 (vhdl-custom-set variable value 'vhdl-update-mode-menu))
476 :version "24.4"
453 :group 'vhdl-compile) 477 :group 'vhdl-compile)
454 478
455(defcustom vhdl-compiler "GHDL" 479(defcustom vhdl-compiler "GHDL"
@@ -457,7 +481,7 @@ NOTE: Activate new error and file message regexps and reflect the new setting
457Select a compiler name from the ones defined in option `vhdl-compiler-alist'." 481Select a compiler name from the ones defined in option `vhdl-compiler-alist'."
458 :type (let ((alist vhdl-compiler-alist) list) 482 :type (let ((alist vhdl-compiler-alist) list)
459 (while alist 483 (while alist
460 (setq list (cons (list 'const (caar alist)) list)) 484 (push (list 'const (caar alist)) list)
461 (setq alist (cdr alist))) 485 (setq alist (cdr alist)))
462 (append '(choice) (nreverse list))) 486 (append '(choice) (nreverse list)))
463 :group 'vhdl-compile) 487 :group 'vhdl-compile)
@@ -602,7 +626,7 @@ NOTE: Reflect the new setting in the choice list of option `vhdl-project'
602 (list :tag "Compiler" :indent 6 626 (list :tag "Compiler" :indent 6
603 ,(let ((alist vhdl-compiler-alist) list) 627 ,(let ((alist vhdl-compiler-alist) list)
604 (while alist 628 (while alist
605 (setq list (cons (list 'const (caar alist)) list)) 629 (push (list 'const (caar alist)) list)
606 (setq alist (cdr alist))) 630 (setq alist (cdr alist)))
607 (append '(choice :tag "Compiler name") 631 (append '(choice :tag "Compiler name")
608 (nreverse list))) 632 (nreverse list)))
@@ -637,7 +661,7 @@ headers and the source files/directories to be scanned in the hierarchy
637browser. The current project can also be changed temporarily in the menu." 661browser. The current project can also be changed temporarily in the menu."
638 :type (let ((alist vhdl-project-alist) list) 662 :type (let ((alist vhdl-project-alist) list)
639 (while alist 663 (while alist
640 (setq list (cons (list 'const (caar alist)) list)) 664 (push (list 'const (caar alist)) list)
641 (setq alist (cdr alist))) 665 (setq alist (cdr alist)))
642 (append '(choice (const :tag "None" nil) (const :tag "--")) 666 (append '(choice (const :tag "None" nil) (const :tag "--"))
643 (nreverse list))) 667 (nreverse list)))
@@ -1268,6 +1292,18 @@ The comments and empty lines between groups of ports are pasted:
1268 (const :tag "Always" always)) 1292 (const :tag "Always" always))
1269 :group 'vhdl-port) 1293 :group 'vhdl-port)
1270 1294
1295(defcustom vhdl-actual-generic-name '(".*" . "\\&")
1296 (concat
1297 "Specifies how actual generic names are obtained from formal generic names.
1298In a component instantiation, an actual generic name can be
1299obtained by modifying the formal generic name (e.g. attaching or stripping
1300off a substring)."
1301 vhdl-name-doc-string)
1302 :type '(cons (regexp :tag "From regexp")
1303 (string :tag "To string "))
1304 :group 'vhdl-port
1305 :version "24.4")
1306
1271(defcustom vhdl-actual-port-name '(".*" . "\\&") 1307(defcustom vhdl-actual-port-name '(".*" . "\\&")
1272 (concat 1308 (concat
1273 "Specifies how actual port names are obtained from formal port names. 1309 "Specifies how actual port names are obtained from formal port names.
@@ -1469,21 +1505,21 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry
1469(defvar end-comment-column) 1505(defvar end-comment-column)
1470 1506
1471 1507
1472(defgroup vhdl-align nil 1508(defgroup vhdl-beautify nil
1473 "Customizations for alignment." 1509 "Customizations for beautification."
1474 :group 'vhdl) 1510 :group 'vhdl)
1475 1511
1476(defcustom vhdl-auto-align t 1512(defcustom vhdl-auto-align t
1477 "Non-nil means align some templates automatically after generation." 1513 "Non-nil means align some templates automatically after generation."
1478 :type 'boolean 1514 :type 'boolean
1479 :group 'vhdl-align) 1515 :group 'vhdl-beautify)
1480 1516
1481(defcustom vhdl-align-groups t 1517(defcustom vhdl-align-groups t
1482 "Non-nil means align groups of code lines separately. 1518 "Non-nil means align groups of code lines separately.
1483A group of code lines is a region of consecutive lines between two lines that 1519A group of code lines is a region of consecutive lines between two lines that
1484match the regexp in option `vhdl-align-group-separate'." 1520match the regexp in option `vhdl-align-group-separate'."
1485 :type 'boolean 1521 :type 'boolean
1486 :group 'vhdl-align) 1522 :group 'vhdl-beautify)
1487 1523
1488(defcustom vhdl-align-group-separate "^\\s-*$" 1524(defcustom vhdl-align-group-separate "^\\s-*$"
1489 "Regexp for matching a line that separates groups of lines for alignment. 1525 "Regexp for matching a line that separates groups of lines for alignment.
@@ -1491,7 +1527,7 @@ Examples:
1491 \"^\\s-*$\": matches an empty line 1527 \"^\\s-*$\": matches an empty line
1492 \"^\\s-*\\(--.*\\)?$\": matches an empty line or a comment-only line" 1528 \"^\\s-*\\(--.*\\)?$\": matches an empty line or a comment-only line"
1493 :type 'regexp 1529 :type 'regexp
1494 :group 'vhdl-align) 1530 :group 'vhdl-beautify)
1495 1531
1496(defcustom vhdl-align-same-indent t 1532(defcustom vhdl-align-same-indent t
1497 "Non-nil means align blocks with same indent separately. 1533 "Non-nil means align blocks with same indent separately.
@@ -1500,7 +1536,18 @@ blocks of same indent which are aligned separately (except for argument/port
1500lists). This gives nicer alignment in most cases. 1536lists). This gives nicer alignment in most cases.
1501Option `vhdl-align-groups' still applies within these blocks." 1537Option `vhdl-align-groups' still applies within these blocks."
1502 :type 'boolean 1538 :type 'boolean
1503 :group 'vhdl-align) 1539 :group 'vhdl-beautify)
1540
1541(defcustom vhdl-beautify-options '(t t t t t)
1542 "List of options for beautifying code. Allows to disable individual
1543features of code beautification."
1544 :type '(list (boolean :tag "Whitespace cleanup ")
1545 (boolean :tag "Single statement per line")
1546 (boolean :tag "Indentation ")
1547 (boolean :tag "Alignment ")
1548 (boolean :tag "Case fixing "))
1549 :group 'vhdl-beautify
1550 :version "24.4")
1504 1551
1505 1552
1506(defgroup vhdl-highlight nil 1553(defgroup vhdl-highlight nil
@@ -1846,7 +1893,7 @@ useful in large files where syntax-based indentation gets very slow."
1846 :group 'vhdl-misc) 1893 :group 'vhdl-misc)
1847 1894
1848(defcustom vhdl-indent-comment-like-next-code-line t 1895(defcustom vhdl-indent-comment-like-next-code-line t
1849 "*Non-nil means comment lines are indented like the following code line. 1896 "Non-nil means comment lines are indented like the following code line.
1850Otherwise, comment lines are indented like the preceding code line. 1897Otherwise, comment lines are indented like the preceding code line.
1851Indenting comment lines like the following code line gives nicer indentation 1898Indenting comment lines like the following code line gives nicer indentation
1852when comments precede the code that they refer to." 1899when comments precede the code that they refer to."
@@ -2067,7 +2114,7 @@ your style, only those that are different from the default.")
2067 (lambda (var) 2114 (lambda (var)
2068 (cons var (symbol-value var)))) 2115 (cons var (symbol-value var))))
2069 varlist)))) 2116 varlist))))
2070 (setq vhdl-style-alist (cons default vhdl-style-alist)))) 2117 (push default vhdl-style-alist)))
2071 2118
2072(defvar vhdl-mode-hook nil 2119(defvar vhdl-mode-hook nil
2073 "Hook called by `vhdl-mode'.") 2120 "Hook called by `vhdl-mode'.")
@@ -2084,10 +2131,11 @@ your style, only those that are different from the default.")
2084(require 'hippie-exp) 2131(require 'hippie-exp)
2085 2132
2086;; optional (minimize warning messages during compile) 2133;; optional (minimize warning messages during compile)
2134(unless (featurep 'xemacs)
2087(eval-when-compile 2135(eval-when-compile
2088 (require 'font-lock) 2136 (require 'font-lock)
2089 (require 'ps-print) 2137 (require 'ps-print)
2090 (require 'speedbar)) 2138 (require 'speedbar)))
2091 2139
2092 2140
2093;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2141;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2187,6 +2235,17 @@ Ignore byte-compiler warnings you might see."
2187(unless (fboundp 'member-ignore-case) 2235(unless (fboundp 'member-ignore-case)
2188 (defalias 'member-ignore-case 'member)) 2236 (defalias 'member-ignore-case 'member))
2189 2237
2238;; `last-input-char' obsolete in Emacs 24, `last-input-event' different
2239;; behavior in XEmacs
2240(defvar vhdl-last-input-event)
2241(if (featurep 'xemacs)
2242 (defvaralias 'vhdl-last-input-event 'last-input-char)
2243 (defvaralias 'vhdl-last-input-event 'last-input-event))
2244
2245;; `help-print-return-message' changed to `print-help-return-message' in Emacs
2246;;;(unless (fboundp 'help-print-return-message)
2247;;; (defalias 'help-print-return-message 'print-help-return-message))
2248
2190;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2249;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2191;; Compatibility with older VHDL Mode versions 2250;; Compatibility with older VHDL Mode versions
2192 2251
@@ -2207,7 +2266,7 @@ Ignore byte-compiler warnings you might see."
2207 (vhdl-warning (apply 'format args) t) 2266 (vhdl-warning (apply 'format args) t)
2208 (unless vhdl-warnings 2267 (unless vhdl-warnings
2209 (vhdl-run-when-idle .1 nil 'vhdl-print-warnings)) 2268 (vhdl-run-when-idle .1 nil 'vhdl-print-warnings))
2210 (setq vhdl-warnings (cons (apply 'format args) vhdl-warnings)))) 2269 (push (apply 'format args) vhdl-warnings)))
2211 2270
2212(defun vhdl-warning (string &optional nobeep) 2271(defun vhdl-warning (string &optional nobeep)
2213 "Print out warning STRING and beep." 2272 "Print out warning STRING and beep."
@@ -2241,7 +2300,7 @@ Ignore byte-compiler warnings you might see."
2241 (let ((old-alist vhdl-model-alist) 2300 (let ((old-alist vhdl-model-alist)
2242 new-alist) 2301 new-alist)
2243 (while old-alist 2302 (while old-alist
2244 (setq new-alist (cons (append (car old-alist) '("")) new-alist)) 2303 (push (append (car old-alist) '("")) new-alist)
2245 (setq old-alist (cdr old-alist))) 2304 (setq old-alist (cdr old-alist)))
2246 (setq vhdl-model-alist (nreverse new-alist))) 2305 (setq vhdl-model-alist (nreverse new-alist)))
2247 (customize-save-variable 'vhdl-model-alist vhdl-model-alist)) 2306 (customize-save-variable 'vhdl-model-alist vhdl-model-alist))
@@ -2251,7 +2310,7 @@ Ignore byte-compiler warnings you might see."
2251 (let ((old-alist vhdl-project-alist) 2310 (let ((old-alist vhdl-project-alist)
2252 new-alist) 2311 new-alist)
2253 (while old-alist 2312 (while old-alist
2254 (setq new-alist (cons (append (car old-alist) '("")) new-alist)) 2313 (push (append (car old-alist) '("")) new-alist)
2255 (setq old-alist (cdr old-alist))) 2314 (setq old-alist (cdr old-alist)))
2256 (setq vhdl-project-alist (nreverse new-alist))) 2315 (setq vhdl-project-alist (nreverse new-alist)))
2257 (customize-save-variable 'vhdl-project-alist vhdl-project-alist)) 2316 (customize-save-variable 'vhdl-project-alist vhdl-project-alist))
@@ -2339,7 +2398,6 @@ Ignore byte-compiler warnings you might see."
2339 (unless (get 'speedbar-indentation-width 'saved-value) 2398 (unless (get 'speedbar-indentation-width 'saved-value)
2340 (setq speedbar-indentation-width 2))) 2399 (setq speedbar-indentation-width 2)))
2341 2400
2342
2343;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2401;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2344;;; Help functions / inline substitutions / macros 2402;;; Help functions / inline substitutions / macros
2345;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2403;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2487,7 +2545,7 @@ conversion."
2487 2545
2488(defun vhdl-delete (elt list) 2546(defun vhdl-delete (elt list)
2489 "Delete by side effect the first occurrence of ELT as a member of LIST." 2547 "Delete by side effect the first occurrence of ELT as a member of LIST."
2490 (setq list (cons nil list)) 2548 (push nil list)
2491 (let ((list1 list)) 2549 (let ((list1 list))
2492 (while (and (cdr list1) (not (equal elt (cadr list1)))) 2550 (while (and (cdr list1) (not (equal elt (cadr list1))))
2493 (setq list1 (cdr list1))) 2551 (setq list1 (cdr list1)))
@@ -2535,6 +2593,11 @@ conversion."
2535 (set-buffer (marker-buffer marker))) 2593 (set-buffer (marker-buffer marker)))
2536 (goto-char marker)) 2594 (goto-char marker))
2537 2595
2596(defun vhdl-goto-line (line)
2597 "Use this instead of calling user level function `goto-line'."
2598 (goto-char (point-min))
2599 (forward-line (1- line)))
2600
2538(defun vhdl-menu-split (list title) 2601(defun vhdl-menu-split (list title)
2539 "Split menu LIST into several submenus, if number of 2602 "Split menu LIST into several submenus, if number of
2540elements > `vhdl-menu-max-size'." 2603elements > `vhdl-menu-max-size'."
@@ -2545,19 +2608,19 @@ elements > `vhdl-menu-max-size'."
2545 (menuno 1) 2608 (menuno 1)
2546 (i 0)) 2609 (i 0))
2547 (while remain 2610 (while remain
2548 (setq sublist (cons (car remain) sublist)) 2611 (push (car remain) sublist)
2549 (setq remain (cdr remain)) 2612 (setq remain (cdr remain))
2550 (setq i (+ i 1)) 2613 (setq i (+ i 1))
2551 (if (= i vhdl-menu-max-size) 2614 (if (= i vhdl-menu-max-size)
2552 (progn 2615 (progn
2553 (setq result (cons (cons (format "%s %s" title menuno) 2616 (push (cons (format "%s %s" title menuno)
2554 (nreverse sublist)) result)) 2617 (nreverse sublist)) result)
2555 (setq i 0) 2618 (setq i 0)
2556 (setq menuno (+ menuno 1)) 2619 (setq menuno (+ menuno 1))
2557 (setq sublist '())))) 2620 (setq sublist '()))))
2558 (and sublist 2621 (and sublist
2559 (setq result (cons (cons (format "%s %s" title menuno) 2622 (push (cons (format "%s %s" title menuno)
2560 (nreverse sublist)) result))) 2623 (nreverse sublist)) result))
2561 (nreverse result)) 2624 (nreverse result))
2562 list)) 2625 list))
2563 2626
@@ -2792,6 +2855,8 @@ STRING are replaced by `-' and substrings are converted to lower case."
2792 (define-key vhdl-mode-map "\C-c\C-l\C-o" 'vhdl-line-open) 2855 (define-key vhdl-mode-map "\C-c\C-l\C-o" 'vhdl-line-open)
2793 (define-key vhdl-mode-map "\C-c\C-l\C-g" 'goto-line) 2856 (define-key vhdl-mode-map "\C-c\C-l\C-g" 'goto-line)
2794 (define-key vhdl-mode-map "\C-c\C-l\C-c" 'vhdl-comment-uncomment-line) 2857 (define-key vhdl-mode-map "\C-c\C-l\C-c" 'vhdl-comment-uncomment-line)
2858 (define-key vhdl-mode-map "\C-c\C-x\C-s" 'vhdl-fix-statement-region)
2859 (define-key vhdl-mode-map "\C-c\C-x\M-s" 'vhdl-fix-statement-buffer)
2795 (define-key vhdl-mode-map "\C-c\C-x\C-p" 'vhdl-fix-clause) 2860 (define-key vhdl-mode-map "\C-c\C-x\C-p" 'vhdl-fix-clause)
2796 (define-key vhdl-mode-map "\C-c\C-x\M-c" 'vhdl-fix-case-region) 2861 (define-key vhdl-mode-map "\C-c\C-x\M-c" 'vhdl-fix-case-region)
2797 (define-key vhdl-mode-map "\C-c\C-x\C-c" 'vhdl-fix-case-buffer) 2862 (define-key vhdl-mode-map "\C-c\C-x\C-c" 'vhdl-fix-case-buffer)
@@ -3499,6 +3564,9 @@ STRING are replaced by `-' and substrings are converted to lower case."
3499 ["Whitespace Region" vhdl-fixup-whitespace-region (mark)] 3564 ["Whitespace Region" vhdl-fixup-whitespace-region (mark)]
3500 ["Whitespace Buffer" vhdl-fixup-whitespace-buffer t] 3565 ["Whitespace Buffer" vhdl-fixup-whitespace-buffer t]
3501 "--" 3566 "--"
3567 ["Statement Region" vhdl-fix-statement-region (mark)]
3568 ["Statement Buffer" vhdl-fix-statement-buffer t]
3569 "--"
3502 ["Trailing Spaces Buffer" vhdl-remove-trailing-spaces t]) 3570 ["Trailing Spaces Buffer" vhdl-remove-trailing-spaces t])
3503 ("Update" 3571 ("Update"
3504 ["Sensitivity List" vhdl-update-sensitivity-list-process t] 3572 ["Sensitivity List" vhdl-update-sensitivity-list-process t]
@@ -3807,6 +3875,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
3807 ["Always" 3875 ["Always"
3808 (customize-set-variable 'vhdl-include-group-comments 'always) 3876 (customize-set-variable 'vhdl-include-group-comments 'always)
3809 :style radio :selected (eq 'always vhdl-include-group-comments)]) 3877 :style radio :selected (eq 'always vhdl-include-group-comments)])
3878 ["Actual Generic Name..." (customize-option 'vhdl-actual-generic-name) t]
3810 ["Actual Port Name..." (customize-option 'vhdl-actual-port-name) t] 3879 ["Actual Port Name..." (customize-option 'vhdl-actual-port-name) t]
3811 ["Instance Name..." (customize-option 'vhdl-instance-name) t] 3880 ["Instance Name..." (customize-option 'vhdl-instance-name) t]
3812 ("Testbench" 3881 ("Testbench"
@@ -3903,7 +3972,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
3903 ["End Comment Column..." (customize-option 'vhdl-end-comment-column) t] 3972 ["End Comment Column..." (customize-option 'vhdl-end-comment-column) t]
3904 "--" 3973 "--"
3905 ["Customize Group..." (customize-group 'vhdl-comment) t]) 3974 ["Customize Group..." (customize-group 'vhdl-comment) t])
3906 ("Align" 3975 ("Beautify"
3907 ["Auto Align Templates" 3976 ["Auto Align Templates"
3908 (customize-set-variable 'vhdl-auto-align (not vhdl-auto-align)) 3977 (customize-set-variable 'vhdl-auto-align (not vhdl-auto-align))
3909 :style toggle :selected vhdl-auto-align] 3978 :style toggle :selected vhdl-auto-align]
@@ -3911,13 +3980,14 @@ STRING are replaced by `-' and substrings are converted to lower case."
3911 (customize-set-variable 'vhdl-align-groups (not vhdl-align-groups)) 3980 (customize-set-variable 'vhdl-align-groups (not vhdl-align-groups))
3912 :style toggle :selected vhdl-align-groups] 3981 :style toggle :selected vhdl-align-groups]
3913 ["Group Separation String..." 3982 ["Group Separation String..."
3914 (customize-set-variable 'vhdl-align-group-separate) t] 3983 (customize-option 'vhdl-align-group-separate) t]
3915 ["Align Lines with Same Indent" 3984 ["Align Lines with Same Indent"
3916 (customize-set-variable 'vhdl-align-same-indent 3985 (customize-set-variable 'vhdl-align-same-indent
3917 (not vhdl-align-same-indent)) 3986 (not vhdl-align-same-indent))
3918 :style toggle :selected vhdl-align-same-indent] 3987 :style toggle :selected vhdl-align-same-indent]
3988 ["Beautify Options..." (customize-option 'vhdl-beautify-options) t]
3919 "--" 3989 "--"
3920 ["Customize Group..." (customize-group 'vhdl-align) t]) 3990 ["Customize Group..." (customize-group 'vhdl-beautify) t])
3921 ("Highlight" 3991 ("Highlight"
3922 ["Highlighting On/Off..." 3992 ["Highlighting On/Off..."
3923 (customize-option 3993 (customize-option
@@ -4181,14 +4251,13 @@ The directory of the current source file is scanned."
4181 (setq found nil) 4251 (setq found nil)
4182 (while file-list 4252 (while file-list
4183 (setq found t) 4253 (setq found t)
4184 (setq menu-list (cons (vector (car file-list) 4254 (push (vector (car file-list) (list 'find-file (car file-list)) t)
4185 (list 'find-file (car file-list)) t) 4255 menu-list)
4186 menu-list))
4187 (setq file-list (cdr file-list))) 4256 (setq file-list (cdr file-list)))
4188 (setq menu-list (vhdl-menu-split menu-list "Sources")) 4257 (setq menu-list (vhdl-menu-split menu-list "Sources"))
4189 (when found (setq menu-list (cons "--" menu-list))) 4258 (when found (push "--" menu-list))
4190 (setq menu-list (cons ["*Rescan*" vhdl-add-source-files-menu t] menu-list)) 4259 (push ["*Rescan*" vhdl-add-source-files-menu t] menu-list)
4191 (setq menu-list (cons "Sources" menu-list)) 4260 (push "Sources" menu-list)
4192 ;; Create menu 4261 ;; Create menu
4193 (easy-menu-add menu-list) 4262 (easy-menu-add menu-list)
4194 (easy-menu-define vhdl-sources-menu newmap 4263 (easy-menu-define vhdl-sources-menu newmap
@@ -4572,7 +4641,7 @@ Usage:
4572 option `vhdl-index-menu' to non-nil) or made accessible as a mouse menu 4641 option `vhdl-index-menu' to non-nil) or made accessible as a mouse menu
4573 (e.g. add \"(global-set-key '[S-down-mouse-3] 'imenu)\" to your start-up 4642 (e.g. add \"(global-set-key '[S-down-mouse-3] 'imenu)\" to your start-up
4574 file) for browsing the file contents (is not populated if buffer is 4643 file) for browsing the file contents (is not populated if buffer is
4575 larger than `font-lock-maximum-size'). Also, a source file menu can be 4644 larger than 256000). Also, a source file menu can be
4576 added (set option `vhdl-source-file-menu' to non-nil) for browsing the 4645 added (set option `vhdl-source-file-menu' to non-nil) for browsing the
4577 current directory for VHDL source files. 4646 current directory for VHDL source files.
4578 4647
@@ -4699,7 +4768,7 @@ Usage:
4699 automatically recognized as VHDL source files. To add an extension 4768 automatically recognized as VHDL source files. To add an extension
4700 \".xxx\", add the following line to your Emacs start-up file (`.emacs'): 4769 \".xxx\", add the following line to your Emacs start-up file (`.emacs'):
4701 4770
4702 \(setq auto-mode-alist (cons '(\"\\\\.xxx\\\\'\" . vhdl-mode) auto-mode-alist)) 4771 \(push '(\"\\\\.xxx\\\\'\" . vhdl-mode) auto-mode-alist)
4703 4772
4704 4773
4705 HINTS: 4774 HINTS:
@@ -7270,7 +7339,7 @@ indentation change."
7270 (beginning-of-line 2) 7339 (beginning-of-line 2)
7271 (setq syntax (vhdl-get-syntactic-context))))) 7340 (setq syntax (vhdl-get-syntactic-context)))))
7272 (when is-comment 7341 (when is-comment
7273 (setq syntax (cons (cons 'comment nil) syntax))) 7342 (push (cons 'comment nil) syntax))
7274 (apply '+ (mapcar 'vhdl-get-offset syntax))) 7343 (apply '+ (mapcar 'vhdl-get-offset syntax)))
7275 ;; indent like previous nonblank line 7344 ;; indent like previous nonblank line
7276 (save-excursion (beginning-of-line) 7345 (save-excursion (beginning-of-line)
@@ -7381,7 +7450,7 @@ ENDPOS is encountered."
7381 7450
7382 7451
7383;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7452;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7384;;; Alignment, whitespace fixup, beautifying 7453;;; Alignment, beautifying
7385;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7454;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7386 7455
7387(defconst vhdl-align-alist 7456(defconst vhdl-align-alist
@@ -7597,7 +7666,8 @@ the token in MATCH."
7597 (when vhdl-progress-interval 7666 (when vhdl-progress-interval
7598 (setq vhdl-progress-info (vector (count-lines (point-min) beg) 7667 (setq vhdl-progress-info (vector (count-lines (point-min) beg)
7599 (count-lines (point-min) end) 0)))) 7668 (count-lines (point-min) end) 0))))
7600 (vhdl-fixup-whitespace-region beg end t) 7669 (when (nth 0 vhdl-beautify-options)
7670 (vhdl-fixup-whitespace-region beg end t))
7601 (goto-char beg) 7671 (goto-char beg)
7602 (if (not vhdl-align-groups) 7672 (if (not vhdl-align-groups)
7603 ;; align entire region 7673 ;; align entire region
@@ -7721,14 +7791,14 @@ the token in MATCH."
7721 ;; search for comment start positions and lengths 7791 ;; search for comment start positions and lengths
7722 (while (< (point) end) 7792 (while (< (point) end)
7723 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>")) 7793 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>"))
7724 (looking-at "^\\(.*[^ \t\n\r\f-]+\\)\\s-*\\(--.*\\)$") 7794 (looking-at "^\\(.*?[^ \t\n\r\f-]+\\)\\s-*\\(--.*\\)$")
7725 (not (save-excursion (goto-char (match-beginning 2)) 7795 (not (save-excursion (goto-char (match-beginning 2))
7726 (vhdl-in-literal)))) 7796 (vhdl-in-literal))))
7727 (setq start (+ (- (match-end 1) (match-beginning 1)) spacing)) 7797 (setq start (+ (- (match-end 1) (match-beginning 1)) spacing))
7728 (setq length (- (match-end 2) (match-beginning 2))) 7798 (setq length (- (match-end 2) (match-beginning 2)))
7729 (setq start-max (max start start-max)) 7799 (setq start-max (max start start-max))
7730 (setq length-max (max length length-max)) 7800 (setq length-max (max length length-max))
7731 (setq comment-list (cons (cons start length) comment-list))) 7801 (push (cons start length) comment-list))
7732 (beginning-of-line 2)) 7802 (beginning-of-line 2))
7733 (setq comment-list 7803 (setq comment-list
7734 (sort comment-list (function (lambda (a b) (> (car a) (car b)))))) 7804 (sort comment-list (function (lambda (a b) (> (car a) (car b))))))
@@ -7739,14 +7809,14 @@ the token in MATCH."
7739 (unless (or (= (caar comment-list) (car start-list)) 7809 (unless (or (= (caar comment-list) (car start-list))
7740 (<= (+ (car start-list) (cdar comment-list)) 7810 (<= (+ (car start-list) (cdar comment-list))
7741 end-comment-column)) 7811 end-comment-column))
7742 (setq start-list (cons (caar comment-list) start-list))) 7812 (push (caar comment-list) start-list))
7743 (setq comment-list (cdr comment-list))) 7813 (setq comment-list (cdr comment-list)))
7744 ;; align lines as nicely as possible 7814 ;; align lines as nicely as possible
7745 (goto-char beg) 7815 (goto-char beg)
7746 (while (< (point) end) 7816 (while (< (point) end)
7747 (setq cur-start nil) 7817 (setq cur-start nil)
7748 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>")) 7818 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>"))
7749 (or (and (looking-at "^\\(.*[^ \t\n\r\f-]+\\)\\(\\s-*\\)\\(--.*\\)$") 7819 (or (and (looking-at "^\\(.*?[^ \t\n\r\f-]+\\)\\(\\s-*\\)\\(--.*\\)$")
7750 (not (save-excursion 7820 (not (save-excursion
7751 (goto-char (match-beginning 3)) 7821 (goto-char (match-beginning 3))
7752 (vhdl-in-literal)))) 7822 (vhdl-in-literal))))
@@ -7872,7 +7942,7 @@ end of line, do nothing in comments and strings."
7872 (replace-match "\\2"))) 7942 (replace-match "\\2")))
7873 ;; surround operator symbols by one space 7943 ;; surround operator symbols by one space
7874 (goto-char beg) 7944 (goto-char beg)
7875 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\|\\\\[^\\\n]*[\\\n]\\)\\|\\(\\([^/:<>=]\\)\\(:\\|\\??=\\|\\??<<\\|\\??>>\\|\\??<\\|\\??>\\|:=\\|\\??<=\\|\\??>=\\|=>\\|\\??/=\\|\\?\\?\\)\\([^=>]\\|$\\)\\)" end t) 7945 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\|\\\\[^\\\n]*[\\\n]\\)\\|\\(\\([^/:<>=\n]\\)\\(:\\|\\??=\\|\\??<<\\|\\??>>\\|\\??<\\|\\??>\\|:=\\|\\??<=\\|\\??>=\\|=>\\|\\??/=\\|\\?\\?\\)\\([^=>\n]\\|$\\)\\)" end t)
7876 (if (or (match-string 1) 7946 (if (or (match-string 1)
7877 (<= (match-beginning 0) ; not if at boi 7947 (<= (match-beginning 0) ; not if at boi
7878 (save-excursion (back-to-indentation) (point)))) 7948 (save-excursion (back-to-indentation) (point))))
@@ -7906,6 +7976,154 @@ end of line, do nothing in comments."
7906 (vhdl-fixup-whitespace-region (point-min) (point-max))) 7976 (vhdl-fixup-whitespace-region (point-min) (point-max)))
7907 7977
7908;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7978;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7979;; Case fixing
7980
7981(defun vhdl-fix-case-region-1 (beg end upper-case word-regexp &optional count)
7982 "Convert all words matching WORD-REGEXP in region to lower or upper case,
7983depending on parameter UPPER-CASE."
7984 (let ((case-replace nil)
7985 (last-update 0))
7986 (vhdl-prepare-search-2
7987 (save-excursion
7988 (goto-char end)
7989 (setq end (point-marker))
7990 (goto-char beg)
7991 (while (re-search-forward word-regexp end t)
7992 (or (vhdl-in-literal)
7993 (if upper-case
7994 (upcase-word -1)
7995 (downcase-word -1)))
7996 (when (and count vhdl-progress-interval (not noninteractive)
7997 (< vhdl-progress-interval
7998 (- (nth 1 (current-time)) last-update)))
7999 (message "Fixing case... (%2d%s)"
8000 (+ (* count 20) (/ (* 20 (- (point) beg)) (- end beg)))
8001 "%")
8002 (setq last-update (nth 1 (current-time)))))
8003 (goto-char end)))))
8004
8005(defun vhdl-fix-case-region (beg end &optional arg)
8006 "Convert all VHDL words in region to lower or upper case, depending on
8007options vhdl-upper-case-{keywords,types,attributes,enum-values}."
8008 (interactive "r\nP")
8009 (vhdl-fix-case-region-1
8010 beg end vhdl-upper-case-keywords vhdl-keywords-regexp 0)
8011 (vhdl-fix-case-region-1
8012 beg end vhdl-upper-case-types vhdl-types-regexp 1)
8013 (vhdl-fix-case-region-1
8014 beg end vhdl-upper-case-attributes (concat "'" vhdl-attributes-regexp) 2)
8015 (vhdl-fix-case-region-1
8016 beg end vhdl-upper-case-enum-values vhdl-enum-values-regexp 3)
8017 (vhdl-fix-case-region-1
8018 beg end vhdl-upper-case-constants vhdl-constants-regexp 4)
8019 (when vhdl-progress-interval (message "Fixing case...done")))
8020
8021(defun vhdl-fix-case-buffer ()
8022 "Convert all VHDL words in buffer to lower or upper case, depending on
8023options vhdl-upper-case-{keywords,types,attributes,enum-values}."
8024 (interactive)
8025 (vhdl-fix-case-region (point-min) (point-max)))
8026
8027(defun vhdl-fix-case-word (&optional arg)
8028 "Convert word after cursor to upper case if necessary."
8029 (interactive "p")
8030 (save-excursion
8031 (when arg (backward-word 1))
8032 (vhdl-prepare-search-1
8033 (when (and vhdl-upper-case-keywords
8034 (looking-at vhdl-keywords-regexp))
8035 (upcase-word 1))
8036 (when (and vhdl-upper-case-types
8037 (looking-at vhdl-types-regexp))
8038 (upcase-word 1))
8039 (when (and vhdl-upper-case-attributes
8040 (looking-at vhdl-attributes-regexp))
8041 (upcase-word 1))
8042 (when (and vhdl-upper-case-enum-values
8043 (looking-at vhdl-enum-values-regexp))
8044 (upcase-word 1))
8045 (when (and vhdl-upper-case-constants
8046 (looking-at vhdl-constants-regexp))
8047 (upcase-word 1)))))
8048
8049;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8050;; Fix statements
8051;; - force each statement to be on a separate line except when on same line
8052;; with 'end' keyword
8053
8054(defun vhdl-fix-statement-region (beg end &optional arg)
8055 "Force statements in region on separate line except when on same line
8056with 'end' keyword (necessary for correct indentation).
8057Currently supported keywords: 'begin', 'if'."
8058 (interactive "r\nP")
8059 (vhdl-prepare-search-2
8060 (let (point)
8061 (save-excursion
8062 (goto-char end)
8063 (setq end (point-marker))
8064 (goto-char beg)
8065 ;; `begin' keyword
8066 (while (re-search-forward
8067 "^\\s-*[^ \t\n].*?\\(\\<begin\\>\\)\\(.*\\<end\\>\\)?" end t)
8068 (goto-char (match-end 0))
8069 (setq point (point-marker))
8070 (when (and (match-string 1)
8071 (or (not (match-string 2))
8072 (save-excursion (goto-char (match-end 2))
8073 (vhdl-in-literal)))
8074 (not (save-excursion (goto-char (match-beginning 1))
8075 (vhdl-in-literal))))
8076 (goto-char (match-beginning 1))
8077 (insert "\n")
8078 (indent-according-to-mode))
8079 (goto-char point))
8080 (goto-char beg)
8081 ;; `for', `if' keywords
8082 (while (re-search-forward "\\<\\(for\\|if\\)\\>" end t)
8083 (goto-char (match-end 1))
8084 (setq point (point-marker))
8085 ;; exception: in literal or preceded by `end' or label
8086 (when (and (not (save-excursion (goto-char (match-beginning 1))
8087 (vhdl-in-literal)))
8088 (save-excursion
8089 (beginning-of-line 1)
8090 (save-match-data
8091 (and (re-search-forward "^\\s-*\\([^ \t\n].*\\)"
8092 (match-beginning 1) t)
8093 (not (string-match
8094 "\\(\\<end\\>\\|\\<wait\\>\\|\\w+\\s-*:\\)\\s-*$"
8095 (match-string 1)))))))
8096 (goto-char (match-beginning 1))
8097 (insert "\n")
8098 (indent-according-to-mode))
8099 (goto-char point))))))
8100
8101(defun vhdl-fix-statement-buffer ()
8102 "Force statements in buffer on separate line except when on same line
8103with 'end' keyword (necessary for correct indentation)."
8104 (interactive)
8105 (vhdl-fix-statement-region (point-min) (point-max)))
8106
8107;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8108;; Trailing spaces
8109
8110(defun vhdl-remove-trailing-spaces-region (beg end &optional arg)
8111 "Remove trailing spaces in region."
8112 (interactive "r\nP")
8113 (save-excursion
8114 (goto-char end)
8115 (setq end (point-marker))
8116 (goto-char beg)
8117 (while (re-search-forward "[ \t]+$" end t)
8118 (unless (vhdl-in-literal)
8119 (replace-match "" nil nil)))))
8120
8121(defun vhdl-remove-trailing-spaces ()
8122 "Remove trailing spaces in buffer."
8123 (interactive)
8124 (vhdl-remove-trailing-spaces-region (point-min) (point-max)))
8125
8126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7909;; Beautify 8127;; Beautify
7910 8128
7911(defun vhdl-beautify-region (beg end) 8129(defun vhdl-beautify-region (beg end)
@@ -7915,10 +8133,17 @@ case fixing to a region. Calls functions `vhdl-indent-buffer',
7915`vhdl-fix-case-buffer'." 8133`vhdl-fix-case-buffer'."
7916 (interactive "r") 8134 (interactive "r")
7917 (setq end (save-excursion (goto-char end) (point-marker))) 8135 (setq end (save-excursion (goto-char end) (point-marker)))
7918 (vhdl-indent-region beg end) 8136 (save-excursion ; remove DOS EOL characters in UNIX file
8137 (goto-char beg)
8138 (while (search-forward " " nil t)
8139 (replace-match "" nil t)))
8140 (when (nth 0 vhdl-beautify-options) (vhdl-fixup-whitespace-region beg end t))
8141 (when (nth 1 vhdl-beautify-options) (vhdl-fix-statement-region beg end))
8142 (when (nth 2 vhdl-beautify-options) (vhdl-indent-region beg end))
7919 (let ((vhdl-align-groups t)) 8143 (let ((vhdl-align-groups t))
7920 (vhdl-align-region beg end)) 8144 (when (nth 3 vhdl-beautify-options) (vhdl-align-region beg end)))
7921 (vhdl-fix-case-region beg end)) 8145 (when (nth 4 vhdl-beautify-options) (vhdl-fix-case-region beg end))
8146 (when (nth 0 vhdl-beautify-options) (vhdl-remove-trailing-spaces-region beg end)))
7922 8147
7923(defun vhdl-beautify-buffer () 8148(defun vhdl-beautify-buffer ()
7924 "Beautify buffer by applying indentation, whitespace fixup, alignment, and 8149 "Beautify buffer by applying indentation, whitespace fixup, alignment, and
@@ -8014,7 +8239,8 @@ buffer."
8014 (while (re-search-forward "^\\s-*\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?process\\>" nil t) 8239 (while (re-search-forward "^\\s-*\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?process\\>" nil t)
8015 (goto-char (match-beginning 0)) 8240 (goto-char (match-beginning 0))
8016 (condition-case nil (vhdl-update-sensitivity-list) (error ""))) 8241 (condition-case nil (vhdl-update-sensitivity-list) (error "")))
8017 (message "Updating sensitivity lists...done")))) 8242 (message "Updating sensitivity lists...done")))
8243 (when noninteractive (save-buffer)))
8018 8244
8019(defun vhdl-update-sensitivity-list () 8245(defun vhdl-update-sensitivity-list ()
8020 "Update sensitivity list." 8246 "Update sensitivity list."
@@ -8040,57 +8266,57 @@ buffer."
8040 (scan-regions-list 8266 (scan-regions-list
8041 '(;; right-hand side of signal/variable assignment 8267 '(;; right-hand side of signal/variable assignment
8042 ;; (special case: "<=" is relational operator in a condition) 8268 ;; (special case: "<=" is relational operator in a condition)
8043 ((re-search-forward "[<:]=" proc-end t) 8269 ((vhdl-re-search-forward "[<:]=" proc-end t)
8044 (re-search-forward ";\\|\\<\\(then\\|loop\\|report\\|severity\\|is\\)\\>" proc-end t)) 8270 (vhdl-re-search-forward ";\\|\\<\\(then\\|loop\\|report\\|severity\\|is\\)\\>" proc-end t))
8045 ;; if condition 8271 ;; if condition
8046 ((re-search-forward "^\\s-*if\\>" proc-end t) 8272 ((vhdl-re-search-forward "^\\s-*if\\>" proc-end t)
8047 (re-search-forward "\\<then\\>" proc-end t)) 8273 (vhdl-re-search-forward "\\<then\\>" proc-end t))
8048 ;; elsif condition 8274 ;; elsif condition
8049 ((re-search-forward "\\<elsif\\>" proc-end t) 8275 ((vhdl-re-search-forward "\\<elsif\\>" proc-end t)
8050 (re-search-forward "\\<then\\>" proc-end t)) 8276 (vhdl-re-search-forward "\\<then\\>" proc-end t))
8051 ;; while loop condition 8277 ;; while loop condition
8052 ((re-search-forward "^\\s-*while\\>" proc-end t) 8278 ((vhdl-re-search-forward "^\\s-*while\\>" proc-end t)
8053 (re-search-forward "\\<loop\\>" proc-end t)) 8279 (vhdl-re-search-forward "\\<loop\\>" proc-end t))
8054 ;; exit/next condition 8280 ;; exit/next condition
8055 ((re-search-forward "\\<\\(exit\\|next\\)\\s-+\\w+\\s-+when\\>" proc-end t) 8281 ((vhdl-re-search-forward "\\<\\(exit\\|next\\)\\s-+\\w+\\s-+when\\>" proc-end t)
8056 (re-search-forward ";" proc-end t)) 8282 (vhdl-re-search-forward ";" proc-end t))
8057 ;; assert condition 8283 ;; assert condition
8058 ((re-search-forward "\\<assert\\>" proc-end t) 8284 ((vhdl-re-search-forward "\\<assert\\>" proc-end t)
8059 (re-search-forward "\\(\\<report\\>\\|\\<severity\\>\\|;\\)" proc-end t)) 8285 (vhdl-re-search-forward "\\(\\<report\\>\\|\\<severity\\>\\|;\\)" proc-end t))
8060 ;; case expression 8286 ;; case expression
8061 ((re-search-forward "^\\s-*case\\>" proc-end t) 8287 ((vhdl-re-search-forward "^\\s-*case\\>" proc-end t)
8062 (re-search-forward "\\<is\\>" proc-end t)) 8288 (vhdl-re-search-forward "\\<is\\>" proc-end t))
8063 ;; parameter list of procedure call, array index 8289 ;; parameter list of procedure call, array index
8064 ((and (re-search-forward "^\\s-*\\(\\w\\|\\.\\)+[ \t\n\r\f]*(" proc-end t) 8290 ((and (re-search-forward "^\\s-*\\(\\w\\|\\.\\)+[ \t\n\r\f]*(" proc-end t)
8065 (1- (point))) 8291 (1- (point)))
8066 (progn (backward-char) (forward-sexp) 8292 (progn (backward-char) (forward-sexp)
8067 (while (looking-at "(") (forward-sexp)) (point))))) 8293 (while (looking-at "(") (forward-sexp)) (point)))))
8068 name field read-list sens-list signal-list 8294 name field read-list sens-list signal-list tmp-list
8069 sens-beg sens-end beg end margin) 8295 sens-beg sens-end beg end margin)
8070 ;; scan for signals in old sensitivity list 8296 ;; scan for signals in old sensitivity list
8071 (goto-char proc-beg) 8297 (goto-char proc-beg)
8072 (re-search-forward "\\<process\\>" proc-mid t) 8298 (vhdl-re-search-forward "\\<process\\>" proc-mid t)
8073 (if (not (looking-at "[ \t\n\r\f]*(")) 8299 (if (not (looking-at "[ \t\n\r\f]*("))
8074 (setq sens-beg (point)) 8300 (setq sens-beg (point))
8075 (setq sens-beg (re-search-forward "\\([ \t\n\r\f]*\\)([ \t\n\r\f]*" nil t)) 8301 (setq sens-beg (vhdl-re-search-forward "\\([ \t\n\r\f]*\\)([ \t\n\r\f]*" nil t))
8076 (goto-char (match-end 1)) 8302 (goto-char (match-end 1))
8077 (forward-sexp) 8303 (forward-sexp)
8078 (setq sens-end (1- (point))) 8304 (setq sens-end (1- (point)))
8079 (goto-char sens-beg) 8305 (goto-char sens-beg)
8080 (while (and (re-search-forward "\\(\\w+\\)" sens-end t) 8306 (while (and (vhdl-re-search-forward "\\(\\w+\\)" sens-end t)
8081 (setq sens-list 8307 (setq sens-list
8082 (cons (downcase (match-string 0)) sens-list)) 8308 (cons (downcase (match-string 0)) sens-list))
8083 (re-search-forward "\\s-*,\\s-*" sens-end t)))) 8309 (vhdl-re-search-forward "\\s-*,\\s-*" sens-end t))))
8084 (setq signal-list (append visible-list sens-list)) 8310 (setq signal-list (append visible-list sens-list))
8085 ;; search for sequential parts 8311 ;; search for sequential parts
8086 (goto-char proc-mid) 8312 (goto-char proc-mid)
8087 (while (setq beg (re-search-forward "^\\s-*\\(els\\)?if\\>" proc-end t)) 8313 (while (setq beg (re-search-forward "^\\s-*\\(els\\)?if\\>" proc-end t))
8088 (setq end (re-search-forward "\\<then\\>" proc-end t)) 8314 (setq end (vhdl-re-search-forward "\\<then\\>" proc-end t))
8089 (when (re-search-backward "\\('event\\|\\<\\(falling\\|rising\\)_edge\\)\\>" beg t) 8315 (when (vhdl-re-search-backward "\\('event\\|\\<\\(falling\\|rising\\)_edge\\)\\>" beg t)
8090 (goto-char end) 8316 (goto-char end)
8091 (backward-word 1) 8317 (backward-word 1)
8092 (vhdl-forward-sexp) 8318 (vhdl-forward-sexp)
8093 (setq seq-region-list (cons (cons end (point)) seq-region-list)) 8319 (push (cons end (point)) seq-region-list)
8094 (beginning-of-line))) 8320 (beginning-of-line)))
8095 ;; scan for signals read in process 8321 ;; scan for signals read in process
8096 (while scan-regions-list 8322 (while scan-regions-list
@@ -8107,15 +8333,35 @@ buffer."
8107 (and tmp-list (< (point) (cdar tmp-list)))))) 8333 (and tmp-list (< (point) (cdar tmp-list))))))
8108 (while (vhdl-re-search-forward "[^'\".]\\<\\([a-zA-Z]\\w*\\)\\(\\(\\.\\w+\\|[ \t\n\r\f]*([^)]*)\\)*\\)[ \t\n\r\f]*\\('\\(\\w+\\)\\|\\(=>\\)\\)?" end t) 8334 (while (vhdl-re-search-forward "[^'\".]\\<\\([a-zA-Z]\\w*\\)\\(\\(\\.\\w+\\|[ \t\n\r\f]*([^)]*)\\)*\\)[ \t\n\r\f]*\\('\\(\\w+\\)\\|\\(=>\\)\\)?" end t)
8109 (setq name (match-string 1)) 8335 (setq name (match-string 1))
8336 ;; get array index range
8110 (when vhdl-array-index-record-field-in-sensitivity-list 8337 (when vhdl-array-index-record-field-in-sensitivity-list
8111 (setq field (match-string 2))) 8338 (setq field (match-string 2))
8339 ;; not use if it includes a variable name
8340 (save-match-data
8341 (setq tmp-list visible-list)
8342 (while (and field tmp-list)
8343 (when (string-match
8344 (concat "\\<" (car tmp-list) "\\>") field)
8345 (setq field nil))
8346 (setq tmp-list (cdr tmp-list)))))
8112 (when (and (not (match-string 6)) ; not when formal parameter 8347 (when (and (not (match-string 6)) ; not when formal parameter
8113 (not (and (match-string 5) ; not event attribute 8348 (not (and (match-string 5) ; not event attribute
8114 (not (member (downcase (match-string 5)) 8349 (not (member (downcase (match-string 5))
8115 '("event" "last_event" "transaction"))))) 8350 '("event" "last_event" "transaction")))))
8116 (member (downcase name) signal-list)) 8351 (member (downcase name) signal-list))
8117 (unless (member-ignore-case (concat name field) read-list) 8352 ;; not add if name or name+field already exists
8118 (setq read-list (cons (concat name field) read-list)))) 8353 (unless
8354 (or (member-ignore-case name read-list)
8355 (member-ignore-case (concat name field) read-list))
8356 (push (concat name field) read-list))
8357 (setq tmp-list read-list)
8358 ;; remove existing name+field if name is added
8359 (save-match-data
8360 (while tmp-list
8361 (when (string-match (concat "^" name field "[(.]")
8362 (car tmp-list))
8363 (setq read-list (delete (car tmp-list) read-list)))
8364 (setq tmp-list (cdr tmp-list)))))
8119 (goto-char (match-end 1))))) 8365 (goto-char (match-end 1)))))
8120 (setq scan-regions-list (cdr scan-regions-list))) 8366 (setq scan-regions-list (cdr scan-regions-list)))
8121 ;; update sensitivity list 8367 ;; update sensitivity list
@@ -8171,7 +8417,7 @@ buffer."
8171 (while (< (point) end) 8417 (while (< (point) end)
8172 (when (looking-at "signal[ \t\n\r\f]+") 8418 (when (looking-at "signal[ \t\n\r\f]+")
8173 (goto-char (match-end 0))) 8419 (goto-char (match-end 0)))
8174 (while (looking-at "\\(\\w+\\)[ \t\n\r\f,]+") 8420 (while (looking-at "\\([a-zA-Z]\\w*\\)[ \t\n\r\f,]+")
8175 (setq signal-list 8421 (setq signal-list
8176 (cons (downcase (match-string 1)) signal-list)) 8422 (cons (downcase (match-string 1)) signal-list))
8177 (goto-char (match-end 0)) 8423 (goto-char (match-end 0))
@@ -8190,12 +8436,12 @@ buffer."
8190 (when (= 0 (nth 0 (parse-partial-sexp beg (point)))) 8436 (when (= 0 (nth 0 (parse-partial-sexp beg (point))))
8191 (if (match-string 2) 8437 (if (match-string 2)
8192 ;; scan signal name 8438 ;; scan signal name
8193 (while (looking-at "[ \t\n\r\f,]+\\(\\w+\\)") 8439 (while (looking-at "[ \t\n\r\f,]+\\([a-zA-Z]\\w*\\)")
8194 (setq signal-list 8440 (setq signal-list
8195 (cons (downcase (match-string 1)) signal-list)) 8441 (cons (downcase (match-string 1)) signal-list))
8196 (goto-char (match-end 0))) 8442 (goto-char (match-end 0)))
8197 ;; scan alias name, check is alias of (declared) signal 8443 ;; scan alias name, check is alias of (declared) signal
8198 (when (and (looking-at "[ \t\n\r\f]+\\(\\w+\\)[^;]*\\<is[ \t\n\r\f]+\\(\\w+\\)") 8444 (when (and (looking-at "[ \t\n\r\f]+\\([a-zA-Z]\\w*\\)[^;]*\\<is[ \t\n\r\f]+\\([a-zA-Z]\\w*\\)")
8199 (member (downcase (match-string 2)) signal-list)) 8445 (member (downcase (match-string 2)) signal-list))
8200 (setq signal-list 8446 (setq signal-list
8201 (cons (downcase (match-string 1)) signal-list)) 8447 (cons (downcase (match-string 1)) signal-list))
@@ -8283,19 +8529,6 @@ buffer."
8283 (goto-char end) 8529 (goto-char end)
8284 (insert ")"))))))) 8530 (insert ")")))))))
8285 8531
8286;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8287;; Miscellaneous
8288
8289(defun vhdl-remove-trailing-spaces ()
8290 "Remove trailing spaces in the whole buffer."
8291 (interactive)
8292 (save-match-data
8293 (save-excursion
8294 (goto-char (point-min))
8295 (while (re-search-forward "[ \t]+$" (point-max) t)
8296 (unless (vhdl-in-literal)
8297 (replace-match "" nil nil))))))
8298
8299 8532
8300;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 8533;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8301;;; Electrification 8534;;; Electrification
@@ -8391,7 +8624,7 @@ is omitted or nil."
8391(defun vhdl-electric-quote (count) "'' --> \"" 8624(defun vhdl-electric-quote (count) "'' --> \""
8392 (interactive "p") 8625 (interactive "p")
8393 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) 8626 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8394 (if (= (preceding-char) last-input-event) 8627 (if (= (preceding-char) vhdl-last-input-event)
8395 (progn (delete-char -1) (insert-char ?\" 1)) 8628 (progn (delete-char -1) (insert-char ?\" 1))
8396 (insert-char ?\' 1)) 8629 (insert-char ?\' 1))
8397 (self-insert-command count))) 8630 (self-insert-command count)))
@@ -8399,7 +8632,7 @@ is omitted or nil."
8399(defun vhdl-electric-semicolon (count) "';;' --> ' : ', ': ;' --> ' := '" 8632(defun vhdl-electric-semicolon (count) "';;' --> ' : ', ': ;' --> ' := '"
8400 (interactive "p") 8633 (interactive "p")
8401 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) 8634 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8402 (cond ((= (preceding-char) last-input-event) 8635 (cond ((= (preceding-char) vhdl-last-input-event)
8403 (progn (delete-char -1) 8636 (progn (delete-char -1)
8404 (unless (eq (preceding-char) ? ) (insert " ")) 8637 (unless (eq (preceding-char) ? ) (insert " "))
8405 (insert ": ") 8638 (insert ": ")
@@ -8413,7 +8646,7 @@ is omitted or nil."
8413(defun vhdl-electric-comma (count) "',,' --> ' <= '" 8646(defun vhdl-electric-comma (count) "',,' --> ' <= '"
8414 (interactive "p") 8647 (interactive "p")
8415 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) 8648 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8416 (cond ((= (preceding-char) last-input-event) 8649 (cond ((= (preceding-char) vhdl-last-input-event)
8417 (progn (delete-char -1) 8650 (progn (delete-char -1)
8418 (unless (eq (preceding-char) ? ) (insert " ")) 8651 (unless (eq (preceding-char) ? ) (insert " "))
8419 (insert "<= "))) 8652 (insert "<= ")))
@@ -8423,7 +8656,7 @@ is omitted or nil."
8423(defun vhdl-electric-period (count) "'..' --> ' => '" 8656(defun vhdl-electric-period (count) "'..' --> ' => '"
8424 (interactive "p") 8657 (interactive "p")
8425 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) 8658 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8426 (cond ((= (preceding-char) last-input-event) 8659 (cond ((= (preceding-char) vhdl-last-input-event)
8427 (progn (delete-char -1) 8660 (progn (delete-char -1)
8428 (unless (eq (preceding-char) ? ) (insert " ")) 8661 (unless (eq (preceding-char) ? ) (insert " "))
8429 (insert "=> "))) 8662 (insert "=> ")))
@@ -8433,7 +8666,7 @@ is omitted or nil."
8433(defun vhdl-electric-equal (count) "'==' --> ' == '" 8666(defun vhdl-electric-equal (count) "'==' --> ' == '"
8434 (interactive "p") 8667 (interactive "p")
8435 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) 8668 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
8436 (cond ((= (preceding-char) last-input-event) 8669 (cond ((= (preceding-char) vhdl-last-input-event)
8437 (progn (delete-char -1) 8670 (progn (delete-char -1)
8438 (unless (eq (preceding-char) ? ) (insert " ")) 8671 (unless (eq (preceding-char) ? ) (insert " "))
8439 (insert "== "))) 8672 (insert "== ")))
@@ -8704,12 +8937,13 @@ since these are almost equivalent)."
8704 "[COMPONENT | ENTITY | CONFIGURATION]" " " t)) 8937 "[COMPONENT | ENTITY | CONFIGURATION]" " " t))
8705 (setq unit (upcase (or unit ""))) 8938 (setq unit (upcase (or unit "")))
8706 (cond ((equal unit "ENTITY") 8939 (cond ((equal unit "ENTITY")
8707 (vhdl-template-field "library name" "." nil nil nil nil 8940 (let ((begin (point)))
8941 (vhdl-template-field "library name" "." t begin (point) nil
8708 (vhdl-work-library)) 8942 (vhdl-work-library))
8709 (vhdl-template-field "entity name" "(") 8943 (vhdl-template-field "entity name" "(")
8710 (if (vhdl-template-field "[architecture name]" nil t) 8944 (if (vhdl-template-field "[architecture name]" nil t)
8711 (insert ")") 8945 (insert ")")
8712 (delete-char -1))) 8946 (delete-char -1))))
8713 ((equal unit "CONFIGURATION") 8947 ((equal unit "CONFIGURATION")
8714 (vhdl-template-field "library name" "." nil nil nil nil 8948 (vhdl-template-field "library name" "." nil nil nil nil
8715 (vhdl-work-library)) 8949 (vhdl-work-library))
@@ -9845,7 +10079,7 @@ otherwise."
9845 (let ((definition 10079 (let ((definition
9846 (upcase 10080 (upcase
9847 (or (vhdl-template-field 10081 (or (vhdl-template-field
9848 "[scalar type | ARRAY | RECORD | ACCESS | FILE]" nil t) 10082 "[scalar type | ARRAY | RECORD | ACCESS | FILE | ENUM]" nil t)
9849 "")))) 10083 ""))))
9850 (cond ((equal definition "") 10084 (cond ((equal definition "")
9851 (delete-char -4) 10085 (delete-char -4)
@@ -9863,6 +10097,11 @@ otherwise."
9863 ((equal definition "FILE") 10097 ((equal definition "FILE")
9864 (vhdl-insert-keyword " OF ") 10098 (vhdl-insert-keyword " OF ")
9865 (vhdl-template-field "type" ";")) 10099 (vhdl-template-field "type" ";"))
10100 ((equal definition "ENUM")
10101 (kill-word -1)
10102 (insert "(")
10103 (setq end-pos (point-marker))
10104 (insert ");"))
9866 (t (insert ";"))) 10105 (t (insert ";")))
9867 (when mid-pos 10106 (when mid-pos
9868 (setq end-pos (point-marker)) 10107 (setq end-pos (point-marker))
@@ -10909,7 +11148,7 @@ but not if inside a comment or quote."
10909 (backward-word 1) 11148 (backward-word 1)
10910 (vhdl-case-word 1) 11149 (vhdl-case-word 1)
10911 (delete-char 1)) 11150 (delete-char 1))
10912 (let ((invoke-char last-command-event) 11151 (let ((invoke-char vhdl-last-input-event)
10913 (abbrev-mode -1) 11152 (abbrev-mode -1)
10914 (vhdl-template-invoked-by-hook t)) 11153 (vhdl-template-invoked-by-hook t))
10915 (let ((caught (catch 'abort 11154 (let ((caught (catch 'abort
@@ -11633,7 +11872,8 @@ reflected in a subsequent paste operation."
11633 ;; paste formal and actual generic 11872 ;; paste formal and actual generic
11634 (insert (car (nth 0 generic)) " => " 11873 (insert (car (nth 0 generic)) " => "
11635 (if no-constants 11874 (if no-constants
11636 (car (nth 0 generic)) 11875 (vhdl-replace-string vhdl-actual-generic-name
11876 (car (nth 0 generic)))
11637 (or (nth 2 generic) ""))) 11877 (or (nth 2 generic) "")))
11638 (setq generic-list (cdr generic-list)) 11878 (setq generic-list (cdr generic-list))
11639 (insert (if generic-list "," ")")) 11879 (insert (if generic-list "," ")"))
@@ -11776,7 +12016,7 @@ reflected in a subsequent paste operation."
11776 ;; paste generic constants 12016 ;; paste generic constants
11777 (setq name (nth 0 generic)) 12017 (setq name (nth 0 generic))
11778 (when name 12018 (when name
11779 (insert (car name)) 12019 (insert (vhdl-replace-string vhdl-actual-generic-name (car name)))
11780 ;; paste type 12020 ;; paste type
11781 (insert " : " (nth 1 generic)) 12021 (insert " : " (nth 1 generic))
11782 ;; paste initialization 12022 ;; paste initialization
@@ -11802,7 +12042,7 @@ reflected in a subsequent paste operation."
11802 (message "Pasting port as signals...") 12042 (message "Pasting port as signals...")
11803 (unless no-indent (indent-according-to-mode)) 12043 (unless no-indent (indent-according-to-mode))
11804 (let ((margin (current-indentation)) 12044 (let ((margin (current-indentation))
11805 start port names 12045 start port names type generic-list port-name constant-name pos
11806 (port-list (nth 2 vhdl-port-list))) 12046 (port-list (nth 2 vhdl-port-list)))
11807 (when port-list 12047 (when port-list
11808 (setq start (point)) 12048 (setq start (point))
@@ -11822,7 +12062,21 @@ reflected in a subsequent paste operation."
11822 (setq names (cdr names)) 12062 (setq names (cdr names))
11823 (when names (insert ", "))) 12063 (when names (insert ", ")))
11824 ;; paste type 12064 ;; paste type
11825 (insert " : " (nth 3 port)) 12065 (setq type (nth 3 port))
12066 (setq generic-list (nth 1 vhdl-port-list))
12067 (vhdl-prepare-search-1
12068 (setq pos 0)
12069 ;; replace formal by actual generics
12070 (while generic-list
12071 (setq port-name (car (nth 0 (car generic-list))))
12072 (while (string-match (concat "\\<" port-name "\\>") type pos)
12073 (setq constant-name
12074 (save-match-data (vhdl-replace-string
12075 vhdl-actual-generic-name port-name)))
12076 (setq type (replace-match constant-name t nil type))
12077 (setq pos (match-end 0)))
12078 (setq generic-list (cdr generic-list))))
12079 (insert " : " type)
11826 ;; paste initialization (inputs only) 12080 ;; paste initialization (inputs only)
11827 (when (and initialize (nth 2 port) (equal "IN" (upcase (nth 2 port)))) 12081 (when (and initialize (nth 2 port) (equal "IN" (upcase (nth 2 port))))
11828 (insert " := " 12082 (insert " := "
@@ -12411,77 +12665,6 @@ expressions (e.g. for index ranges of types and signals)."
12411 try-expand-list-all-buffers))) 12665 try-expand-list-all-buffers)))
12412 12666
12413;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12667;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12414;; Case fixing
12415
12416(defun vhdl-fix-case-region-1 (beg end upper-case word-regexp &optional count)
12417 "Convert all words matching WORD-REGEXP in region to lower or upper case,
12418depending on parameter UPPER-CASE."
12419 (let ((case-replace nil)
12420 (last-update 0))
12421 (vhdl-prepare-search-2
12422 (save-excursion
12423 (goto-char end)
12424 (setq end (point-marker))
12425 (goto-char beg)
12426 (while (re-search-forward word-regexp end t)
12427 (or (vhdl-in-literal)
12428 (if upper-case
12429 (upcase-word -1)
12430 (downcase-word -1)))
12431 (when (and count vhdl-progress-interval (not noninteractive)
12432 (< vhdl-progress-interval
12433 (- (nth 1 (current-time)) last-update)))
12434 (message "Fixing case... (%2d%s)"
12435 (+ (* count 20) (/ (* 20 (- (point) beg)) (- end beg)))
12436 "%")
12437 (setq last-update (nth 1 (current-time)))))
12438 (goto-char end)))))
12439
12440(defun vhdl-fix-case-region (beg end &optional arg)
12441 "Convert all VHDL words in region to lower or upper case, depending on
12442options vhdl-upper-case-{keywords,types,attributes,enum-values}."
12443 (interactive "r\nP")
12444 (vhdl-fix-case-region-1
12445 beg end vhdl-upper-case-keywords vhdl-keywords-regexp 0)
12446 (vhdl-fix-case-region-1
12447 beg end vhdl-upper-case-types vhdl-types-regexp 1)
12448 (vhdl-fix-case-region-1
12449 beg end vhdl-upper-case-attributes (concat "'" vhdl-attributes-regexp) 2)
12450 (vhdl-fix-case-region-1
12451 beg end vhdl-upper-case-enum-values vhdl-enum-values-regexp 3)
12452 (vhdl-fix-case-region-1
12453 beg end vhdl-upper-case-constants vhdl-constants-regexp 4)
12454 (when vhdl-progress-interval (message "Fixing case...done")))
12455
12456(defun vhdl-fix-case-buffer ()
12457 "Convert all VHDL words in buffer to lower or upper case, depending on
12458options vhdl-upper-case-{keywords,types,attributes,enum-values}."
12459 (interactive)
12460 (vhdl-fix-case-region (point-min) (point-max)))
12461
12462(defun vhdl-fix-case-word (&optional arg)
12463 "Convert word after cursor to upper case if necessary."
12464 (interactive "p")
12465 (save-excursion
12466 (when arg (backward-word 1))
12467 (vhdl-prepare-search-1
12468 (when (and vhdl-upper-case-keywords
12469 (looking-at vhdl-keywords-regexp))
12470 (upcase-word 1))
12471 (when (and vhdl-upper-case-types
12472 (looking-at vhdl-types-regexp))
12473 (upcase-word 1))
12474 (when (and vhdl-upper-case-attributes
12475 (looking-at vhdl-attributes-regexp))
12476 (upcase-word 1))
12477 (when (and vhdl-upper-case-enum-values
12478 (looking-at vhdl-enum-values-regexp))
12479 (upcase-word 1))
12480 (when (and vhdl-upper-case-constants
12481 (looking-at vhdl-constants-regexp))
12482 (upcase-word 1)))))
12483
12484;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12485;; Line handling functions 12668;; Line handling functions
12486 12669
12487(defun vhdl-current-line () 12670(defun vhdl-current-line ()
@@ -12635,7 +12818,7 @@ it works within comments too."
12635 ;; print results 12818 ;; print results
12636 (message "\n\ 12819 (message "\n\
12637File statistics: \"%s\"\n\ 12820File statistics: \"%s\"\n\
12638---------------------\n\ 12821-----------------------\n\
12639# statements : %5d\n\ 12822# statements : %5d\n\
12640# code lines : %5d\n\ 12823# code lines : %5d\n\
12641# empty lines : %5d\n\ 12824# empty lines : %5d\n\
@@ -13486,9 +13669,9 @@ hierarchy otherwise.")
13486 (while (and (re-search-backward "^[ \t]*\\(end\\|use\\)\\>" nil t) 13669 (while (and (re-search-backward "^[ \t]*\\(end\\|use\\)\\>" nil t)
13487 (equal "USE" (upcase (match-string 1)))) 13670 (equal "USE" (upcase (match-string 1))))
13488 (when (looking-at "^[ \t]*use[ \t\n\r\f]*\\(\\w+\\)\\.\\(\\w+\\)\\.\\w+") 13671 (when (looking-at "^[ \t]*use[ \t\n\r\f]*\\(\\w+\\)\\.\\(\\w+\\)\\.\\w+")
13489 (setq lib-alist (cons (cons (match-string-no-properties 1) 13672 (push (cons (match-string-no-properties 1)
13490 (vhdl-match-string-downcase 2)) 13673 (vhdl-match-string-downcase 2))
13491 lib-alist)))))) 13674 lib-alist)))))
13492 lib-alist)) 13675 lib-alist))
13493 13676
13494(defun vhdl-scan-directory-contents (name &optional project update num-string 13677(defun vhdl-scan-directory-contents (name &optional project update num-string
@@ -13534,7 +13717,7 @@ hierarchy otherwise.")
13534 file-tmp-list) 13717 file-tmp-list)
13535 (while file-list 13718 (while file-list
13536 (unless (string-match file-exclude-regexp (car file-list)) 13719 (unless (string-match file-exclude-regexp (car file-list))
13537 (setq file-tmp-list (cons (car file-list) file-tmp-list))) 13720 (push (car file-list) file-tmp-list))
13538 (setq file-list (cdr file-list))) 13721 (setq file-list (cdr file-list)))
13539 (setq file-list (nreverse file-tmp-list)))) 13722 (setq file-list (nreverse file-tmp-list))))
13540 ;; do for all files 13723 ;; do for all files
@@ -13569,7 +13752,7 @@ hierarchy otherwise.")
13569 "Entity declared twice (used 1.): \"%s\"\n 1. in \"%s\" (line %d)\n 2. in \"%s\" (line %d)" 13752 "Entity declared twice (used 1.): \"%s\"\n 1. in \"%s\" (line %d)\n 2. in \"%s\" (line %d)"
13570 ent-name (nth 1 ent-entry) (nth 2 ent-entry) 13753 ent-name (nth 1 ent-entry) (nth 2 ent-entry)
13571 file-name (vhdl-current-line)) 13754 file-name (vhdl-current-line))
13572 (setq ent-list (cons ent-key ent-list)) 13755 (push ent-key ent-list)
13573 (aput 'ent-alist ent-key 13756 (aput 'ent-alist ent-key
13574 (list ent-name file-name (vhdl-current-line) 13757 (list ent-name file-name (vhdl-current-line)
13575 (nth 3 ent-entry) (nth 4 ent-entry) 13758 (nth 3 ent-entry) (nth 4 ent-entry)
@@ -13621,7 +13804,7 @@ hierarchy otherwise.")
13621 "Configuration declared twice (used 1.): \"%s\" of \"%s\"\n 1. in \"%s\" (line %d)\n 2. in \"%s\" (line %d)" 13804 "Configuration declared twice (used 1.): \"%s\" of \"%s\"\n 1. in \"%s\" (line %d)\n 2. in \"%s\" (line %d)"
13622 conf-name ent-name (nth 1 conf-entry) 13805 conf-name ent-name (nth 1 conf-entry)
13623 (nth 2 conf-entry) file-name conf-line) 13806 (nth 2 conf-entry) file-name conf-line)
13624 (setq conf-list (cons conf-key conf-list)) 13807 (push conf-key conf-list)
13625 ;; scan for subconfigurations and subentities 13808 ;; scan for subconfigurations and subentities
13626 (while (re-search-forward "^[ \t]*for[ \t\n\r\f]+\\(\\w+\\([ \t\n\r\f]*,[ \t\n\r\f]*\\w+\\)*\\)[ \t\n\r\f]*:[ \t\n\r\f]*\\(\\w+\\)[ \t\n\r\f]+" end-of-unit t) 13809 (while (re-search-forward "^[ \t]*for[ \t\n\r\f]+\\(\\w+\\([ \t\n\r\f]*,[ \t\n\r\f]*\\w+\\)*\\)[ \t\n\r\f]*:[ \t\n\r\f]*\\(\\w+\\)[ \t\n\r\f]+" end-of-unit t)
13627 (setq inst-comp-key (vhdl-match-string-downcase 3) 13810 (setq inst-comp-key (vhdl-match-string-downcase 3)
@@ -13684,8 +13867,8 @@ hierarchy otherwise.")
13684 (setq func-alist (nreverse func-alist)) 13867 (setq func-alist (nreverse func-alist))
13685 (setq comp-alist (nreverse comp-alist)) 13868 (setq comp-alist (nreverse comp-alist))
13686 (if is-body 13869 (if is-body
13687 (setq pack-body-list (cons pack-key pack-body-list)) 13870 (push pack-key pack-body-list)
13688 (setq pack-list (cons pack-key pack-list))) 13871 (push pack-key pack-list))
13689 (aput 13872 (aput
13690 'pack-alist pack-key 13873 'pack-alist pack-key
13691 (if is-body 13874 (if is-body
@@ -13939,7 +14122,7 @@ of PROJECT."
13939 (let ((case-fold-search nil)) 14122 (let ((case-fold-search nil))
13940 (while dir-list 14123 (while dir-list
13941 (unless (string-match file-exclude-regexp (car dir-list)) 14124 (unless (string-match file-exclude-regexp (car dir-list))
13942 (setq dir-list-tmp (cons (car dir-list) dir-list-tmp))) 14125 (push (car dir-list) dir-list-tmp))
13943 (setq dir-list (cdr dir-list))) 14126 (setq dir-list (cdr dir-list)))
13944 (setq dir-list (nreverse dir-list-tmp)))) 14127 (setq dir-list (nreverse dir-list-tmp))))
13945 (message "Collecting source files...done") 14128 (message "Collecting source files...done")
@@ -14331,7 +14514,7 @@ if required."
14331;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 14514;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
14332;; Add hierarchy browser functionality to speedbar 14515;; Add hierarchy browser functionality to speedbar
14333 14516
14334(defvar vhdl-speedbar-key-map nil 14517(defvar vhdl-speedbar-mode-map nil
14335 "Keymap used when in the VHDL hierarchy browser mode.") 14518 "Keymap used when in the VHDL hierarchy browser mode.")
14336 14519
14337(defvar vhdl-speedbar-menu-items nil 14520(defvar vhdl-speedbar-menu-items nil
@@ -14359,24 +14542,24 @@ if required."
14359 (speedbar-item-info . vhdl-speedbar-item-info) 14542 (speedbar-item-info . vhdl-speedbar-item-info)
14360 (speedbar-line-directory . vhdl-speedbar-line-project))) 14543 (speedbar-line-directory . vhdl-speedbar-line-project)))
14361 ;; keymap 14544 ;; keymap
14362 (unless vhdl-speedbar-key-map 14545 (unless vhdl-speedbar-mode-map
14363 (setq vhdl-speedbar-key-map (speedbar-make-specialized-keymap)) 14546 (setq vhdl-speedbar-mode-map (speedbar-make-specialized-keymap))
14364 (define-key vhdl-speedbar-key-map "e" 'speedbar-edit-line) 14547 (define-key vhdl-speedbar-mode-map "e" 'speedbar-edit-line)
14365 (define-key vhdl-speedbar-key-map "\C-m" 'speedbar-edit-line) 14548 (define-key vhdl-speedbar-mode-map "\C-m" 'speedbar-edit-line)
14366 (define-key vhdl-speedbar-key-map "+" 'speedbar-expand-line) 14549 (define-key vhdl-speedbar-mode-map "+" 'speedbar-expand-line)
14367 (define-key vhdl-speedbar-key-map "=" 'speedbar-expand-line) 14550 (define-key vhdl-speedbar-mode-map "=" 'speedbar-expand-line)
14368 (define-key vhdl-speedbar-key-map "-" 'vhdl-speedbar-contract-level) 14551 (define-key vhdl-speedbar-mode-map "-" 'vhdl-speedbar-contract-level)
14369 (define-key vhdl-speedbar-key-map "_" 'vhdl-speedbar-contract-all) 14552 (define-key vhdl-speedbar-mode-map "_" 'vhdl-speedbar-contract-all)
14370 (define-key vhdl-speedbar-key-map "C" 'vhdl-speedbar-port-copy) 14553 (define-key vhdl-speedbar-mode-map "C" 'vhdl-speedbar-port-copy)
14371 (define-key vhdl-speedbar-key-map "P" 'vhdl-speedbar-place-component) 14554 (define-key vhdl-speedbar-mode-map "P" 'vhdl-speedbar-place-component)
14372 (define-key vhdl-speedbar-key-map "F" 'vhdl-speedbar-configuration) 14555 (define-key vhdl-speedbar-mode-map "F" 'vhdl-speedbar-configuration)
14373 (define-key vhdl-speedbar-key-map "A" 'vhdl-speedbar-select-mra) 14556 (define-key vhdl-speedbar-mode-map "A" 'vhdl-speedbar-select-mra)
14374 (define-key vhdl-speedbar-key-map "K" 'vhdl-speedbar-make-design) 14557 (define-key vhdl-speedbar-mode-map "K" 'vhdl-speedbar-make-design)
14375 (define-key vhdl-speedbar-key-map "R" 'vhdl-speedbar-rescan-hierarchy) 14558 (define-key vhdl-speedbar-mode-map "R" 'vhdl-speedbar-rescan-hierarchy)
14376 (define-key vhdl-speedbar-key-map "S" 'vhdl-save-caches) 14559 (define-key vhdl-speedbar-mode-map "S" 'vhdl-save-caches)
14377 (let ((key 0)) 14560 (let ((key 0))
14378 (while (<= key 9) 14561 (while (<= key 9)
14379 (define-key vhdl-speedbar-key-map (int-to-string key) 14562 (define-key vhdl-speedbar-mode-map (int-to-string key)
14380 `(lambda () (interactive) (vhdl-speedbar-set-depth ,key))) 14563 `(lambda () (interactive) (vhdl-speedbar-set-depth ,key)))
14381 (setq key (1+ key))))) 14564 (setq key (1+ key)))))
14382 (define-key speedbar-mode-map "h" 14565 (define-key speedbar-mode-map "h"
@@ -14429,10 +14612,10 @@ if required."
14429 ["Save Caches" vhdl-save-caches vhdl-updated-project-list]))) 14612 ["Save Caches" vhdl-save-caches vhdl-updated-project-list])))
14430 ;; hook-ups 14613 ;; hook-ups
14431 (speedbar-add-expansion-list 14614 (speedbar-add-expansion-list
14432 '("vhdl directory" vhdl-speedbar-menu-items vhdl-speedbar-key-map 14615 '("vhdl directory" vhdl-speedbar-menu-items vhdl-speedbar-mode-map
14433 vhdl-speedbar-display-directory)) 14616 vhdl-speedbar-display-directory))
14434 (speedbar-add-expansion-list 14617 (speedbar-add-expansion-list
14435 '("vhdl project" vhdl-speedbar-menu-items vhdl-speedbar-key-map 14618 '("vhdl project" vhdl-speedbar-menu-items vhdl-speedbar-mode-map
14436 vhdl-speedbar-display-projects)) 14619 vhdl-speedbar-display-projects))
14437 (setq speedbar-stealthy-function-list 14620 (setq speedbar-stealthy-function-list
14438 (append 14621 (append
@@ -14719,15 +14902,15 @@ otherwise use cached data."
14719 (setq arch-alist (nth 4 (car ent-alist))) 14902 (setq arch-alist (nth 4 (car ent-alist)))
14720 (setq subunit-alist nil) 14903 (setq subunit-alist nil)
14721 (while arch-alist 14904 (while arch-alist
14722 (setq subunit-alist (cons (caar arch-alist) subunit-alist)) 14905 (push (caar arch-alist) subunit-alist)
14723 (setq arch-alist (cdr arch-alist))) 14906 (setq arch-alist (cdr arch-alist)))
14724 (setq unit-alist (cons (list (caar ent-alist) subunit-alist) unit-alist)) 14907 (push (list (caar ent-alist) subunit-alist) unit-alist)
14725 (setq ent-alist (cdr ent-alist))) 14908 (setq ent-alist (cdr ent-alist)))
14726 (while conf-alist 14909 (while conf-alist
14727 (setq unit-alist (cons (list (caar conf-alist)) unit-alist)) 14910 (push (list (caar conf-alist)) unit-alist)
14728 (setq conf-alist (cdr conf-alist))) 14911 (setq conf-alist (cdr conf-alist)))
14729 (while pack-alist 14912 (while pack-alist
14730 (setq unit-alist (cons (list (caar pack-alist)) unit-alist)) 14913 (push (list (caar pack-alist)) unit-alist)
14731 (setq pack-alist (cdr pack-alist))) 14914 (setq pack-alist (cdr pack-alist)))
14732 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist) 14915 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
14733 (vhdl-speedbar-refresh) 14916 (vhdl-speedbar-refresh)
@@ -15367,7 +15550,7 @@ NO-POSITION non-nil means do not re-position cursor."
15367 (concat (speedbar-line-directory indent) token)))) 15550 (concat (speedbar-line-directory indent) token))))
15368 (while oldl 15551 (while oldl
15369 (if (not (string-match (concat "^" (regexp-quote td)) (car oldl))) 15552 (if (not (string-match (concat "^" (regexp-quote td)) (car oldl)))
15370 (setq newl (cons (car oldl) newl))) 15553 (push (car oldl) newl))
15371 (setq oldl (cdr oldl))) 15554 (setq oldl (cdr oldl)))
15372 (setq speedbar-shown-directories (nreverse newl))) 15555 (setq speedbar-shown-directories (nreverse newl)))
15373 (speedbar-change-expand-button-char ?+) 15556 (speedbar-change-expand-button-char ?+)
@@ -15474,7 +15657,7 @@ NO-POSITION non-nil means do not re-position cursor."
15474 (setq dir (car path-list)) 15657 (setq dir (car path-list))
15475 (string-match "\\(-r \\)?\\(\\([^?*]*[/\\]\\)*\\)" dir) 15658 (string-match "\\(-r \\)?\\(\\([^?*]*[/\\]\\)*\\)" dir)
15476 (if (file-directory-p (match-string 2 dir)) 15659 (if (file-directory-p (match-string 2 dir))
15477 (setq path-list-1 (cons dir path-list-1)) 15660 (push dir path-list-1)
15478 (vhdl-warning-when-idle "No such directory: \"%s\"" (match-string 2 dir))) 15661 (vhdl-warning-when-idle "No such directory: \"%s\"" (match-string 2 dir)))
15479 (setq path-list (cdr path-list))) 15662 (setq path-list (cdr path-list)))
15480 ;; resolve path wildcards 15663 ;; resolve path wildcards
@@ -15496,13 +15679,13 @@ NO-POSITION non-nil means do not re-position cursor."
15496 dir-list) 15679 dir-list)
15497 (while all-list 15680 (while all-list
15498 (when (file-directory-p (car all-list)) 15681 (when (file-directory-p (car all-list))
15499 (setq dir-list (cons (car all-list) dir-list))) 15682 (push (car all-list) dir-list))
15500 (setq all-list (cdr all-list))) 15683 (setq all-list (cdr all-list)))
15501 dir-list)) 15684 dir-list))
15502 (cdr path-list-1)))) 15685 (cdr path-list-1))))
15503 (string-match "\\(-r \\)?\\(.*\\)[/\\].*" dir) 15686 (string-match "\\(-r \\)?\\(.*\\)[/\\].*" dir)
15504 (when (file-directory-p (match-string 2 dir)) 15687 (when (file-directory-p (match-string 2 dir))
15505 (setq path-list-2 (cons dir path-list-2))) 15688 (push dir path-list-2))
15506 (setq path-list-1 (cdr path-list-1)))) 15689 (setq path-list-1 (cdr path-list-1))))
15507 (nreverse path-list-2))) 15690 (nreverse path-list-2)))
15508 15691
@@ -15527,8 +15710,7 @@ is already shown in a buffer."
15527 (let ((buffer (get-file-buffer (car token)))) 15710 (let ((buffer (get-file-buffer (car token))))
15528 (speedbar-find-file-in-frame (car token)) 15711 (speedbar-find-file-in-frame (car token))
15529 (when (or vhdl-speedbar-jump-to-unit buffer) 15712 (when (or vhdl-speedbar-jump-to-unit buffer)
15530 (goto-char (point-min)) 15713 (vhdl-goto-line (cdr token))
15531 (forward-line (1- (cdr token)))
15532 (recenter)) 15714 (recenter))
15533 (vhdl-speedbar-update-current-unit t t) 15715 (vhdl-speedbar-update-current-unit t t)
15534 (speedbar-set-timer dframe-update-speed) 15716 (speedbar-set-timer dframe-update-speed)
@@ -15546,8 +15728,7 @@ is already shown in a buffer."
15546 (let ((token (get-text-property 15728 (let ((token (get-text-property
15547 (match-beginning 3) 'speedbar-token))) 15729 (match-beginning 3) 'speedbar-token)))
15548 (vhdl-visit-file (car token) t 15730 (vhdl-visit-file (car token) t
15549 (progn (goto-char (point-min)) 15731 (progn (vhdl-goto-line (cdr token))
15550 (forward-line (1- (cdr token)))
15551 (end-of-line) 15732 (end-of-line)
15552 (if is-entity 15733 (if is-entity
15553 (vhdl-port-copy) 15734 (vhdl-port-copy)
@@ -16000,7 +16181,7 @@ component instantiation."
16000 (or (aget generic-alist (match-string 2) t) 16181 (or (aget generic-alist (match-string 2) t)
16001 (error "ERROR: Formal generic \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name)) 16182 (error "ERROR: Formal generic \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name))
16002 (cdar generic-alist)))) 16183 (cdar generic-alist))))
16003 (setq constant-alist (cons constant-entry constant-alist)) 16184 (push constant-entry constant-alist)
16004 (setq constant-name (downcase constant-name)) 16185 (setq constant-name (downcase constant-name))
16005 (if (or (member constant-name single-list) 16186 (if (or (member constant-name single-list)
16006 (member constant-name multi-list)) 16187 (member constant-name multi-list))
@@ -16020,7 +16201,7 @@ component instantiation."
16020 (or (aget port-alist (match-string 2) t) 16201 (or (aget port-alist (match-string 2) t)
16021 (error "ERROR: Formal port \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name)) 16202 (error "ERROR: Formal port \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name))
16022 (cdar port-alist)))) 16203 (cdar port-alist))))
16023 (setq signal-alist (cons signal-entry signal-alist)) 16204 (push signal-entry signal-alist)
16024 (setq signal-name (downcase signal-name)) 16205 (setq signal-name (downcase signal-name))
16025 (if (equal (upcase (nth 2 signal-entry)) "IN") 16206 (if (equal (upcase (nth 2 signal-entry)) "IN")
16026 ;; input signal 16207 ;; input signal
@@ -16054,8 +16235,8 @@ component instantiation."
16054 (unless (match-string 1) 16235 (unless (match-string 1)
16055 (setq port-alist (cdr port-alist))) 16236 (setq port-alist (cdr port-alist)))
16056 (vhdl-forward-syntactic-ws)) 16237 (vhdl-forward-syntactic-ws))
16057 (setq inst-alist (cons (list inst-name (nreverse constant-alist) 16238 (push (list inst-name (nreverse constant-alist)
16058 (nreverse signal-alist)) inst-alist))) 16239 (nreverse signal-alist)) inst-alist))
16059 ;; prepare signal insertion 16240 ;; prepare signal insertion
16060 (vhdl-goto-marker arch-decl-pos) 16241 (vhdl-goto-marker arch-decl-pos)
16061 (forward-line 1) 16242 (forward-line 1)
@@ -16122,6 +16303,7 @@ component instantiation."
16122 (while constant-alist 16303 (while constant-alist
16123 (setq constant-name (downcase (caar constant-alist)) 16304 (setq constant-name (downcase (caar constant-alist))
16124 constant-entry (car constant-alist)) 16305 constant-entry (car constant-alist))
16306 (unless (string-match "^[0-9]+" constant-name)
16125 (cond ((member constant-name written-list) 16307 (cond ((member constant-name written-list)
16126 nil) 16308 nil)
16127 ((member constant-name multi-list) 16309 ((member constant-name multi-list)
@@ -16138,7 +16320,7 @@ component instantiation."
16138 (setq generic-end-pos 16320 (setq generic-end-pos
16139 (vhdl-compose-insert-generic constant-entry)) 16321 (vhdl-compose-insert-generic constant-entry))
16140 (setq generic-inst-pos (point-marker)) 16322 (setq generic-inst-pos (point-marker))
16141 (add-to-list 'written-list constant-name))) 16323 (add-to-list 'written-list constant-name))))
16142 (setq constant-alist (cdr constant-alist))) 16324 (setq constant-alist (cdr constant-alist)))
16143 (when (/= constant-temp-pos generic-inst-pos) 16325 (when (/= constant-temp-pos generic-inst-pos)
16144 (vhdl-goto-marker (vhdl-max-marker constant-temp-pos generic-pos)) 16326 (vhdl-goto-marker (vhdl-max-marker constant-temp-pos generic-pos))
@@ -16298,8 +16480,7 @@ current project/directory."
16298 ;; insert component declarations 16480 ;; insert component declarations
16299 (while ent-alist 16481 (while ent-alist
16300 (vhdl-visit-file (nth 2 (car ent-alist)) nil 16482 (vhdl-visit-file (nth 2 (car ent-alist)) nil
16301 (progn (goto-char (point-min)) 16483 (progn (vhdl-goto-line (nth 3 (car ent-alist)))
16302 (forward-line (1- (nth 3 (car ent-alist))))
16303 (end-of-line) 16484 (end-of-line)
16304 (vhdl-port-copy))) 16485 (vhdl-port-copy)))
16305 (goto-char component-pos) 16486 (goto-char component-pos)
@@ -16555,12 +16736,12 @@ no project is defined."
16555 (setq sublist (nth 11 (car commands-alist))) 16736 (setq sublist (nth 11 (car commands-alist)))
16556 (unless (or (equal "" (car sublist)) 16737 (unless (or (equal "" (car sublist))
16557 (assoc (car sublist) regexp-alist)) 16738 (assoc (car sublist) regexp-alist))
16558 (setq regexp-alist (cons (list (nth 0 sublist) 16739 (push (list (nth 0 sublist)
16559 (if (= 0 (nth 1 sublist)) 16740 (if (and (featurep 'xemacs) (not (nth 1 sublist)))
16560 (if (featurep 'xemacs) 9 nil) 16741 9
16561 (nth 1 sublist)) 16742 (nth 1 sublist))
16562 (nth 2 sublist) (nth 3 sublist)) 16743 (nth 2 sublist) (nth 3 sublist))
16563 regexp-alist))) 16744 regexp-alist))
16564 (setq commands-alist (cdr commands-alist))) 16745 (setq commands-alist (cdr commands-alist)))
16565 (setq compilation-error-regexp-alist 16746 (setq compilation-error-regexp-alist
16566 (append compilation-error-regexp-alist (nreverse regexp-alist)))) 16747 (append compilation-error-regexp-alist (nreverse regexp-alist))))
@@ -16573,7 +16754,7 @@ no project is defined."
16573 (setq sublist (nth 12 (car commands-alist))) 16754 (setq sublist (nth 12 (car commands-alist)))
16574 (unless (or (equal "" (car sublist)) 16755 (unless (or (equal "" (car sublist))
16575 (assoc (car sublist) regexp-alist)) 16756 (assoc (car sublist) regexp-alist))
16576 (setq regexp-alist (cons sublist regexp-alist))) 16757 (push sublist regexp-alist))
16577 (setq commands-alist (cdr commands-alist))) 16758 (setq commands-alist (cdr commands-alist)))
16578 (setq compilation-file-regexp-alist 16759 (setq compilation-file-regexp-alist
16579 (append compilation-file-regexp-alist (nreverse regexp-alist)))))) 16760 (append compilation-file-regexp-alist (nreverse regexp-alist))))))
@@ -16702,6 +16883,42 @@ specified by a target."
16702 (compile (concat (if (equal command "") "make" command) 16883 (compile (concat (if (equal command "") "make" command)
16703 " " options " " vhdl-make-target)))) 16884 " " options " " vhdl-make-target))))
16704 16885
16886;; Emacs 22+ setup
16887(defvar vhdl-error-regexp-emacs-alist
16888 ;; Get regexps from `vhdl-compiler-alist'
16889 (let ((compiler-alist vhdl-compiler-alist)
16890 (error-regexp-alist '((vhdl-directory "^ *Compiling \"\\(.+\\)\"" 1))))
16891 (while compiler-alist
16892 ;; add error message regexps
16893 (setq error-regexp-alist
16894 (cons (append (list (make-symbol (concat "vhdl-" (subst-char-in-string ? ?- (downcase (nth 0 (car compiler-alist)))))))
16895 (nth 11 (car compiler-alist)))
16896 error-regexp-alist))
16897 ;; add filename regexps
16898 (when (/= 0 (nth 1 (nth 12 (car compiler-alist))))
16899 (setq error-regexp-alist
16900 (cons (append (list (make-symbol (concat "vhdl-" (subst-char-in-string ? ?- (downcase (nth 0 (car compiler-alist)))) "-file")))
16901 (nth 12 (car compiler-alist)))
16902 error-regexp-alist)))
16903 (setq compiler-alist (cdr compiler-alist)))
16904 error-regexp-alist)
16905 "List of regexps for VHDL compilers. For Emacs 22+.")
16906
16907;; Add error regexps using compilation-mode-hook.
16908(defun vhdl-error-regexp-add-emacs ()
16909 "Set up Emacs compile for VHDL."
16910 (interactive)
16911 (when (and (boundp 'compilation-error-regexp-alist-alist)
16912 (not (assoc 'vhdl-modelsim compilation-error-regexp-alist-alist)))
16913 (mapcar
16914 (lambda (item)
16915 (push (car item) compilation-error-regexp-alist)
16916 (push item compilation-error-regexp-alist-alist))
16917 vhdl-error-regexp-emacs-alist)))
16918
16919(when vhdl-emacs-22
16920 (add-hook 'compilation-mode-hook 'vhdl-error-regexp-add-emacs))
16921
16705;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 16922;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16706;; Makefile generation 16923;; Makefile generation
16707 16924
@@ -16724,7 +16941,7 @@ specified by a target."
16724 (let (pack-list) 16941 (let (pack-list)
16725 (while lib-alist 16942 (while lib-alist
16726 (when (equal (downcase (caar lib-alist)) (downcase work-library)) 16943 (when (equal (downcase (caar lib-alist)) (downcase work-library))
16727 (setq pack-list (cons (cdar lib-alist) pack-list))) 16944 (push (cdar lib-alist) pack-list))
16728 (setq lib-alist (cdr lib-alist))) 16945 (setq lib-alist (cdr lib-alist)))
16729 pack-list)) 16946 pack-list))
16730 16947
@@ -16776,8 +16993,10 @@ specified by a target."
16776 (setq ent-entry (car ent-alist) 16993 (setq ent-entry (car ent-alist)
16777 ent-key (nth 0 ent-entry)) 16994 ent-key (nth 0 ent-entry))
16778 (when (nth 2 ent-entry) 16995 (when (nth 2 ent-entry)
16779 (setq ent-file-name (file-relative-name 16996 (setq ent-file-name (if vhdl-compile-absolute-path
16780 (nth 2 ent-entry) compile-directory) 16997 (nth 2 ent-entry)
16998 (file-relative-name (nth 2 ent-entry)
16999 compile-directory))
16781 arch-alist (nth 4 ent-entry) 17000 arch-alist (nth 4 ent-entry)
16782 lib-alist (nth 6 ent-entry) 17001 lib-alist (nth 6 ent-entry)
16783 rule (aget rule-alist ent-file-name) 17002 rule (aget rule-alist ent-file-name)
@@ -16787,9 +17006,9 @@ specified by a target."
16787 subcomp-list nil) 17006 subcomp-list nil)
16788 (setq tmp-key (vhdl-replace-string 17007 (setq tmp-key (vhdl-replace-string
16789 ent-regexp (funcall adjust-case ent-key))) 17008 ent-regexp (funcall adjust-case ent-key)))
16790 (setq unit-list (cons (cons ent-key tmp-key) unit-list)) 17009 (push (cons ent-key tmp-key) unit-list)
16791 ;; rule target for this entity 17010 ;; rule target for this entity
16792 (setq target-list (cons ent-key target-list)) 17011 (push ent-key target-list)
16793 ;; rule dependencies for all used packages 17012 ;; rule dependencies for all used packages
16794 (setq pack-list (vhdl-get-packages lib-alist work-library)) 17013 (setq pack-list (vhdl-get-packages lib-alist work-library))
16795 (setq depend-list (append depend-list pack-list)) 17014 (setq depend-list (append depend-list pack-list))
@@ -16801,8 +17020,10 @@ specified by a target."
16801 (setq arch-entry (car arch-alist) 17020 (setq arch-entry (car arch-alist)
16802 arch-key (nth 0 arch-entry) 17021 arch-key (nth 0 arch-entry)
16803 ent-arch-key (concat ent-key "-" arch-key) 17022 ent-arch-key (concat ent-key "-" arch-key)
16804 arch-file-name (file-relative-name (nth 2 arch-entry) 17023 arch-file-name (if vhdl-compile-absolute-path
16805 compile-directory) 17024 (nth 2 arch-entry)
17025 (file-relative-name (nth 2 arch-entry)
17026 compile-directory))
16806 inst-alist (nth 4 arch-entry) 17027 inst-alist (nth 4 arch-entry)
16807 lib-alist (nth 5 arch-entry) 17028 lib-alist (nth 5 arch-entry)
16808 rule (aget rule-alist arch-file-name) 17029 rule (aget rule-alist arch-file-name)
@@ -16813,11 +17034,11 @@ specified by a target."
16813 (funcall adjust-case (concat arch-key " " ent-key)))) 17034 (funcall adjust-case (concat arch-key " " ent-key))))
16814 (setq unit-list 17035 (setq unit-list
16815 (cons (cons ent-arch-key tmp-key) unit-list)) 17036 (cons (cons ent-arch-key tmp-key) unit-list))
16816 (setq second-list (cons ent-arch-key second-list)) 17037 (push ent-arch-key second-list)
16817 ;; rule target for this architecture 17038 ;; rule target for this architecture
16818 (setq target-list (cons ent-arch-key target-list)) 17039 (push ent-arch-key target-list)
16819 ;; rule dependency for corresponding entity 17040 ;; rule dependency for corresponding entity
16820 (setq depend-list (cons ent-key depend-list)) 17041 (push ent-key depend-list)
16821 ;; rule dependencies for contained component instantiations 17042 ;; rule dependencies for contained component instantiations
16822 (while inst-alist 17043 (while inst-alist
16823 (setq inst-entry (car inst-alist)) 17044 (setq inst-entry (car inst-alist))
@@ -16835,9 +17056,8 @@ specified by a target."
16835 ;; add rule 17056 ;; add rule
16836 (aput 'rule-alist arch-file-name (list target-list depend-list)) 17057 (aput 'rule-alist arch-file-name (list target-list depend-list))
16837 (setq arch-alist (cdr arch-alist))) 17058 (setq arch-alist (cdr arch-alist)))
16838 (setq prim-list (cons (list ent-key second-list 17059 (push (list ent-key second-list (append subcomp-list all-pack-list))
16839 (append subcomp-list all-pack-list)) 17060 prim-list))
16840 prim-list)))
16841 (setq ent-alist (cdr ent-alist))) 17061 (setq ent-alist (cdr ent-alist)))
16842 (setq ent-alist tmp-list) 17062 (setq ent-alist tmp-list)
16843 ;; rules for all configurations 17063 ;; rules for all configurations
@@ -16845,8 +17065,10 @@ specified by a target."
16845 (while conf-alist 17065 (while conf-alist
16846 (setq conf-entry (car conf-alist) 17066 (setq conf-entry (car conf-alist)
16847 conf-key (nth 0 conf-entry) 17067 conf-key (nth 0 conf-entry)
16848 conf-file-name (file-relative-name 17068 conf-file-name (if vhdl-compile-absolute-path
16849 (nth 2 conf-entry) compile-directory) 17069 (nth 2 conf-entry)
17070 (file-relative-name (nth 2 conf-entry)
17071 compile-directory))
16850 ent-key (nth 4 conf-entry) 17072 ent-key (nth 4 conf-entry)
16851 arch-key (nth 5 conf-entry) 17073 arch-key (nth 5 conf-entry)
16852 inst-alist (nth 6 conf-entry) 17074 inst-alist (nth 6 conf-entry)
@@ -16857,9 +17079,9 @@ specified by a target."
16857 subcomp-list (list ent-key)) 17079 subcomp-list (list ent-key))
16858 (setq tmp-key (vhdl-replace-string 17080 (setq tmp-key (vhdl-replace-string
16859 conf-regexp (funcall adjust-case conf-key))) 17081 conf-regexp (funcall adjust-case conf-key)))
16860 (setq unit-list (cons (cons conf-key tmp-key) unit-list)) 17082 (push (cons conf-key tmp-key) unit-list)
16861 ;; rule target for this configuration 17083 ;; rule target for this configuration
16862 (setq target-list (cons conf-key target-list)) 17084 (push conf-key target-list)
16863 ;; rule dependency for corresponding entity and architecture 17085 ;; rule dependency for corresponding entity and architecture
16864 (setq depend-list 17086 (setq depend-list
16865 (cons ent-key (cons (concat ent-key "-" arch-key) depend-list))) 17087 (cons ent-key (cons (concat ent-key "-" arch-key) depend-list)))
@@ -16877,16 +17099,14 @@ specified by a target."
16877 (setq depend-list (cons inst-ent-key depend-list) 17099 (setq depend-list (cons inst-ent-key depend-list)
16878 subcomp-list (cons inst-ent-key subcomp-list))) 17100 subcomp-list (cons inst-ent-key subcomp-list)))
16879; (when comp-arch-key 17101; (when comp-arch-key
16880; (setq depend-list (cons (concat comp-ent-key "-" comp-arch-key) 17102; (push (concat comp-ent-key "-" comp-arch-key) depend-list))
16881; depend-list)))
16882 (when inst-conf-key 17103 (when inst-conf-key
16883 (setq depend-list (cons inst-conf-key depend-list) 17104 (setq depend-list (cons inst-conf-key depend-list)
16884 subcomp-list (cons inst-conf-key subcomp-list)))) 17105 subcomp-list (cons inst-conf-key subcomp-list))))
16885 (setq inst-alist (cdr inst-alist))) 17106 (setq inst-alist (cdr inst-alist)))
16886 ;; add rule 17107 ;; add rule
16887 (aput 'rule-alist conf-file-name (list target-list depend-list)) 17108 (aput 'rule-alist conf-file-name (list target-list depend-list))
16888 (setq prim-list (cons (list conf-key nil (append subcomp-list pack-list)) 17109 (push (list conf-key nil (append subcomp-list pack-list)) prim-list)
16889 prim-list))
16890 (setq conf-alist (cdr conf-alist))) 17110 (setq conf-alist (cdr conf-alist)))
16891 (setq conf-alist tmp-list) 17111 (setq conf-alist tmp-list)
16892 ;; rules for all packages 17112 ;; rules for all packages
@@ -16896,16 +17116,18 @@ specified by a target."
16896 pack-key (nth 0 pack-entry) 17116 pack-key (nth 0 pack-entry)
16897 pack-body-key nil) 17117 pack-body-key nil)
16898 (when (nth 2 pack-entry) 17118 (when (nth 2 pack-entry)
16899 (setq pack-file-name (file-relative-name (nth 2 pack-entry) 17119 (setq pack-file-name (if vhdl-compile-absolute-path
16900 compile-directory) 17120 (nth 2 pack-entry)
17121 (file-relative-name (nth 2 pack-entry)
17122 compile-directory))
16901 lib-alist (nth 6 pack-entry) lib-body-alist (nth 10 pack-entry) 17123 lib-alist (nth 6 pack-entry) lib-body-alist (nth 10 pack-entry)
16902 rule (aget rule-alist pack-file-name) 17124 rule (aget rule-alist pack-file-name)
16903 target-list (nth 0 rule) depend-list (nth 1 rule)) 17125 target-list (nth 0 rule) depend-list (nth 1 rule))
16904 (setq tmp-key (vhdl-replace-string 17126 (setq tmp-key (vhdl-replace-string
16905 pack-regexp (funcall adjust-case pack-key))) 17127 pack-regexp (funcall adjust-case pack-key)))
16906 (setq unit-list (cons (cons pack-key tmp-key) unit-list)) 17128 (push (cons pack-key tmp-key) unit-list)
16907 ;; rule target for this package 17129 ;; rule target for this package
16908 (setq target-list (cons pack-key target-list)) 17130 (push pack-key target-list)
16909 ;; rule dependencies for all used packages 17131 ;; rule dependencies for all used packages
16910 (setq pack-list (vhdl-get-packages lib-alist work-library)) 17132 (setq pack-list (vhdl-get-packages lib-alist work-library))
16911 (setq depend-list (append depend-list pack-list)) 17133 (setq depend-list (append depend-list pack-list))
@@ -16915,8 +17137,10 @@ specified by a target."
16915 ;; rules for this package's body 17137 ;; rules for this package's body
16916 (when (nth 7 pack-entry) 17138 (when (nth 7 pack-entry)
16917 (setq pack-body-key (concat pack-key "-body") 17139 (setq pack-body-key (concat pack-key "-body")
16918 pack-body-file-name (file-relative-name (nth 7 pack-entry) 17140 pack-body-file-name (if vhdl-compile-absolute-path
16919 compile-directory) 17141 (nth 7 pack-entry)
17142 (file-relative-name (nth 7 pack-entry)
17143 compile-directory))
16920 rule (aget rule-alist pack-body-file-name) 17144 rule (aget rule-alist pack-body-file-name)
16921 target-list (nth 0 rule) 17145 target-list (nth 0 rule)
16922 depend-list (nth 1 rule)) 17146 depend-list (nth 1 rule))
@@ -16925,9 +17149,9 @@ specified by a target."
16925 (setq unit-list 17149 (setq unit-list
16926 (cons (cons pack-body-key tmp-key) unit-list)) 17150 (cons (cons pack-body-key tmp-key) unit-list))
16927 ;; rule target for this package's body 17151 ;; rule target for this package's body
16928 (setq target-list (cons pack-body-key target-list)) 17152 (push pack-body-key target-list)
16929 ;; rule dependency for corresponding package declaration 17153 ;; rule dependency for corresponding package declaration
16930 (setq depend-list (cons pack-key depend-list)) 17154 (push pack-key depend-list)
16931 ;; rule dependencies for all used packages 17155 ;; rule dependencies for all used packages
16932 (setq pack-list (vhdl-get-packages lib-body-alist work-library)) 17156 (setq pack-list (vhdl-get-packages lib-body-alist work-library))
16933 (setq depend-list (append depend-list pack-list)) 17157 (setq depend-list (append depend-list pack-list))
@@ -17050,16 +17274,16 @@ specified by a target."
17050 (unless (equal unit-key unit-name) 17274 (unless (equal unit-key unit-name)
17051 (insert " \\\n" unit-name)) 17275 (insert " \\\n" unit-name))
17052 (insert " :" 17276 (insert " :"
17053 " \\\n\t\t" (nth 2 vhdl-makefile-default-targets) 17277 " \\\n\t\t" (nth 2 vhdl-makefile-default-targets))
17054 " \\\n\t\t$(UNIT-" work-library "-" unit-key ")")
17055 (while second-list
17056 (insert " \\\n\t\t$(UNIT-" work-library "-" (car second-list) ")")
17057 (setq second-list (cdr second-list)))
17058 (while subcomp-list 17278 (while subcomp-list
17059 (when (and (assoc (car subcomp-list) unit-list) 17279 (when (and (assoc (car subcomp-list) unit-list)
17060 (not (equal unit-key (car subcomp-list)))) 17280 (not (equal unit-key (car subcomp-list))))
17061 (insert " \\\n\t\t" (car subcomp-list))) 17281 (insert " \\\n\t\t" (car subcomp-list)))
17062 (setq subcomp-list (cdr subcomp-list))) 17282 (setq subcomp-list (cdr subcomp-list)))
17283 (insert " \\\n\t\t$(UNIT-" work-library "-" unit-key ")")
17284 (while second-list
17285 (insert " \\\n\t\t$(UNIT-" work-library "-" (car second-list) ")")
17286 (setq second-list (cdr second-list)))
17063 (insert "\n") 17287 (insert "\n")
17064 (setq prim-list (cdr prim-list))) 17288 (setq prim-list (cdr prim-list)))
17065 ;; insert rule for each library unit file 17289 ;; insert rule for each library unit file
@@ -17198,6 +17422,7 @@ specified by a target."
17198 'vhdl-include-direction-comments 17422 'vhdl-include-direction-comments
17199 'vhdl-include-type-comments 17423 'vhdl-include-type-comments
17200 'vhdl-include-group-comments 17424 'vhdl-include-group-comments
17425 'vhdl-actual-generic-name
17201 'vhdl-actual-port-name 17426 'vhdl-actual-port-name
17202 'vhdl-instance-name 17427 'vhdl-instance-name
17203 'vhdl-testbench-entity-name 17428 'vhdl-testbench-entity-name
@@ -17280,13 +17505,21 @@ specified by a target."
17280 17505
17281(defconst vhdl-doc-release-notes nil 17506(defconst vhdl-doc-release-notes nil
17282 "\ 17507 "\
17283Release Notes for VHDL Mode 3.33 17508Release Notes for VHDL Mode 3.34
17284================================ 17509================================
17285 17510
17286 - New Features 17511- Added support for GNU Emacs 22/23/24:
17287 - User Options 17512 - Compilation error parsing fixed for new `compile.el' package.
17513
17514- Port translation: Derive actual generic name from formal generic name.
17515
17516- New user options:
17517 `vhdl-actual-generic-name': Specify how actual generic names are obtained.
17288 17518
17289 17519
17520Release Notes for VHDL Mode 3.33
17521================================
17522
17290New Features 17523New Features
17291------------ 17524------------
17292 17525