diff options
| author | Romain Francoise | 2005-08-31 19:53:52 +0000 |
|---|---|---|
| committer | Romain Francoise | 2005-08-31 19:53:52 +0000 |
| commit | 0a2e512a77cee619a5a566064abbb3a4591025ae (patch) | |
| tree | ff00e2b9123f3f51bb758ff4ccc7ff5f45eb7767 /lisp | |
| parent | d749b6fa2137756b292cf35fceafb80c15e89982 (diff) | |
| download | emacs-0a2e512a77cee619a5a566064abbb3a4591025ae.tar.gz emacs-0a2e512a77cee619a5a566064abbb3a4591025ae.zip | |
Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 59 | ||||
| -rw-r--r-- | lisp/progmodes/vhdl-mode.el | 1899 |
2 files changed, 1203 insertions, 755 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 783e36f6a29..9b6ae700ba1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,62 @@ | |||
| 1 | 2005-08-31 Reto Zimmermann <reto@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/vhdl-mode.el | ||
| 4 | (vhdl-update-sensitivity-list): Handle multi-dimensional array | ||
| 5 | access. | ||
| 6 | (vhdl-end-p): Fix indentation bug "else" after "-- when". | ||
| 7 | (vhdl-set-default-project): New function (easier setting of | ||
| 8 | default). | ||
| 9 | (vhdl-port-copy): Handle extended identifiers for generics. | ||
| 10 | (vhdl-compiler-alist): Better description for error message | ||
| 11 | regexp. | ||
| 12 | (vhdl-make): Query for target, use previous as default. | ||
| 13 | (vhdl-port-copy): Fix port copy for port names starting with | ||
| 14 | "signal". | ||
| 15 | (vhdl-font-lock-keywords-2): Fix fontification for record | ||
| 16 | el. assign. | ||
| 17 | (vhdl-speedbar-make-subpack-line): Add package body link. | ||
| 18 | (vhdl-generate-makefile-1): Not include itself as dependency. | ||
| 19 | (vhdl-font-lock-init): Highlight c-preprocessor directives. | ||
| 20 | (vhdl-*ward-syntactic-ws): Skip c-preprocessor directives. | ||
| 21 | (vhdl-get-syntactic-context): Handle c-preprocessor directives. | ||
| 22 | (vhdl-update-sensitivity-list): Start scan at opening parenthesis. | ||
| 23 | (vhdl-fixup-whitespace-region): Fix jumping point (infinite loop). | ||
| 24 | (vhdl-update-sensitivity-list-buffer): Add string argument for | ||
| 25 | `error'. | ||
| 26 | (vhdl-import-project): Add string argument for `error'. | ||
| 27 | (vhdl-compose-configuration, | ||
| 28 | vhdl-compose-configuration-architecture): Add configuration | ||
| 29 | declaration generation. | ||
| 30 | (vhdl-scan-directory-contents): Scan for block/generate hierarchy. | ||
| 31 | (vhdl-trailer-re): Add "record" keyword (better indentation). | ||
| 32 | (vhdl-fixup-whitespace-region): "[^ \t\"-]+" instead of | ||
| 33 | "[^ \t-\"]+". | ||
| 34 | (vhdl-font-lock-keywords-2): Not highlight formal parameter after | ||
| 35 | '|'. | ||
| 36 | (vhdl-testbench-entity-file-name, | ||
| 37 | vhdl-testbench-architecture-file-name): Allow separate | ||
| 38 | customization of testbench file names. | ||
| 39 | (vhdl-beginning-of-block): Handle optional subprogram parameter | ||
| 40 | list. | ||
| 41 | (vhdl-get-visible-signals): Allow newline within alias | ||
| 42 | declaration. | ||
| 43 | (vhdl-update-sensitivity-list): Signal read only on certain | ||
| 44 | attributes. | ||
| 45 | (vhdl-fixup-whitespace-region): Fix bug with strings (double | ||
| 46 | quotes). | ||
| 47 | (member-ignore-case): Alias for missing function in XEmacs. | ||
| 48 | (vhdl-compiler-alist): Add unit-to-file name mapping for Cadence | ||
| 49 | NC. | ||
| 50 | (vhdl-update-sensitivity-list): Ignore case on read signals. | ||
| 51 | (vhdl-replace-string): Adjust case only for file names. | ||
| 52 | (vhdl-update-sensitivity-list): Fix search for read signals. | ||
| 53 | (vhdl-update-sensitivity-list): Exclude formal parameters. | ||
| 54 | (vhdl-get-visible-signals): Include aliases of signals. | ||
| 55 | (vhdl-get-visible-signals): Fix signal name searching. | ||
| 56 | (vhdl-port-flatten, vhdl-port-reverse-direction): Better message. | ||
| 57 | (vhdl-fixup-whitespace-region): Fix for character | ||
| 58 | literals (e.g. ':'). | ||
| 59 | |||
| 1 | 2005-08-31 Juanma Barranquero <lekktu@gmail.com> | 60 | 2005-08-31 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 61 | ||
| 3 | * ansi-color.el (comint-last-output-start): | 62 | * ansi-color.el (comint-last-output-start): |
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 6971235d7c2..8e4cba6d527 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el | |||
| @@ -4,13 +4,14 @@ | |||
| 4 | 4 | ||
| 5 | ;; Authors: Reto Zimmermann <reto@gnu.org> | 5 | ;; Authors: Reto Zimmermann <reto@gnu.org> |
| 6 | ;; Rodney J. Whitby <software.vhdl-mode@rwhitby.net> | 6 | ;; Rodney J. Whitby <software.vhdl-mode@rwhitby.net> |
| 7 | ;; Maintainer: FSF (Because Reto Zimmermann seems to have disappeared) | 7 | ;; Maintainer: Reto Zimmermann <reto@gnu.org> |
| 8 | ;; Keywords: languages vhdl | 8 | ;; Keywords: languages vhdl |
| 9 | ;; WWW: http://opensource.ethz.ch/emacs/vhdl-mode.html | ||
| 9 | 10 | ||
| 10 | (defconst vhdl-version "3.32.12" | 11 | (defconst vhdl-version "3.33.6" |
| 11 | "VHDL Mode version number.") | 12 | "VHDL Mode version number.") |
| 12 | 13 | ||
| 13 | (defconst vhdl-time-stamp "2003-02-28" | 14 | (defconst vhdl-time-stamp "2005-08-30" |
| 14 | "VHDL Mode time stamp for last update.") | 15 | "VHDL Mode time stamp for last update.") |
| 15 | 16 | ||
| 16 | ;; This file is part of GNU Emacs. | 17 | ;; This file is part of GNU Emacs. |
| @@ -43,6 +44,8 @@ | |||
| 43 | ;; - Insertion of file headers | 44 | ;; - Insertion of file headers |
| 44 | ;; - Insertion of user-specified models | 45 | ;; - Insertion of user-specified models |
| 45 | ;; - Port translation / testbench generation | 46 | ;; - Port translation / testbench generation |
| 47 | ;; - Structural composition | ||
| 48 | ;; - Configuration generation | ||
| 46 | ;; - Sensitivity list updating | 49 | ;; - Sensitivity list updating |
| 47 | ;; - File browser | 50 | ;; - File browser |
| 48 | ;; - Design hierarchy browser | 51 | ;; - Design hierarchy browser |
| @@ -126,7 +129,9 @@ | |||
| 126 | "Non-nil if XEmacs is used.") | 129 | "Non-nil if XEmacs is used.") |
| 127 | ;; Emacs 21+ handling | 130 | ;; Emacs 21+ handling |
| 128 | (defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not vhdl-xemacs)) | 131 | (defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not vhdl-xemacs)) |
| 129 | "Non-nil if Emacs 21, 22, ... is used.") | 132 | "Non-nil if GNU Emacs 21, 22, ... is used.") |
| 133 | (defconst vhdl-emacs-22 (and (<= 22 emacs-major-version) (not vhdl-xemacs)) | ||
| 134 | "Non-nil if GNU Emacs 22, ... is used.") | ||
| 130 | 135 | ||
| 131 | (defvar compilation-file-regexp-alist) | 136 | (defvar compilation-file-regexp-alist) |
| 132 | (defvar itimer-version) | 137 | (defvar itimer-version) |
| @@ -180,7 +185,7 @@ Examples: | |||
| 180 | "Customizations for VHDL Mode." | 185 | "Customizations for VHDL Mode." |
| 181 | :prefix "vhdl-" | 186 | :prefix "vhdl-" |
| 182 | :group 'languages | 187 | :group 'languages |
| 183 | ; :version "20.4" ; comment out for XEmacs | 188 | ; :version "21.2" ; comment out for XEmacs |
| 184 | ) | 189 | ) |
| 185 | 190 | ||
| 186 | (defgroup vhdl-mode nil | 191 | (defgroup vhdl-mode nil |
| @@ -228,7 +233,8 @@ Overrides local variable `indent-tabs-mode'." | |||
| 228 | ("Cadence NC" "ncvhdl" "-work \\1" "make" "-f \\1" | 233 | ("Cadence NC" "ncvhdl" "-work \\1" "make" "-f \\1" |
| 229 | nil "mkdir \\1" "./" "work/" "Makefile" "ncvhdl" | 234 | nil "mkdir \\1" "./" "work/" "Makefile" "ncvhdl" |
| 230 | ("ncvhdl_p: \\*E,\\w+ (\\(.+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0) | 235 | ("ncvhdl_p: \\*E,\\w+ (\\(.+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0) |
| 231 | nil) | 236 | ("\\1/entity/pc.db" "\\2/\\1/pc.db" "\\1/configuration/pc.db" |
| 237 | "\\1/package/pc.db" "\\1/body/pc.db" downcase)) | ||
| 232 | ;; Ikos Voyager: analyze test.vhd | 238 | ;; Ikos Voyager: analyze test.vhd |
| 233 | ;; analyze test.vhd | 239 | ;; analyze test.vhd |
| 234 | ;; E L4/C5: this library unit is inaccessible | 240 | ;; E L4/C5: this library unit is inaccessible |
| @@ -343,7 +349,7 @@ Compiler: | |||
| 343 | Makefile name : name of Makefile (default is \"Makefile\") | 349 | Makefile name : name of Makefile (default is \"Makefile\") |
| 344 | ID string : compiler identification string (see `vhdl-project-alist') | 350 | ID string : compiler identification string (see `vhdl-project-alist') |
| 345 | Error message: | 351 | Error message: |
| 346 | Regexp : regular expression to match error messages | 352 | Regexp : regular expression to match error messages (*) |
| 347 | File subexp index: index of subexpression that matches the file name | 353 | File subexp index: index of subexpression that matches the file name |
| 348 | Line subexp index: index of subexpression that matches the line number | 354 | Line subexp index: index of subexpression that matches the line number |
| 349 | Column subexp idx: index of subexpression that matches the column number | 355 | Column subexp idx: index of subexpression that matches the column number |
| @@ -356,6 +362,9 @@ Unit-to-file name mapping: mapping of library unit names to names of files | |||
| 356 | \"\\2\" inserts the entity name for architectures) | 362 | \"\\2\" inserts the entity name for architectures) |
| 357 | Case adjustment : adjust case of inserted unit names | 363 | Case adjustment : adjust case of inserted unit names |
| 358 | 364 | ||
| 365 | \(*) The regular expression must match the error message starting from the | ||
| 366 | beginning of the line (but not necessarily to the end of the line). | ||
| 367 | |||
| 359 | Compile options allows insertion of the library name (see `vhdl-project-alist') | 368 | Compile options allows insertion of the library name (see `vhdl-project-alist') |
| 360 | in order to set the compilers library option (e.g. \"vcom -work my_lib\"). | 369 | in order to set the compilers library option (e.g. \"vcom -work my_lib\"). |
| 361 | 370 | ||
| @@ -385,8 +394,8 @@ assigning its name to option `vhdl-compiler'. | |||
| 385 | Please send any missing or erroneous compiler properties to the maintainer for | 394 | Please send any missing or erroneous compiler properties to the maintainer for |
| 386 | updating. | 395 | updating. |
| 387 | 396 | ||
| 388 | NOTE: Reflect the new setting in the choice list of option `vhdl-compiler' | 397 | NOTE: Activate new error and file message regexps and reflect the new setting |
| 389 | by restarting Emacs." | 398 | in the choice list of option `vhdl-compiler' by restarting Emacs." |
| 390 | :type '(repeat | 399 | :type '(repeat |
| 391 | (list :tag "Compiler" :indent 2 | 400 | (list :tag "Compiler" :indent 2 |
| 392 | (string :tag "Compiler name ") | 401 | (string :tag "Compiler name ") |
| @@ -426,7 +435,7 @@ NOTE: Reflect the new setting in the choice list of option `vhdl-compiler' | |||
| 426 | (const :tag "Upcase" upcase) | 435 | (const :tag "Upcase" upcase) |
| 427 | (const :tag "Downcase" downcase)))))) | 436 | (const :tag "Downcase" downcase)))))) |
| 428 | :set (lambda (variable value) | 437 | :set (lambda (variable value) |
| 429 | (vhdl-custom-set variable value 'vhdl-update-mode-menu)) | 438 | (vhdl-custom-set variable value 'vhdl-update-mode-menu)) |
| 430 | :group 'vhdl-compile) | 439 | :group 'vhdl-compile) |
| 431 | 440 | ||
| 432 | (defcustom vhdl-compiler "ModelSim" | 441 | (defcustom vhdl-compiler "ModelSim" |
| @@ -589,7 +598,7 @@ NOTE: Reflect the new setting in the choice list of option `vhdl-project' | |||
| 589 | (string :tag "Description: (type `C-j' for newline)" | 598 | (string :tag "Description: (type `C-j' for newline)" |
| 590 | :format "%t\n%v\n"))) | 599 | :format "%t\n%v\n"))) |
| 591 | :set (lambda (variable value) | 600 | :set (lambda (variable value) |
| 592 | (vhdl-custom-set variable value | 601 | (vhdl-custom-set variable value |
| 593 | 'vhdl-update-mode-menu | 602 | 'vhdl-update-mode-menu |
| 594 | 'vhdl-speedbar-refresh)) | 603 | 'vhdl-speedbar-refresh)) |
| 595 | :group 'vhdl-project) | 604 | :group 'vhdl-project) |
| @@ -666,7 +675,7 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry | |||
| 666 | (const :tag "VHDL-AMS" ams) | 675 | (const :tag "VHDL-AMS" ams) |
| 667 | (const :tag "Math packages" math))) | 676 | (const :tag "Math packages" math))) |
| 668 | :set (lambda (variable value) | 677 | :set (lambda (variable value) |
| 669 | (vhdl-custom-set variable value | 678 | (vhdl-custom-set variable value |
| 670 | 'vhdl-template-map-init | 679 | 'vhdl-template-map-init |
| 671 | 'vhdl-mode-abbrev-table-init | 680 | 'vhdl-mode-abbrev-table-init |
| 672 | 'vhdl-template-construct-alist-init | 681 | 'vhdl-template-construct-alist-init |
| @@ -686,7 +695,7 @@ This value is used by + and - symbols in `vhdl-offsets-alist'." | |||
| 686 | This is done when typed or expanded or by the fix case functions." | 695 | This is done when typed or expanded or by the fix case functions." |
| 687 | :type 'boolean | 696 | :type 'boolean |
| 688 | :set (lambda (variable value) | 697 | :set (lambda (variable value) |
| 689 | (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) | 698 | (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) |
| 690 | :group 'vhdl-style) | 699 | :group 'vhdl-style) |
| 691 | 700 | ||
| 692 | (defcustom vhdl-upper-case-types nil | 701 | (defcustom vhdl-upper-case-types nil |
| @@ -694,7 +703,7 @@ This is done when typed or expanded or by the fix case functions." | |||
| 694 | This is done when expanded or by the fix case functions." | 703 | This is done when expanded or by the fix case functions." |
| 695 | :type 'boolean | 704 | :type 'boolean |
| 696 | :set (lambda (variable value) | 705 | :set (lambda (variable value) |
| 697 | (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) | 706 | (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) |
| 698 | :group 'vhdl-style) | 707 | :group 'vhdl-style) |
| 699 | 708 | ||
| 700 | (defcustom vhdl-upper-case-attributes nil | 709 | (defcustom vhdl-upper-case-attributes nil |
| @@ -702,7 +711,7 @@ This is done when expanded or by the fix case functions." | |||
| 702 | This is done when expanded or by the fix case functions." | 711 | This is done when expanded or by the fix case functions." |
| 703 | :type 'boolean | 712 | :type 'boolean |
| 704 | :set (lambda (variable value) | 713 | :set (lambda (variable value) |
| 705 | (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) | 714 | (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) |
| 706 | :group 'vhdl-style) | 715 | :group 'vhdl-style) |
| 707 | 716 | ||
| 708 | (defcustom vhdl-upper-case-enum-values nil | 717 | (defcustom vhdl-upper-case-enum-values nil |
| @@ -710,7 +719,7 @@ This is done when expanded or by the fix case functions." | |||
| 710 | This is done when expanded or by the fix case functions." | 719 | This is done when expanded or by the fix case functions." |
| 711 | :type 'boolean | 720 | :type 'boolean |
| 712 | :set (lambda (variable value) | 721 | :set (lambda (variable value) |
| 713 | (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) | 722 | (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) |
| 714 | :group 'vhdl-style) | 723 | :group 'vhdl-style) |
| 715 | 724 | ||
| 716 | (defcustom vhdl-upper-case-constants t | 725 | (defcustom vhdl-upper-case-constants t |
| @@ -718,7 +727,7 @@ This is done when expanded or by the fix case functions." | |||
| 718 | This is done when expanded." | 727 | This is done when expanded." |
| 719 | :type 'boolean | 728 | :type 'boolean |
| 720 | :set (lambda (variable value) | 729 | :set (lambda (variable value) |
| 721 | (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) | 730 | (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) |
| 722 | :group 'vhdl-style) | 731 | :group 'vhdl-style) |
| 723 | 732 | ||
| 724 | (defcustom vhdl-use-direct-instantiation 'standard | 733 | (defcustom vhdl-use-direct-instantiation 'standard |
| @@ -753,9 +762,22 @@ taken from the file name of the current buffer." | |||
| 753 | "*Specifies how the architecture file name is obtained. | 762 | "*Specifies how the architecture file name is obtained. |
| 754 | The architecture file name can be obtained by modifying the entity | 763 | The architecture file name can be obtained by modifying the entity |
| 755 | and/or architecture name (e.g. attaching or stripping off a substring). The | 764 | and/or architecture name (e.g. attaching or stripping off a substring). The |
| 756 | string that is matched against the regexp is the concatenation of the entity | 765 | file extension is automatically taken from the file name of the current |
| 757 | and the architecture name separated by a space. This gives access to both | 766 | buffer. The string that is matched against the regexp is the concatenation |
| 758 | names (see default setting as example)." | 767 | of the entity and the architecture name separated by a space. This gives |
| 768 | access to both names (see default setting as example)." | ||
| 769 | vhdl-name-doc-string) | ||
| 770 | :type '(cons (regexp :tag "From regexp") | ||
| 771 | (string :tag "To string ")) | ||
| 772 | :group 'vhdl-naming | ||
| 773 | :group 'vhdl-compose) | ||
| 774 | |||
| 775 | (defcustom vhdl-configuration-file-name '(".*" . "\\&") | ||
| 776 | (concat | ||
| 777 | "*Specifies how the configuration file name is obtained. | ||
| 778 | The configuration file name can be obtained by modifying the configuration | ||
| 779 | name (e.g. attaching or stripping off a substring). The file extension is | ||
| 780 | automatically taken from the file name of the current buffer." | ||
| 759 | vhdl-name-doc-string) | 781 | vhdl-name-doc-string) |
| 760 | :type '(cons (regexp :tag "From regexp") | 782 | :type '(cons (regexp :tag "From regexp") |
| 761 | (string :tag "To string ")) | 783 | (string :tag "To string ")) |
| @@ -767,7 +789,9 @@ names (see default setting as example)." | |||
| 767 | "*Specifies how the package file name is obtained. | 789 | "*Specifies how the package file name is obtained. |
| 768 | The package file name can be obtained by modifying the package name (e.g. | 790 | The package file name can be obtained by modifying the package name (e.g. |
| 769 | attaching or stripping off a substring). The file extension is automatically | 791 | attaching or stripping off a substring). The file extension is automatically |
| 770 | taken from the file name of the current buffer." | 792 | taken from the file name of the current buffer. Package files can be created |
| 793 | in a different directory by prepending a relative or absolute path to the | ||
| 794 | file name." | ||
| 771 | vhdl-name-doc-string) | 795 | vhdl-name-doc-string) |
| 772 | :type '(cons (regexp :tag "From regexp") | 796 | :type '(cons (regexp :tag "From regexp") |
| 773 | (string :tag "To string ")) | 797 | (string :tag "To string ")) |
| @@ -801,7 +825,7 @@ follows: | |||
| 801 | :type '(set (const :tag "VHDL keywords" vhdl) | 825 | :type '(set (const :tag "VHDL keywords" vhdl) |
| 802 | (const :tag "User model keywords" user)) | 826 | (const :tag "User model keywords" user)) |
| 803 | :set (lambda (variable value) | 827 | :set (lambda (variable value) |
| 804 | (vhdl-custom-set variable value 'vhdl-mode-abbrev-table-init)) | 828 | (vhdl-custom-set variable value 'vhdl-mode-abbrev-table-init)) |
| 805 | :group 'vhdl-template) | 829 | :group 'vhdl-template) |
| 806 | 830 | ||
| 807 | (defcustom vhdl-optional-labels 'process | 831 | (defcustom vhdl-optional-labels 'process |
| @@ -1035,7 +1059,7 @@ begin -- process <label> | |||
| 1035 | <cursor> | 1059 | <cursor> |
| 1036 | elsif <clock>'event and <clock> = '1' then -- rising clock edge | 1060 | elsif <clock>'event and <clock> = '1' then -- rising clock edge |
| 1037 | if <enable> = '1' then -- synchronous load | 1061 | if <enable> = '1' then -- synchronous load |
| 1038 | 1062 | ||
| 1039 | end if; | 1063 | end if; |
| 1040 | end if; | 1064 | end if; |
| 1041 | end process <label>;" | 1065 | end process <label>;" |
| @@ -1075,7 +1099,7 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry | |||
| 1075 | (sexp :tag "Key binding" x) | 1099 | (sexp :tag "Key binding" x) |
| 1076 | (string :tag "Keyword " :format "%t: %v\n"))) | 1100 | (string :tag "Keyword " :format "%t: %v\n"))) |
| 1077 | :set (lambda (variable value) | 1101 | :set (lambda (variable value) |
| 1078 | (vhdl-custom-set variable value | 1102 | (vhdl-custom-set variable value |
| 1079 | 'vhdl-model-map-init | 1103 | 'vhdl-model-map-init |
| 1080 | 'vhdl-model-defun | 1104 | 'vhdl-model-defun |
| 1081 | 'vhdl-mode-abbrev-table-init | 1105 | 'vhdl-mode-abbrev-table-init |
| @@ -1083,6 +1107,99 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry | |||
| 1083 | :group 'vhdl-model) | 1107 | :group 'vhdl-model) |
| 1084 | 1108 | ||
| 1085 | 1109 | ||
| 1110 | (defgroup vhdl-compose nil | ||
| 1111 | "Customizations for structural composition." | ||
| 1112 | :group 'vhdl) | ||
| 1113 | |||
| 1114 | (defcustom vhdl-compose-architecture-name '(".*" . "str") | ||
| 1115 | (concat | ||
| 1116 | "*Specifies how the component architecture name is obtained. | ||
| 1117 | The component architecture name can be obtained by modifying the entity name | ||
| 1118 | \(e.g. attaching or stripping off a substring). | ||
| 1119 | If TO STRING is empty, the architecture name is queried." | ||
| 1120 | vhdl-name-doc-string) | ||
| 1121 | :type '(cons (regexp :tag "From regexp") | ||
| 1122 | (string :tag "To string ")) | ||
| 1123 | :group 'vhdl-compose) | ||
| 1124 | |||
| 1125 | (defcustom vhdl-compose-configuration-name | ||
| 1126 | '("\\(.*\\) \\(.*\\)" . "\\1_\\2_cfg") | ||
| 1127 | (concat | ||
| 1128 | "*Specifies how the configuration name is obtained. | ||
| 1129 | The configuration name can be obtained by modifying the entity and/or | ||
| 1130 | architecture name (e.g. attaching or stripping off a substring). The string | ||
| 1131 | that is matched against the regexp is the concatenation of the entity and the | ||
| 1132 | architecture name separated by a space. This gives access to both names (see | ||
| 1133 | default setting as example)." | ||
| 1134 | vhdl-name-doc-string) | ||
| 1135 | :type '(cons (regexp :tag "From regexp") | ||
| 1136 | (string :tag "To string ")) | ||
| 1137 | :group 'vhdl-compose) | ||
| 1138 | |||
| 1139 | (defcustom vhdl-components-package-name | ||
| 1140 | '((".*" . "\\&_components") . "components") | ||
| 1141 | (concat | ||
| 1142 | "*Specifies how the name for the components package is obtained. | ||
| 1143 | The components package is a package containing all component declarations for | ||
| 1144 | the current design. It's name can be obtained by modifying the project name | ||
| 1145 | \(e.g. attaching or stripping off a substring). If no project is defined, the | ||
| 1146 | DIRECTORY entry is chosen." | ||
| 1147 | vhdl-name-doc-string) | ||
| 1148 | :type '(cons (cons :tag "Project" :indent 2 | ||
| 1149 | (regexp :tag "From regexp") | ||
| 1150 | (string :tag "To string ")) | ||
| 1151 | (string :tag "Directory:\n String ")) | ||
| 1152 | :group 'vhdl-compose) | ||
| 1153 | |||
| 1154 | (defcustom vhdl-use-components-package nil | ||
| 1155 | "*Non-nil means use a separate components package for component declarations. | ||
| 1156 | Otherwise, component declarations are inserted and searched for in the | ||
| 1157 | architecture declarative parts." | ||
| 1158 | :type 'boolean | ||
| 1159 | :group 'vhdl-compose) | ||
| 1160 | |||
| 1161 | (defcustom vhdl-compose-include-header t | ||
| 1162 | "*Non-nil means include a header in automatically generated files." | ||
| 1163 | :type 'boolean | ||
| 1164 | :group 'vhdl-compose) | ||
| 1165 | |||
| 1166 | (defcustom vhdl-compose-create-files 'single | ||
| 1167 | "*Specifies whether new files should be created for the new component. | ||
| 1168 | The component's entity and architecture are inserted: | ||
| 1169 | None : in current buffer | ||
| 1170 | Single file : in new single file | ||
| 1171 | Separate files: in two separate files | ||
| 1172 | The file names are obtained from variables `vhdl-entity-file-name' and | ||
| 1173 | `vhdl-architecture-file-name'." | ||
| 1174 | :type '(choice (const :tag "None" none) | ||
| 1175 | (const :tag "Single file" single) | ||
| 1176 | (const :tag "Separate files" separate)) | ||
| 1177 | :group 'vhdl-compose) | ||
| 1178 | |||
| 1179 | (defcustom vhdl-compose-configuration-create-file nil | ||
| 1180 | "*Specifies whether a new file should be created for the configuration. | ||
| 1181 | If non-nil, a new file is created for the configuration. | ||
| 1182 | The file name is obtained from variable `vhdl-configuration-file-name'." | ||
| 1183 | :type 'boolean | ||
| 1184 | :group 'vhdl-compose) | ||
| 1185 | |||
| 1186 | (defcustom vhdl-compose-configuration-hierarchical t | ||
| 1187 | "*Specifies whether hierarchical configurations should be created. | ||
| 1188 | If non-nil, automatically created configurations are hierarchical and include | ||
| 1189 | the whole hierarchy of subcomponents. Otherwise the configuration only | ||
| 1190 | includes one level of subcomponents." | ||
| 1191 | :type 'boolean | ||
| 1192 | :group 'vhdl-compose) | ||
| 1193 | |||
| 1194 | (defcustom vhdl-compose-configuration-use-subconfiguration t | ||
| 1195 | "*Specifies whether subconfigurations should be used inside configurations. | ||
| 1196 | If non-nil, automatically created configurations use configurations in binding | ||
| 1197 | indications for subcomponents, if such configurations exist. Otherwise, | ||
| 1198 | entities are used in binding indications for subcomponents." | ||
| 1199 | :type 'boolean | ||
| 1200 | :group 'vhdl-compose) | ||
| 1201 | |||
| 1202 | |||
| 1086 | (defgroup vhdl-port nil | 1203 | (defgroup vhdl-port nil |
| 1087 | "Customizations for port translation functions." | 1204 | "Customizations for port translation functions." |
| 1088 | :group 'vhdl | 1205 | :group 'vhdl |
| @@ -1162,8 +1279,7 @@ If TO STRING is empty, the architecture name is queried." | |||
| 1162 | (string :tag "To string ")) | 1279 | (string :tag "To string ")) |
| 1163 | :group 'vhdl-testbench) | 1280 | :group 'vhdl-testbench) |
| 1164 | 1281 | ||
| 1165 | (defcustom vhdl-testbench-configuration-name | 1282 | (defcustom vhdl-testbench-configuration-name vhdl-compose-configuration-name |
| 1166 | '("\\(.*\\) \\(.*\\)" . "\\1_\\2_cfg") | ||
| 1167 | (concat | 1283 | (concat |
| 1168 | "*Specifies how the testbench configuration name is obtained. | 1284 | "*Specifies how the testbench configuration name is obtained. |
| 1169 | The configuration name of a testbench can be obtained by modifying the entity | 1285 | The configuration name of a testbench can be obtained by modifying the entity |
| @@ -1212,7 +1328,7 @@ Type `C-j' for newlines." | |||
| 1212 | WaveGen_Proc: process | 1328 | WaveGen_Proc: process |
| 1213 | begin | 1329 | begin |
| 1214 | -- insert signal assignments here | 1330 | -- insert signal assignments here |
| 1215 | 1331 | ||
| 1216 | wait until Clk = '1'; | 1332 | wait until Clk = '1'; |
| 1217 | end process WaveGen_Proc; | 1333 | end process WaveGen_Proc; |
| 1218 | " | 1334 | " |
| @@ -1245,67 +1361,40 @@ testbench entity and architecture are inserted: | |||
| 1245 | None : in current buffer | 1361 | None : in current buffer |
| 1246 | Single file : in new single file | 1362 | Single file : in new single file |
| 1247 | Separate files: in two separate files | 1363 | Separate files: in two separate files |
| 1248 | Note that the files have the same name as the contained design unit." | 1364 | The file names are obtained from variables `vhdl-testbench-entity-file-name' |
| 1365 | and `vhdl-testbench-architecture-file-name'." | ||
| 1249 | :type '(choice (const :tag "None" none) | 1366 | :type '(choice (const :tag "None" none) |
| 1250 | (const :tag "Single file" single) | 1367 | (const :tag "Single file" single) |
| 1251 | (const :tag "Separate files" separate)) | 1368 | (const :tag "Separate files" separate)) |
| 1252 | :group 'vhdl-testbench) | 1369 | :group 'vhdl-testbench) |
| 1253 | 1370 | ||
| 1254 | 1371 | (defcustom vhdl-testbench-entity-file-name vhdl-entity-file-name | |
| 1255 | (defgroup vhdl-compose nil | ||
| 1256 | "Customizations for structural composition." | ||
| 1257 | :group 'vhdl) | ||
| 1258 | |||
| 1259 | (defcustom vhdl-compose-create-files 'single | ||
| 1260 | "*Specifies whether new files should be created for the new component. | ||
| 1261 | The component's entity and architecture are inserted: | ||
| 1262 | None : in current buffer | ||
| 1263 | Single file : in new single file | ||
| 1264 | Separate files: in two separate files | ||
| 1265 | The file names are obtained from variables `vhdl-entity-file-name' and | ||
| 1266 | `vhdl-architecture-file-name'." | ||
| 1267 | :type '(choice (const :tag "None" none) | ||
| 1268 | (const :tag "Single file" single) | ||
| 1269 | (const :tag "Separate files" separate)) | ||
| 1270 | :group 'vhdl-compose) | ||
| 1271 | |||
| 1272 | (defcustom vhdl-compose-include-header t | ||
| 1273 | "*Non-nil means include a header in automatically generated files." | ||
| 1274 | :type 'boolean | ||
| 1275 | :group 'vhdl-compose) | ||
| 1276 | |||
| 1277 | (defcustom vhdl-compose-architecture-name '(".*" . "str") | ||
| 1278 | (concat | 1372 | (concat |
| 1279 | "*Specifies how the component architecture name is obtained. | 1373 | "*Specifies how the testbench entity file name is obtained. |
| 1280 | The component architecture name can be obtained by modifying the entity name | 1374 | The entity file name can be obtained by modifying the testbench entity name |
| 1281 | \(e.g. attaching or stripping off a substring). | 1375 | \(e.g. attaching or stripping off a substring). The file extension is |
| 1282 | If TO STRING is empty, the architecture name is queried." | 1376 | automatically taken from the file name of the current buffer. Testbench |
| 1377 | files can be created in a different directory by prepending a relative or | ||
| 1378 | absolute path to the file name." | ||
| 1283 | vhdl-name-doc-string) | 1379 | vhdl-name-doc-string) |
| 1284 | :type '(cons (regexp :tag "From regexp") | 1380 | :type '(cons (regexp :tag "From regexp") |
| 1285 | (string :tag "To string ")) | 1381 | (string :tag "To string ")) |
| 1286 | :group 'vhdl-compose) | 1382 | :group 'vhdl-testbench) |
| 1287 | 1383 | ||
| 1288 | (defcustom vhdl-components-package-name | 1384 | (defcustom vhdl-testbench-architecture-file-name vhdl-architecture-file-name |
| 1289 | '((".*" . "\\&_components") . "components") | ||
| 1290 | (concat | 1385 | (concat |
| 1291 | "*Specifies how the name for the components package is obtained. | 1386 | "*Specifies how the testbench architecture file name is obtained. |
| 1292 | The components package is a package containing all component declarations for | 1387 | The architecture file name can be obtained by modifying the testbench entity |
| 1293 | the current design. Its name can be obtained by modifying the project name | 1388 | and/or architecture name (e.g. attaching or stripping off a substring). The |
| 1294 | \(e.g. attaching or stripping off a substring). If no project is defined, the | 1389 | string that is matched against the regexp is the concatenation of the entity |
| 1295 | DIRECTORY entry is chosen." | 1390 | and the architecture name separated by a space. This gives access to both |
| 1391 | names (see default setting as example). Testbench files can be created in | ||
| 1392 | a different directory by prepending a relative or absolute path to the file | ||
| 1393 | name." | ||
| 1296 | vhdl-name-doc-string) | 1394 | vhdl-name-doc-string) |
| 1297 | :type '(cons (cons :tag "Project" :indent 2 | 1395 | :type '(cons (regexp :tag "From regexp") |
| 1298 | (regexp :tag "From regexp") | 1396 | (string :tag "To string ")) |
| 1299 | (string :tag "To string ")) | 1397 | :group 'vhdl-testbench) |
| 1300 | (string :tag "Directory:\n String ")) | ||
| 1301 | :group 'vhdl-compose) | ||
| 1302 | |||
| 1303 | (defcustom vhdl-use-components-package nil | ||
| 1304 | "*Non-nil means use a separate components package for component declarations. | ||
| 1305 | Otherwise, component declarations are inserted and searched for in the | ||
| 1306 | architecture declarative parts." | ||
| 1307 | :type 'boolean | ||
| 1308 | :group 'vhdl-compose) | ||
| 1309 | 1398 | ||
| 1310 | 1399 | ||
| 1311 | (defgroup vhdl-comment nil | 1400 | (defgroup vhdl-comment nil |
| @@ -1384,17 +1473,17 @@ Option `vhdl-align-groups' still applies within these blocks." | |||
| 1384 | (defcustom vhdl-highlight-keywords t | 1473 | (defcustom vhdl-highlight-keywords t |
| 1385 | "*Non-nil means highlight VHDL keywords and other standardized words. | 1474 | "*Non-nil means highlight VHDL keywords and other standardized words. |
| 1386 | The following faces are used: | 1475 | The following faces are used: |
| 1387 | `font-lock-keyword-face' : keywords | 1476 | `font-lock-keyword-face' : keywords |
| 1388 | `font-lock-type' : standardized types | 1477 | `font-lock-type-face' : standardized types |
| 1389 | `vhdl-attribute' : standardized attributes | 1478 | `vhdl-font-lock-attribute-face': standardized attributes |
| 1390 | `vhdl-enumvalue' : standardized enumeration values | 1479 | `vhdl-font-lock-enumvalue-face': standardized enumeration values |
| 1391 | `vhdl-function' : standardized function and package names | 1480 | `vhdl-font-lock-function-face' : standardized function and package names |
| 1392 | 1481 | ||
| 1393 | NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu | 1482 | NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
| 1394 | entry \"Fontify Buffer\")." | 1483 | entry \"Fontify Buffer\")." |
| 1395 | :type 'boolean | 1484 | :type 'boolean |
| 1396 | :set (lambda (variable value) | 1485 | :set (lambda (variable value) |
| 1397 | (vhdl-custom-set variable value 'vhdl-font-lock-init)) | 1486 | (vhdl-custom-set variable value 'vhdl-font-lock-init)) |
| 1398 | :group 'vhdl-highlight) | 1487 | :group 'vhdl-highlight) |
| 1399 | 1488 | ||
| 1400 | (defcustom vhdl-highlight-names t | 1489 | (defcustom vhdl-highlight-names t |
| @@ -1403,7 +1492,7 @@ The following faces are used: | |||
| 1403 | `font-lock-function-name-face' : names in declarations of units, | 1492 | `font-lock-function-name-face' : names in declarations of units, |
| 1404 | subprograms, components, as well as labels of VHDL constructs | 1493 | subprograms, components, as well as labels of VHDL constructs |
| 1405 | `font-lock-type-face' : names in type/nature declarations | 1494 | `font-lock-type-face' : names in type/nature declarations |
| 1406 | `vhdl-attribute' : names in attribute declarations | 1495 | `vhdl-font-lock-attribute-face': names in attribute declarations |
| 1407 | `font-lock-variable-name-face' : names in declarations of signals, | 1496 | `font-lock-variable-name-face' : names in declarations of signals, |
| 1408 | variables, constants, subprogram parameters, generics, and ports | 1497 | variables, constants, subprogram parameters, generics, and ports |
| 1409 | 1498 | ||
| @@ -1411,7 +1500,7 @@ NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu | |||
| 1411 | entry \"Fontify Buffer\")." | 1500 | entry \"Fontify Buffer\")." |
| 1412 | :type 'boolean | 1501 | :type 'boolean |
| 1413 | :set (lambda (variable value) | 1502 | :set (lambda (variable value) |
| 1414 | (vhdl-custom-set variable value 'vhdl-font-lock-init)) | 1503 | (vhdl-custom-set variable value 'vhdl-font-lock-init)) |
| 1415 | :group 'vhdl-highlight) | 1504 | :group 'vhdl-highlight) |
| 1416 | 1505 | ||
| 1417 | (defcustom vhdl-highlight-special-words nil | 1506 | (defcustom vhdl-highlight-special-words nil |
| @@ -1424,34 +1513,34 @@ NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu | |||
| 1424 | entry \"Fontify Buffer\")." | 1513 | entry \"Fontify Buffer\")." |
| 1425 | :type 'boolean | 1514 | :type 'boolean |
| 1426 | :set (lambda (variable value) | 1515 | :set (lambda (variable value) |
| 1427 | (vhdl-custom-set variable value 'vhdl-font-lock-init)) | 1516 | (vhdl-custom-set variable value 'vhdl-font-lock-init)) |
| 1428 | :group 'vhdl-highlight) | 1517 | :group 'vhdl-highlight) |
| 1429 | 1518 | ||
| 1430 | (defcustom vhdl-highlight-forbidden-words nil | 1519 | (defcustom vhdl-highlight-forbidden-words nil |
| 1431 | "*Non-nil means highlight forbidden words. | 1520 | "*Non-nil means highlight forbidden words. |
| 1432 | The reserved words specified in option `vhdl-forbidden-words' or having the | 1521 | The reserved words specified in option `vhdl-forbidden-words' or having the |
| 1433 | syntax specified in option `vhdl-forbidden-syntax' are highlighted in a | 1522 | syntax specified in option `vhdl-forbidden-syntax' are highlighted in a |
| 1434 | warning color (face `vhdl-reserved-word') to indicate not to | 1523 | warning color (face `vhdl-font-lock-reserved-words-face') to indicate not to |
| 1435 | use them. | 1524 | use them. |
| 1436 | 1525 | ||
| 1437 | NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu | 1526 | NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
| 1438 | entry \"Fontify Buffer\")." | 1527 | entry \"Fontify Buffer\")." |
| 1439 | :type 'boolean | 1528 | :type 'boolean |
| 1440 | :set (lambda (variable value) | 1529 | :set (lambda (variable value) |
| 1441 | (vhdl-custom-set variable value | 1530 | (vhdl-custom-set variable value |
| 1442 | 'vhdl-words-init 'vhdl-font-lock-init)) | 1531 | 'vhdl-words-init 'vhdl-font-lock-init)) |
| 1443 | :group 'vhdl-highlight) | 1532 | :group 'vhdl-highlight) |
| 1444 | 1533 | ||
| 1445 | (defcustom vhdl-highlight-verilog-keywords nil | 1534 | (defcustom vhdl-highlight-verilog-keywords nil |
| 1446 | "*Non-nil means highlight Verilog keywords as reserved words. | 1535 | "*Non-nil means highlight Verilog keywords as reserved words. |
| 1447 | Verilog keywords are highlighted in a warning color (face | 1536 | Verilog keywords are highlighted in a warning color (face |
| 1448 | `vhdl-reserved-word') to indicate not to use them. | 1537 | `vhdl-font-lock-reserved-words-face') to indicate not to use them. |
| 1449 | 1538 | ||
| 1450 | NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu | 1539 | NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
| 1451 | entry \"Fontify Buffer\")." | 1540 | entry \"Fontify Buffer\")." |
| 1452 | :type 'boolean | 1541 | :type 'boolean |
| 1453 | :set (lambda (variable value) | 1542 | :set (lambda (variable value) |
| 1454 | (vhdl-custom-set variable value | 1543 | (vhdl-custom-set variable value |
| 1455 | 'vhdl-words-init 'vhdl-font-lock-init)) | 1544 | 'vhdl-words-init 'vhdl-font-lock-init)) |
| 1456 | :group 'vhdl-highlight) | 1545 | :group 'vhdl-highlight) |
| 1457 | 1546 | ||
| @@ -1459,14 +1548,14 @@ NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu | |||
| 1459 | "*Non-nil means background-highlight code excluded from translation. | 1548 | "*Non-nil means background-highlight code excluded from translation. |
| 1460 | That is, all code between \"-- pragma translate_off\" and | 1549 | That is, all code between \"-- pragma translate_off\" and |
| 1461 | \"-- pragma translate_on\" is highlighted using a different background color | 1550 | \"-- pragma translate_on\" is highlighted using a different background color |
| 1462 | \(face `vhdl-translate-off'). | 1551 | \(face `vhdl-font-lock-translate-off-face'). |
| 1463 | Note: this might slow down on-the-fly fontification (and thus editing). | 1552 | Note: this might slow down on-the-fly fontification (and thus editing). |
| 1464 | 1553 | ||
| 1465 | NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu | 1554 | NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
| 1466 | entry \"Fontify Buffer\")." | 1555 | entry \"Fontify Buffer\")." |
| 1467 | :type 'boolean | 1556 | :type 'boolean |
| 1468 | :set (lambda (variable value) | 1557 | :set (lambda (variable value) |
| 1469 | (vhdl-custom-set variable value 'vhdl-font-lock-init)) | 1558 | (vhdl-custom-set variable value 'vhdl-font-lock-init)) |
| 1470 | :group 'vhdl-highlight) | 1559 | :group 'vhdl-highlight) |
| 1471 | 1560 | ||
| 1472 | (defcustom vhdl-highlight-case-sensitive nil | 1561 | (defcustom vhdl-highlight-case-sensitive nil |
| @@ -1506,7 +1595,7 @@ different kinds of signals (e.g. \"Clk50\", \"Rst_n\") or objects (e.g. | |||
| 1506 | \"Signal_s\", \"Variable_v\", \"Constant_c\") by distinguishing them using | 1595 | \"Signal_s\", \"Variable_v\", \"Constant_c\") by distinguishing them using |
| 1507 | common substrings or name suffices. | 1596 | common substrings or name suffices. |
| 1508 | For each entry, a new face is generated with the specified colors and name | 1597 | For each entry, a new face is generated with the specified colors and name |
| 1509 | \"vhdl-\" + name. | 1598 | \"vhdl-font-lock-\" + name + \"-face\". |
| 1510 | 1599 | ||
| 1511 | NOTE: Activate a changed regexp in a VHDL buffer by re-fontifying it (menu | 1600 | NOTE: Activate a changed regexp in a VHDL buffer by re-fontifying it (menu |
| 1512 | entry \"Fontify Buffer\"). All other changes require restarting Emacs." | 1601 | entry \"Fontify Buffer\"). All other changes require restarting Emacs." |
| @@ -1516,7 +1605,7 @@ NOTE: Activate a changed regexp in a VHDL buffer by re-fontifying it (menu | |||
| 1516 | (string :tag "Color (light)") | 1605 | (string :tag "Color (light)") |
| 1517 | (string :tag "Color (dark) "))) | 1606 | (string :tag "Color (dark) "))) |
| 1518 | :set (lambda (variable value) | 1607 | :set (lambda (variable value) |
| 1519 | (vhdl-custom-set variable value 'vhdl-font-lock-init)) | 1608 | (vhdl-custom-set variable value 'vhdl-font-lock-init)) |
| 1520 | :group 'vhdl-highlight) | 1609 | :group 'vhdl-highlight) |
| 1521 | 1610 | ||
| 1522 | (defcustom vhdl-forbidden-words '() | 1611 | (defcustom vhdl-forbidden-words '() |
| @@ -1528,7 +1617,7 @@ NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu | |||
| 1528 | entry \"Fontify Buffer\")." | 1617 | entry \"Fontify Buffer\")." |
| 1529 | :type '(repeat (string :format "%v")) | 1618 | :type '(repeat (string :format "%v")) |
| 1530 | :set (lambda (variable value) | 1619 | :set (lambda (variable value) |
| 1531 | (vhdl-custom-set variable value | 1620 | (vhdl-custom-set variable value |
| 1532 | 'vhdl-words-init 'vhdl-font-lock-init)) | 1621 | 'vhdl-words-init 'vhdl-font-lock-init)) |
| 1533 | :group 'vhdl-highlight) | 1622 | :group 'vhdl-highlight) |
| 1534 | 1623 | ||
| @@ -1543,7 +1632,7 @@ NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu | |||
| 1543 | entry \"Fontify Buffer\")." | 1632 | entry \"Fontify Buffer\")." |
| 1544 | :type 'regexp | 1633 | :type 'regexp |
| 1545 | :set (lambda (variable value) | 1634 | :set (lambda (variable value) |
| 1546 | (vhdl-custom-set variable value | 1635 | (vhdl-custom-set variable value |
| 1547 | 'vhdl-words-init 'vhdl-font-lock-init)) | 1636 | 'vhdl-words-init 'vhdl-font-lock-init)) |
| 1548 | :group 'vhdl-highlight) | 1637 | :group 'vhdl-highlight) |
| 1549 | 1638 | ||
| @@ -1739,7 +1828,7 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry | |||
| 1739 | \"Activate Options\"." | 1828 | \"Activate Options\"." |
| 1740 | :type 'boolean | 1829 | :type 'boolean |
| 1741 | :set (lambda (variable value) | 1830 | :set (lambda (variable value) |
| 1742 | (vhdl-custom-set variable value 'vhdl-mode-syntax-table-init)) | 1831 | (vhdl-custom-set variable value 'vhdl-mode-syntax-table-init)) |
| 1743 | :group 'vhdl-misc) | 1832 | :group 'vhdl-misc) |
| 1744 | 1833 | ||
| 1745 | 1834 | ||
| @@ -1785,24 +1874,25 @@ reported and the syntactic symbol is ignored.") | |||
| 1785 | "*If non-nil, syntactic info is echoed when the line is indented.") | 1874 | "*If non-nil, syntactic info is echoed when the line is indented.") |
| 1786 | 1875 | ||
| 1787 | (defconst vhdl-offsets-alist-default | 1876 | (defconst vhdl-offsets-alist-default |
| 1788 | '((string . -1000) | 1877 | '((string . -1000) |
| 1789 | (block-open . 0) | 1878 | (cpp-macro . -1000) |
| 1790 | (block-close . 0) | 1879 | (block-open . 0) |
| 1791 | (statement . 0) | 1880 | (block-close . 0) |
| 1792 | (statement-cont . vhdl-lineup-statement-cont) | 1881 | (statement . 0) |
| 1882 | (statement-cont . vhdl-lineup-statement-cont) | ||
| 1793 | (statement-block-intro . +) | 1883 | (statement-block-intro . +) |
| 1794 | (statement-case-intro . +) | 1884 | (statement-case-intro . +) |
| 1795 | (case-alternative . +) | 1885 | (case-alternative . +) |
| 1796 | (comment . vhdl-lineup-comment) | 1886 | (comment . vhdl-lineup-comment) |
| 1797 | (arglist-intro . +) | 1887 | (arglist-intro . +) |
| 1798 | (arglist-cont . 0) | 1888 | (arglist-cont . 0) |
| 1799 | (arglist-cont-nonempty . vhdl-lineup-arglist) | 1889 | (arglist-cont-nonempty . vhdl-lineup-arglist) |
| 1800 | (arglist-close . vhdl-lineup-arglist) | 1890 | (arglist-close . vhdl-lineup-arglist) |
| 1801 | (entity . 0) | 1891 | (entity . 0) |
| 1802 | (configuration . 0) | 1892 | (configuration . 0) |
| 1803 | (package . 0) | 1893 | (package . 0) |
| 1804 | (architecture . 0) | 1894 | (architecture . 0) |
| 1805 | (package-body . 0) | 1895 | (package-body . 0) |
| 1806 | ) | 1896 | ) |
| 1807 | "Default settings for offsets of syntactic elements. | 1897 | "Default settings for offsets of syntactic elements. |
| 1808 | Do not change this constant! See the variable `vhdl-offsets-alist' for | 1898 | Do not change this constant! See the variable `vhdl-offsets-alist' for |
| @@ -2036,6 +2126,10 @@ Ignore byte-compiler warnings you might see." | |||
| 2036 | (setq dirs (cdr dirs))) | 2126 | (setq dirs (cdr dirs))) |
| 2037 | contents))) | 2127 | contents))) |
| 2038 | 2128 | ||
| 2129 | ;; `member-ignore-case' undefined (XEmacs) | ||
| 2130 | (unless (fboundp 'member-ignore-case) | ||
| 2131 | (defalias 'member-ignore-case 'member)) | ||
| 2132 | |||
| 2039 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2133 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 2040 | ;; Compatibility with older VHDL Mode versions | 2134 | ;; Compatibility with older VHDL Mode versions |
| 2041 | 2135 | ||
| @@ -2575,25 +2669,25 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 2575 | "Initialize `vhdl-mode-map'." | 2669 | "Initialize `vhdl-mode-map'." |
| 2576 | (setq vhdl-mode-map (make-sparse-keymap)) | 2670 | (setq vhdl-mode-map (make-sparse-keymap)) |
| 2577 | ;; template key bindings | 2671 | ;; template key bindings |
| 2578 | (define-key vhdl-mode-map "\C-c\C-t" vhdl-template-map) | 2672 | (define-key vhdl-mode-map "\C-c\C-t" vhdl-template-map) |
| 2579 | ;; model key bindings | 2673 | ;; model key bindings |
| 2580 | (define-key vhdl-mode-map "\C-c\C-m" vhdl-model-map) | 2674 | (define-key vhdl-mode-map "\C-c\C-m" vhdl-model-map) |
| 2581 | ;; standard key bindings | 2675 | ;; standard key bindings |
| 2582 | (define-key vhdl-mode-map "\M-a" 'vhdl-beginning-of-statement) | 2676 | (define-key vhdl-mode-map "\M-a" 'vhdl-beginning-of-statement) |
| 2583 | (define-key vhdl-mode-map "\M-e" 'vhdl-end-of-statement) | 2677 | (define-key vhdl-mode-map "\M-e" 'vhdl-end-of-statement) |
| 2584 | (define-key vhdl-mode-map "\M-\C-f" 'vhdl-forward-sexp) | 2678 | (define-key vhdl-mode-map "\M-\C-f" 'vhdl-forward-sexp) |
| 2585 | (define-key vhdl-mode-map "\M-\C-b" 'vhdl-backward-sexp) | 2679 | (define-key vhdl-mode-map "\M-\C-b" 'vhdl-backward-sexp) |
| 2586 | (define-key vhdl-mode-map "\M-\C-u" 'vhdl-backward-up-list) | 2680 | (define-key vhdl-mode-map "\M-\C-u" 'vhdl-backward-up-list) |
| 2587 | (define-key vhdl-mode-map "\M-\C-a" 'vhdl-backward-same-indent) | 2681 | (define-key vhdl-mode-map "\M-\C-a" 'vhdl-backward-same-indent) |
| 2588 | (define-key vhdl-mode-map "\M-\C-e" 'vhdl-forward-same-indent) | 2682 | (define-key vhdl-mode-map "\M-\C-e" 'vhdl-forward-same-indent) |
| 2589 | (unless vhdl-xemacs ; would override `M-backspace' in XEmacs | 2683 | (unless vhdl-xemacs ; would override `M-backspace' in XEmacs |
| 2590 | (define-key vhdl-mode-map "\M-\C-h" 'vhdl-mark-defun)) | 2684 | (define-key vhdl-mode-map "\M-\C-h" 'vhdl-mark-defun)) |
| 2591 | (define-key vhdl-mode-map "\M-\C-q" 'vhdl-indent-sexp) | 2685 | (define-key vhdl-mode-map "\M-\C-q" 'vhdl-indent-sexp) |
| 2592 | (define-key vhdl-mode-map "\M-^" 'vhdl-delete-indentation) | 2686 | (define-key vhdl-mode-map "\M-^" 'vhdl-delete-indentation) |
| 2593 | ;; backspace/delete key bindings | 2687 | ;; backspace/delete key bindings |
| 2594 | (define-key vhdl-mode-map [backspace] 'backward-delete-char-untabify) | 2688 | (define-key vhdl-mode-map [backspace] 'backward-delete-char-untabify) |
| 2595 | (unless (boundp 'delete-key-deletes-forward) ; XEmacs variable | 2689 | (unless (boundp 'delete-key-deletes-forward) ; XEmacs variable |
| 2596 | (define-key vhdl-mode-map [delete] 'delete-char) | 2690 | (define-key vhdl-mode-map [delete] 'delete-char) |
| 2597 | (define-key vhdl-mode-map [(meta delete)] 'kill-word)) | 2691 | (define-key vhdl-mode-map [(meta delete)] 'kill-word)) |
| 2598 | ;; mode specific key bindings | 2692 | ;; mode specific key bindings |
| 2599 | (define-key vhdl-mode-map "\C-c\C-m\C-e" 'vhdl-electric-mode) | 2693 | (define-key vhdl-mode-map "\C-c\C-m\C-e" 'vhdl-electric-mode) |
| @@ -2603,7 +2697,7 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 2603 | (define-key vhdl-mode-map "\C-c\C-p\C-m" 'vhdl-import-project) | 2697 | (define-key vhdl-mode-map "\C-c\C-p\C-m" 'vhdl-import-project) |
| 2604 | (define-key vhdl-mode-map "\C-c\C-p\C-x" 'vhdl-export-project) | 2698 | (define-key vhdl-mode-map "\C-c\C-p\C-x" 'vhdl-export-project) |
| 2605 | (define-key vhdl-mode-map "\C-c\C-s\C-k" 'vhdl-set-compiler) | 2699 | (define-key vhdl-mode-map "\C-c\C-s\C-k" 'vhdl-set-compiler) |
| 2606 | (define-key vhdl-mode-map "\C-c\C-k" 'vhdl-compile) | 2700 | (define-key vhdl-mode-map "\C-c\C-k" 'vhdl-compile) |
| 2607 | (define-key vhdl-mode-map "\C-c\M-\C-k" 'vhdl-make) | 2701 | (define-key vhdl-mode-map "\C-c\M-\C-k" 'vhdl-make) |
| 2608 | (define-key vhdl-mode-map "\C-c\M-k" 'vhdl-generate-makefile) | 2702 | (define-key vhdl-mode-map "\C-c\M-k" 'vhdl-generate-makefile) |
| 2609 | (define-key vhdl-mode-map "\C-c\C-p\C-w" 'vhdl-port-copy) | 2703 | (define-key vhdl-mode-map "\C-c\C-p\C-w" 'vhdl-port-copy) |
| @@ -2629,13 +2723,14 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 2629 | (define-key vhdl-mode-map "\C-c\C-c\C-n" 'vhdl-compose-new-component) | 2723 | (define-key vhdl-mode-map "\C-c\C-c\C-n" 'vhdl-compose-new-component) |
| 2630 | (define-key vhdl-mode-map "\C-c\C-c\C-p" 'vhdl-compose-place-component) | 2724 | (define-key vhdl-mode-map "\C-c\C-c\C-p" 'vhdl-compose-place-component) |
| 2631 | (define-key vhdl-mode-map "\C-c\C-c\C-w" 'vhdl-compose-wire-components) | 2725 | (define-key vhdl-mode-map "\C-c\C-c\C-w" 'vhdl-compose-wire-components) |
| 2726 | (define-key vhdl-mode-map "\C-c\C-c\C-f" 'vhdl-compose-configuration) | ||
| 2632 | (define-key vhdl-mode-map "\C-c\C-c\C-k" 'vhdl-compose-components-package) | 2727 | (define-key vhdl-mode-map "\C-c\C-c\C-k" 'vhdl-compose-components-package) |
| 2633 | (define-key vhdl-mode-map "\C-cc" 'vhdl-comment-uncomment-region) | 2728 | (define-key vhdl-mode-map "\C-cc" 'vhdl-comment-uncomment-region) |
| 2634 | (define-key vhdl-mode-map "\C-c-" 'vhdl-comment-append-inline) | 2729 | (define-key vhdl-mode-map "\C-c-" 'vhdl-comment-append-inline) |
| 2635 | (define-key vhdl-mode-map "\C-c\M--" 'vhdl-comment-display-line) | 2730 | (define-key vhdl-mode-map "\C-c\M--" 'vhdl-comment-display-line) |
| 2636 | (define-key vhdl-mode-map "\C-c\C-i\C-l" 'indent-according-to-mode) | 2731 | (define-key vhdl-mode-map "\C-c\C-i\C-l" 'indent-according-to-mode) |
| 2637 | (define-key vhdl-mode-map "\C-c\C-i\C-g" 'vhdl-indent-group) | 2732 | (define-key vhdl-mode-map "\C-c\C-i\C-g" 'vhdl-indent-group) |
| 2638 | (define-key vhdl-mode-map "\M-\C-\\" 'vhdl-indent-region) | 2733 | (define-key vhdl-mode-map "\M-\C-\\" 'vhdl-indent-region) |
| 2639 | (define-key vhdl-mode-map "\C-c\C-i\C-b" 'vhdl-indent-buffer) | 2734 | (define-key vhdl-mode-map "\C-c\C-i\C-b" 'vhdl-indent-buffer) |
| 2640 | (define-key vhdl-mode-map "\C-c\C-a\C-g" 'vhdl-align-group) | 2735 | (define-key vhdl-mode-map "\C-c\C-a\C-g" 'vhdl-align-group) |
| 2641 | (define-key vhdl-mode-map "\C-c\C-a\C-a" 'vhdl-align-group) | 2736 | (define-key vhdl-mode-map "\C-c\C-a\C-a" 'vhdl-align-group) |
| @@ -2665,38 +2760,35 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 2665 | (define-key vhdl-mode-map "\C-c\C-x\C-c" 'vhdl-fix-case-buffer) | 2760 | (define-key vhdl-mode-map "\C-c\C-x\C-c" 'vhdl-fix-case-buffer) |
| 2666 | (define-key vhdl-mode-map "\C-c\C-x\M-w" 'vhdl-fixup-whitespace-region) | 2761 | (define-key vhdl-mode-map "\C-c\C-x\M-w" 'vhdl-fixup-whitespace-region) |
| 2667 | (define-key vhdl-mode-map "\C-c\C-x\C-w" 'vhdl-fixup-whitespace-buffer) | 2762 | (define-key vhdl-mode-map "\C-c\C-x\C-w" 'vhdl-fixup-whitespace-buffer) |
| 2668 | (define-key vhdl-mode-map "\C-c\M-b" 'vhdl-beautify-region) | 2763 | (define-key vhdl-mode-map "\C-c\M-b" 'vhdl-beautify-region) |
| 2669 | (define-key vhdl-mode-map "\C-c\C-b" 'vhdl-beautify-buffer) | 2764 | (define-key vhdl-mode-map "\C-c\C-b" 'vhdl-beautify-buffer) |
| 2670 | (define-key vhdl-mode-map "\C-c\C-u\C-s" 'vhdl-update-sensitivity-list-process) | 2765 | (define-key vhdl-mode-map "\C-c\C-u\C-s" 'vhdl-update-sensitivity-list-process) |
| 2671 | (define-key vhdl-mode-map "\C-c\C-u\M-s" 'vhdl-update-sensitivity-list-buffer) | 2766 | (define-key vhdl-mode-map "\C-c\C-u\M-s" 'vhdl-update-sensitivity-list-buffer) |
| 2672 | (define-key vhdl-mode-map "\C-cf" 'vhdl-fontify-buffer) | 2767 | (define-key vhdl-mode-map "\C-cf" 'vhdl-fontify-buffer) |
| 2673 | (define-key vhdl-mode-map "\C-cs" 'vhdl-statistics-buffer) | 2768 | (define-key vhdl-mode-map "\C-cs" 'vhdl-statistics-buffer) |
| 2674 | (define-key vhdl-mode-map "\C-c\M-m" 'vhdl-show-messages) | 2769 | (define-key vhdl-mode-map "\C-c\M-m" 'vhdl-show-messages) |
| 2675 | (define-key vhdl-mode-map "\C-c\C-h" 'vhdl-doc-mode) | 2770 | (define-key vhdl-mode-map "\C-c\C-h" 'vhdl-doc-mode) |
| 2676 | (define-key vhdl-mode-map "\C-c\C-v" 'vhdl-version) | 2771 | (define-key vhdl-mode-map "\C-c\C-v" 'vhdl-version) |
| 2677 | (define-key vhdl-mode-map "\M-\t" 'insert-tab) | 2772 | (define-key vhdl-mode-map "\M-\t" 'insert-tab) |
| 2678 | ;; insert commands bindings | 2773 | ;; insert commands bindings |
| 2679 | (define-key vhdl-mode-map "\C-c\C-i\C-t" 'vhdl-template-insert-construct) | 2774 | (define-key vhdl-mode-map "\C-c\C-i\C-t" 'vhdl-template-insert-construct) |
| 2680 | (define-key vhdl-mode-map "\C-c\C-i\C-p" 'vhdl-template-insert-package) | 2775 | (define-key vhdl-mode-map "\C-c\C-i\C-p" 'vhdl-template-insert-package) |
| 2681 | (define-key vhdl-mode-map "\C-c\C-i\C-d" 'vhdl-template-insert-directive) | 2776 | (define-key vhdl-mode-map "\C-c\C-i\C-d" 'vhdl-template-insert-directive) |
| 2682 | (define-key vhdl-mode-map "\C-c\C-i\C-m" 'vhdl-model-insert) | 2777 | (define-key vhdl-mode-map "\C-c\C-i\C-m" 'vhdl-model-insert) |
| 2683 | ;; electric key bindings | 2778 | ;; electric key bindings |
| 2684 | (define-key vhdl-mode-map " " 'vhdl-electric-space) | 2779 | (define-key vhdl-mode-map " " 'vhdl-electric-space) |
| 2685 | (if vhdl-intelligent-tab | 2780 | (when vhdl-intelligent-tab |
| 2686 | (define-key vhdl-mode-map "\t" 'vhdl-electric-tab) | 2781 | (define-key vhdl-mode-map "\t" 'vhdl-electric-tab)) |
| 2687 | ;; The default binding of TAB already calls `indent-according-to-mode'. | 2782 | (define-key vhdl-mode-map "\r" 'vhdl-electric-return) |
| 2688 | ;; (define-key vhdl-mode-map "\t" 'indent-according-to-mode) | 2783 | (define-key vhdl-mode-map "-" 'vhdl-electric-dash) |
| 2689 | ) | 2784 | (define-key vhdl-mode-map "[" 'vhdl-electric-open-bracket) |
| 2690 | (define-key vhdl-mode-map "\r" 'vhdl-electric-return) | 2785 | (define-key vhdl-mode-map "]" 'vhdl-electric-close-bracket) |
| 2691 | (define-key vhdl-mode-map "-" 'vhdl-electric-dash) | 2786 | (define-key vhdl-mode-map "'" 'vhdl-electric-quote) |
| 2692 | (define-key vhdl-mode-map "[" 'vhdl-electric-open-bracket) | 2787 | (define-key vhdl-mode-map ";" 'vhdl-electric-semicolon) |
| 2693 | (define-key vhdl-mode-map "]" 'vhdl-electric-close-bracket) | 2788 | (define-key vhdl-mode-map "," 'vhdl-electric-comma) |
| 2694 | (define-key vhdl-mode-map "'" 'vhdl-electric-quote) | 2789 | (define-key vhdl-mode-map "." 'vhdl-electric-period) |
| 2695 | (define-key vhdl-mode-map ";" 'vhdl-electric-semicolon) | ||
| 2696 | (define-key vhdl-mode-map "," 'vhdl-electric-comma) | ||
| 2697 | (define-key vhdl-mode-map "." 'vhdl-electric-period) | ||
| 2698 | (when (vhdl-standard-p 'ams) | 2790 | (when (vhdl-standard-p 'ams) |
| 2699 | (define-key vhdl-mode-map "=" 'vhdl-electric-equal))) | 2791 | (define-key vhdl-mode-map "=" 'vhdl-electric-equal))) |
| 2700 | 2792 | ||
| 2701 | ;; initialize mode map for VHDL Mode | 2793 | ;; initialize mode map for VHDL Mode |
| 2702 | (vhdl-mode-map-init) | 2794 | (vhdl-mode-map-init) |
| @@ -2801,134 +2893,134 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 2801 | (when (memq 'vhdl vhdl-electric-keywords) | 2893 | (when (memq 'vhdl vhdl-electric-keywords) |
| 2802 | ;; VHDL'93 keywords | 2894 | ;; VHDL'93 keywords |
| 2803 | '( | 2895 | '( |
| 2804 | ("--" "" vhdl-template-display-comment-hook 0 t) | 2896 | ("--" "" vhdl-template-display-comment-hook 0) |
| 2805 | ("abs" "" vhdl-template-default-hook 0 t) | 2897 | ("abs" "" vhdl-template-default-hook 0) |
| 2806 | ("access" "" vhdl-template-default-hook 0 t) | 2898 | ("access" "" vhdl-template-default-hook 0) |
| 2807 | ("after" "" vhdl-template-default-hook 0 t) | 2899 | ("after" "" vhdl-template-default-hook 0) |
| 2808 | ("alias" "" vhdl-template-alias-hook 0 t) | 2900 | ("alias" "" vhdl-template-alias-hook 0) |
| 2809 | ("all" "" vhdl-template-default-hook 0 t) | 2901 | ("all" "" vhdl-template-default-hook 0) |
| 2810 | ("and" "" vhdl-template-default-hook 0 t) | 2902 | ("and" "" vhdl-template-default-hook 0) |
| 2811 | ("arch" "" vhdl-template-architecture-hook 0 t) | 2903 | ("arch" "" vhdl-template-architecture-hook 0) |
| 2812 | ("architecture" "" vhdl-template-architecture-hook 0 t) | 2904 | ("architecture" "" vhdl-template-architecture-hook 0) |
| 2813 | ("array" "" vhdl-template-default-hook 0 t) | 2905 | ("array" "" vhdl-template-default-hook 0) |
| 2814 | ("assert" "" vhdl-template-assert-hook 0 t) | 2906 | ("assert" "" vhdl-template-assert-hook 0) |
| 2815 | ("attr" "" vhdl-template-attribute-hook 0 t) | 2907 | ("attr" "" vhdl-template-attribute-hook 0) |
| 2816 | ("attribute" "" vhdl-template-attribute-hook 0 t) | 2908 | ("attribute" "" vhdl-template-attribute-hook 0) |
| 2817 | ("begin" "" vhdl-template-default-indent-hook 0 t) | 2909 | ("begin" "" vhdl-template-default-indent-hook 0) |
| 2818 | ("block" "" vhdl-template-block-hook 0 t) | 2910 | ("block" "" vhdl-template-block-hook 0) |
| 2819 | ("body" "" vhdl-template-default-hook 0 t) | 2911 | ("body" "" vhdl-template-default-hook 0) |
| 2820 | ("buffer" "" vhdl-template-default-hook 0 t) | 2912 | ("buffer" "" vhdl-template-default-hook 0) |
| 2821 | ("bus" "" vhdl-template-default-hook 0 t) | 2913 | ("bus" "" vhdl-template-default-hook 0) |
| 2822 | ("case" "" vhdl-template-case-hook 0 t) | 2914 | ("case" "" vhdl-template-case-hook 0) |
| 2823 | ("comp" "" vhdl-template-component-hook 0 t) | 2915 | ("comp" "" vhdl-template-component-hook 0) |
| 2824 | ("component" "" vhdl-template-component-hook 0 t) | 2916 | ("component" "" vhdl-template-component-hook 0) |
| 2825 | ("cond" "" vhdl-template-conditional-signal-asst-hook 0 t) | 2917 | ("cond" "" vhdl-template-conditional-signal-asst-hook 0) |
| 2826 | ("conditional" "" vhdl-template-conditional-signal-asst-hook 0 t) | 2918 | ("conditional" "" vhdl-template-conditional-signal-asst-hook 0) |
| 2827 | ("conf" "" vhdl-template-configuration-hook 0 t) | 2919 | ("conf" "" vhdl-template-configuration-hook 0) |
| 2828 | ("configuration" "" vhdl-template-configuration-hook 0 t) | 2920 | ("configuration" "" vhdl-template-configuration-hook 0) |
| 2829 | ("cons" "" vhdl-template-constant-hook 0 t) | 2921 | ("cons" "" vhdl-template-constant-hook 0) |
| 2830 | ("constant" "" vhdl-template-constant-hook 0 t) | 2922 | ("constant" "" vhdl-template-constant-hook 0) |
| 2831 | ("disconnect" "" vhdl-template-disconnect-hook 0 t) | 2923 | ("disconnect" "" vhdl-template-disconnect-hook 0) |
| 2832 | ("downto" "" vhdl-template-default-hook 0 t) | 2924 | ("downto" "" vhdl-template-default-hook 0) |
| 2833 | ("else" "" vhdl-template-else-hook 0 t) | 2925 | ("else" "" vhdl-template-else-hook 0) |
| 2834 | ("elseif" "" vhdl-template-elsif-hook 0 t) | 2926 | ("elseif" "" vhdl-template-elsif-hook 0) |
| 2835 | ("elsif" "" vhdl-template-elsif-hook 0 t) | 2927 | ("elsif" "" vhdl-template-elsif-hook 0) |
| 2836 | ("end" "" vhdl-template-default-indent-hook 0 t) | 2928 | ("end" "" vhdl-template-default-indent-hook 0) |
| 2837 | ("entity" "" vhdl-template-entity-hook 0 t) | 2929 | ("entity" "" vhdl-template-entity-hook 0) |
| 2838 | ("exit" "" vhdl-template-exit-hook 0 t) | 2930 | ("exit" "" vhdl-template-exit-hook 0) |
| 2839 | ("file" "" vhdl-template-file-hook 0 t) | 2931 | ("file" "" vhdl-template-file-hook 0) |
| 2840 | ("for" "" vhdl-template-for-hook 0 t) | 2932 | ("for" "" vhdl-template-for-hook 0) |
| 2841 | ("func" "" vhdl-template-function-hook 0 t) | 2933 | ("func" "" vhdl-template-function-hook 0) |
| 2842 | ("function" "" vhdl-template-function-hook 0 t) | 2934 | ("function" "" vhdl-template-function-hook 0) |
| 2843 | ("generic" "" vhdl-template-generic-hook 0 t) | 2935 | ("generic" "" vhdl-template-generic-hook 0) |
| 2844 | ("group" "" vhdl-template-group-hook 0 t) | 2936 | ("group" "" vhdl-template-group-hook 0) |
| 2845 | ("guarded" "" vhdl-template-default-hook 0 t) | 2937 | ("guarded" "" vhdl-template-default-hook 0) |
| 2846 | ("if" "" vhdl-template-if-hook 0 t) | 2938 | ("if" "" vhdl-template-if-hook 0) |
| 2847 | ("impure" "" vhdl-template-default-hook 0 t) | 2939 | ("impure" "" vhdl-template-default-hook 0) |
| 2848 | ("in" "" vhdl-template-default-hook 0 t) | 2940 | ("in" "" vhdl-template-default-hook 0) |
| 2849 | ("inertial" "" vhdl-template-default-hook 0 t) | 2941 | ("inertial" "" vhdl-template-default-hook 0) |
| 2850 | ("inout" "" vhdl-template-default-hook 0 t) | 2942 | ("inout" "" vhdl-template-default-hook 0) |
| 2851 | ("inst" "" vhdl-template-instance-hook 0 t) | 2943 | ("inst" "" vhdl-template-instance-hook 0) |
| 2852 | ("instance" "" vhdl-template-instance-hook 0 t) | 2944 | ("instance" "" vhdl-template-instance-hook 0) |
| 2853 | ("is" "" vhdl-template-default-hook 0 t) | 2945 | ("is" "" vhdl-template-default-hook 0) |
| 2854 | ("label" "" vhdl-template-default-hook 0 t) | 2946 | ("label" "" vhdl-template-default-hook 0) |
| 2855 | ("library" "" vhdl-template-library-hook 0 t) | 2947 | ("library" "" vhdl-template-library-hook 0) |
| 2856 | ("linkage" "" vhdl-template-default-hook 0 t) | 2948 | ("linkage" "" vhdl-template-default-hook 0) |
| 2857 | ("literal" "" vhdl-template-default-hook 0 t) | 2949 | ("literal" "" vhdl-template-default-hook 0) |
| 2858 | ("loop" "" vhdl-template-bare-loop-hook 0 t) | 2950 | ("loop" "" vhdl-template-bare-loop-hook 0) |
| 2859 | ("map" "" vhdl-template-map-hook 0 t) | 2951 | ("map" "" vhdl-template-map-hook 0) |
| 2860 | ("mod" "" vhdl-template-default-hook 0 t) | 2952 | ("mod" "" vhdl-template-default-hook 0) |
| 2861 | ("nand" "" vhdl-template-default-hook 0 t) | 2953 | ("nand" "" vhdl-template-default-hook 0) |
| 2862 | ("new" "" vhdl-template-default-hook 0 t) | 2954 | ("new" "" vhdl-template-default-hook 0) |
| 2863 | ("next" "" vhdl-template-next-hook 0 t) | 2955 | ("next" "" vhdl-template-next-hook 0) |
| 2864 | ("nor" "" vhdl-template-default-hook 0 t) | 2956 | ("nor" "" vhdl-template-default-hook 0) |
| 2865 | ("not" "" vhdl-template-default-hook 0 t) | 2957 | ("not" "" vhdl-template-default-hook 0) |
| 2866 | ("null" "" vhdl-template-default-hook 0 t) | 2958 | ("null" "" vhdl-template-default-hook 0) |
| 2867 | ("of" "" vhdl-template-default-hook 0 t) | 2959 | ("of" "" vhdl-template-default-hook 0) |
| 2868 | ("on" "" vhdl-template-default-hook 0 t) | 2960 | ("on" "" vhdl-template-default-hook 0) |
| 2869 | ("open" "" vhdl-template-default-hook 0 t) | 2961 | ("open" "" vhdl-template-default-hook 0) |
| 2870 | ("or" "" vhdl-template-default-hook 0 t) | 2962 | ("or" "" vhdl-template-default-hook 0) |
| 2871 | ("others" "" vhdl-template-others-hook 0 t) | 2963 | ("others" "" vhdl-template-others-hook 0) |
| 2872 | ("out" "" vhdl-template-default-hook 0 t) | 2964 | ("out" "" vhdl-template-default-hook 0) |
| 2873 | ("pack" "" vhdl-template-package-hook 0 t) | 2965 | ("pack" "" vhdl-template-package-hook 0) |
| 2874 | ("package" "" vhdl-template-package-hook 0 t) | 2966 | ("package" "" vhdl-template-package-hook 0) |
| 2875 | ("port" "" vhdl-template-port-hook 0 t) | 2967 | ("port" "" vhdl-template-port-hook 0) |
| 2876 | ("postponed" "" vhdl-template-default-hook 0 t) | 2968 | ("postponed" "" vhdl-template-default-hook 0) |
| 2877 | ("procedure" "" vhdl-template-procedure-hook 0 t) | 2969 | ("procedure" "" vhdl-template-procedure-hook 0) |
| 2878 | ("process" "" vhdl-template-process-hook 0 t) | 2970 | ("process" "" vhdl-template-process-hook 0) |
| 2879 | ("pure" "" vhdl-template-default-hook 0 t) | 2971 | ("pure" "" vhdl-template-default-hook 0) |
| 2880 | ("range" "" vhdl-template-default-hook 0 t) | 2972 | ("range" "" vhdl-template-default-hook 0) |
| 2881 | ("record" "" vhdl-template-default-hook 0 t) | 2973 | ("record" "" vhdl-template-default-hook 0) |
| 2882 | ("register" "" vhdl-template-default-hook 0 t) | 2974 | ("register" "" vhdl-template-default-hook 0) |
| 2883 | ("reject" "" vhdl-template-default-hook 0 t) | 2975 | ("reject" "" vhdl-template-default-hook 0) |
| 2884 | ("rem" "" vhdl-template-default-hook 0 t) | 2976 | ("rem" "" vhdl-template-default-hook 0) |
| 2885 | ("report" "" vhdl-template-report-hook 0 t) | 2977 | ("report" "" vhdl-template-report-hook 0) |
| 2886 | ("return" "" vhdl-template-return-hook 0 t) | 2978 | ("return" "" vhdl-template-return-hook 0) |
| 2887 | ("rol" "" vhdl-template-default-hook 0 t) | 2979 | ("rol" "" vhdl-template-default-hook 0) |
| 2888 | ("ror" "" vhdl-template-default-hook 0 t) | 2980 | ("ror" "" vhdl-template-default-hook 0) |
| 2889 | ("select" "" vhdl-template-selected-signal-asst-hook 0 t) | 2981 | ("select" "" vhdl-template-selected-signal-asst-hook 0) |
| 2890 | ("severity" "" vhdl-template-default-hook 0 t) | 2982 | ("severity" "" vhdl-template-default-hook 0) |
| 2891 | ("shared" "" vhdl-template-default-hook 0 t) | 2983 | ("shared" "" vhdl-template-default-hook 0) |
| 2892 | ("sig" "" vhdl-template-signal-hook 0 t) | 2984 | ("sig" "" vhdl-template-signal-hook 0) |
| 2893 | ("signal" "" vhdl-template-signal-hook 0 t) | 2985 | ("signal" "" vhdl-template-signal-hook 0) |
| 2894 | ("sla" "" vhdl-template-default-hook 0 t) | 2986 | ("sla" "" vhdl-template-default-hook 0) |
| 2895 | ("sll" "" vhdl-template-default-hook 0 t) | 2987 | ("sll" "" vhdl-template-default-hook 0) |
| 2896 | ("sra" "" vhdl-template-default-hook 0 t) | 2988 | ("sra" "" vhdl-template-default-hook 0) |
| 2897 | ("srl" "" vhdl-template-default-hook 0 t) | 2989 | ("srl" "" vhdl-template-default-hook 0) |
| 2898 | ("subtype" "" vhdl-template-subtype-hook 0 t) | 2990 | ("subtype" "" vhdl-template-subtype-hook 0) |
| 2899 | ("then" "" vhdl-template-default-hook 0 t) | 2991 | ("then" "" vhdl-template-default-hook 0) |
| 2900 | ("to" "" vhdl-template-default-hook 0 t) | 2992 | ("to" "" vhdl-template-default-hook 0) |
| 2901 | ("transport" "" vhdl-template-default-hook 0 t) | 2993 | ("transport" "" vhdl-template-default-hook 0) |
| 2902 | ("type" "" vhdl-template-type-hook 0 t) | 2994 | ("type" "" vhdl-template-type-hook 0) |
| 2903 | ("unaffected" "" vhdl-template-default-hook 0 t) | 2995 | ("unaffected" "" vhdl-template-default-hook 0) |
| 2904 | ("units" "" vhdl-template-default-hook 0 t) | 2996 | ("units" "" vhdl-template-default-hook 0) |
| 2905 | ("until" "" vhdl-template-default-hook 0 t) | 2997 | ("until" "" vhdl-template-default-hook 0) |
| 2906 | ("use" "" vhdl-template-use-hook 0 t) | 2998 | ("use" "" vhdl-template-use-hook 0) |
| 2907 | ("var" "" vhdl-template-variable-hook 0 t) | 2999 | ("var" "" vhdl-template-variable-hook 0) |
| 2908 | ("variable" "" vhdl-template-variable-hook 0 t) | 3000 | ("variable" "" vhdl-template-variable-hook 0) |
| 2909 | ("wait" "" vhdl-template-wait-hook 0 t) | 3001 | ("wait" "" vhdl-template-wait-hook 0) |
| 2910 | ("when" "" vhdl-template-when-hook 0 t) | 3002 | ("when" "" vhdl-template-when-hook 0) |
| 2911 | ("while" "" vhdl-template-while-loop-hook 0 t) | 3003 | ("while" "" vhdl-template-while-loop-hook 0) |
| 2912 | ("with" "" vhdl-template-with-hook 0 t) | 3004 | ("with" "" vhdl-template-with-hook 0) |
| 2913 | ("xnor" "" vhdl-template-default-hook 0 t) | 3005 | ("xnor" "" vhdl-template-default-hook 0) |
| 2914 | ("xor" "" vhdl-template-default-hook 0 t) | 3006 | ("xor" "" vhdl-template-default-hook 0) |
| 2915 | )) | 3007 | )) |
| 2916 | ;; VHDL-AMS keywords | 3008 | ;; VHDL-AMS keywords |
| 2917 | (when (and (memq 'vhdl vhdl-electric-keywords) (vhdl-standard-p 'ams)) | 3009 | (when (and (memq 'vhdl vhdl-electric-keywords) (vhdl-standard-p 'ams)) |
| 2918 | '( | 3010 | '( |
| 2919 | ("across" "" vhdl-template-default-hook 0 t) | 3011 | ("across" "" vhdl-template-default-hook 0) |
| 2920 | ("break" "" vhdl-template-break-hook 0 t) | 3012 | ("break" "" vhdl-template-break-hook 0) |
| 2921 | ("limit" "" vhdl-template-limit-hook 0 t) | 3013 | ("limit" "" vhdl-template-limit-hook 0) |
| 2922 | ("nature" "" vhdl-template-nature-hook 0 t) | 3014 | ("nature" "" vhdl-template-nature-hook 0) |
| 2923 | ("noise" "" vhdl-template-default-hook 0 t) | 3015 | ("noise" "" vhdl-template-default-hook 0) |
| 2924 | ("procedural" "" vhdl-template-procedural-hook 0 t) | 3016 | ("procedural" "" vhdl-template-procedural-hook 0) |
| 2925 | ("quantity" "" vhdl-template-quantity-hook 0 t) | 3017 | ("quantity" "" vhdl-template-quantity-hook 0) |
| 2926 | ("reference" "" vhdl-template-default-hook 0 t) | 3018 | ("reference" "" vhdl-template-default-hook 0) |
| 2927 | ("spectrum" "" vhdl-template-default-hook 0 t) | 3019 | ("spectrum" "" vhdl-template-default-hook 0) |
| 2928 | ("subnature" "" vhdl-template-subnature-hook 0 t) | 3020 | ("subnature" "" vhdl-template-subnature-hook 0) |
| 2929 | ("terminal" "" vhdl-template-terminal-hook 0 t) | 3021 | ("terminal" "" vhdl-template-terminal-hook 0) |
| 2930 | ("through" "" vhdl-template-default-hook 0 t) | 3022 | ("through" "" vhdl-template-default-hook 0) |
| 2931 | ("tolerance" "" vhdl-template-default-hook 0 t) | 3023 | ("tolerance" "" vhdl-template-default-hook 0) |
| 2932 | )) | 3024 | )) |
| 2933 | ;; user model keywords | 3025 | ;; user model keywords |
| 2934 | (when (memq 'user vhdl-electric-keywords) | 3026 | (when (memq 'user vhdl-electric-keywords) |
| @@ -2940,7 +3032,7 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 2940 | (setq abbrev-list | 3032 | (setq abbrev-list |
| 2941 | (cons (list keyword "" | 3033 | (cons (list keyword "" |
| 2942 | (vhdl-function-name | 3034 | (vhdl-function-name |
| 2943 | "vhdl-model" (nth 0 (car alist)) "hook") 0 t) | 3035 | "vhdl-model" (nth 0 (car alist)) "hook") 0) |
| 2944 | abbrev-list))) | 3036 | abbrev-list))) |
| 2945 | (setq alist (cdr alist))) | 3037 | (setq alist (cdr alist))) |
| 2946 | abbrev-list))))) | 3038 | abbrev-list))))) |
| @@ -3094,6 +3186,7 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 3094 | (vhdl-menu-split menu-list "Project")) | 3186 | (vhdl-menu-split menu-list "Project")) |
| 3095 | '("--" "--" | 3187 | '("--" "--" |
| 3096 | ["Select Project..." vhdl-set-project t] | 3188 | ["Select Project..." vhdl-set-project t] |
| 3189 | ["Set As Default Project" vhdl-set-default-project t] | ||
| 3097 | "--" | 3190 | "--" |
| 3098 | ["Duplicate Project" vhdl-duplicate-project vhdl-project] | 3191 | ["Duplicate Project" vhdl-duplicate-project vhdl-project] |
| 3099 | ["Import Project..." vhdl-import-project | 3192 | ["Import Project..." vhdl-import-project |
| @@ -3280,9 +3373,11 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 3280 | :style toggle :selected vhdl-port-reversed-direction :active vhdl-port-list]) | 3373 | :style toggle :selected vhdl-port-reversed-direction :active vhdl-port-list]) |
| 3281 | ("Compose" | 3374 | ("Compose" |
| 3282 | ["New Component" vhdl-compose-new-component t] | 3375 | ["New Component" vhdl-compose-new-component t] |
| 3376 | ["Copy Component" vhdl-port-copy t] | ||
| 3283 | ["Place Component" vhdl-compose-place-component vhdl-port-list] | 3377 | ["Place Component" vhdl-compose-place-component vhdl-port-list] |
| 3284 | ["Wire Components" vhdl-compose-wire-components t] | 3378 | ["Wire Components" vhdl-compose-wire-components t] |
| 3285 | "--" | 3379 | "--" |
| 3380 | ["Generate Configuration" vhdl-compose-configuration t] | ||
| 3286 | ["Generate Components Package" vhdl-compose-components-package t]) | 3381 | ["Generate Components Package" vhdl-compose-components-package t]) |
| 3287 | ("Subprogram" | 3382 | ("Subprogram" |
| 3288 | ["Copy" vhdl-subprog-copy t] | 3383 | ["Copy" vhdl-subprog-copy t] |
| @@ -3526,6 +3621,8 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 3526 | ["Entity File Name..." (customize-option 'vhdl-entity-file-name) t] | 3621 | ["Entity File Name..." (customize-option 'vhdl-entity-file-name) t] |
| 3527 | ["Architecture File Name..." | 3622 | ["Architecture File Name..." |
| 3528 | (customize-option 'vhdl-architecture-file-name) t] | 3623 | (customize-option 'vhdl-architecture-file-name) t] |
| 3624 | ["Configuration File Name..." | ||
| 3625 | (customize-option 'vhdl-configuration-file-name) t] | ||
| 3529 | ["Package File Name..." (customize-option 'vhdl-package-file-name) t] | 3626 | ["Package File Name..." (customize-option 'vhdl-package-file-name) t] |
| 3530 | ("File Name Case" | 3627 | ("File Name Case" |
| 3531 | ["As Is" | 3628 | ["As Is" |
| @@ -3695,11 +3792,29 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 3695 | :style radio :selected (eq 'single vhdl-testbench-create-files)] | 3792 | :style radio :selected (eq 'single vhdl-testbench-create-files)] |
| 3696 | ["Separate" | 3793 | ["Separate" |
| 3697 | (customize-set-variable 'vhdl-testbench-create-files 'separate) | 3794 | (customize-set-variable 'vhdl-testbench-create-files 'separate) |
| 3698 | :style radio :selected (eq 'separate vhdl-testbench-create-files)])) | 3795 | :style radio :selected (eq 'separate vhdl-testbench-create-files)]) |
| 3796 | ["Testbench Entity File Name..." | ||
| 3797 | (customize-option 'vhdl-testbench-entity-file-name) t] | ||
| 3798 | ["Testbench Architecture File Name..." | ||
| 3799 | (customize-option 'vhdl-testbench-architecture-file-name) t]) | ||
| 3699 | "--" | 3800 | "--" |
| 3700 | ["Customize Group..." (customize-group 'vhdl-port) t]) | 3801 | ["Customize Group..." (customize-group 'vhdl-port) t]) |
| 3701 | ("Compose" | 3802 | ("Compose" |
| 3702 | ("Create Files" | 3803 | ["Architecture Name..." |
| 3804 | (customize-option 'vhdl-compose-architecture-name) t] | ||
| 3805 | ["Configuration Name..." | ||
| 3806 | (customize-option 'vhdl-compose-configuration-name) t] | ||
| 3807 | ["Components Package Name..." | ||
| 3808 | (customize-option 'vhdl-components-package-name) t] | ||
| 3809 | ["Use Components Package" | ||
| 3810 | (customize-set-variable 'vhdl-use-components-package | ||
| 3811 | (not vhdl-use-components-package)) | ||
| 3812 | :style toggle :selected vhdl-use-components-package] | ||
| 3813 | ["Include Header" | ||
| 3814 | (customize-set-variable 'vhdl-compose-include-header | ||
| 3815 | (not vhdl-compose-include-header)) | ||
| 3816 | :style toggle :selected vhdl-compose-include-header] | ||
| 3817 | ("Create Entity/Architecture Files" | ||
| 3703 | ["None" | 3818 | ["None" |
| 3704 | (customize-set-variable 'vhdl-compose-create-files 'none) | 3819 | (customize-set-variable 'vhdl-compose-create-files 'none) |
| 3705 | :style radio :selected (eq 'none vhdl-compose-create-files)] | 3820 | :style radio :selected (eq 'none vhdl-compose-create-files)] |
| @@ -3709,18 +3824,18 @@ STRING are replaced by `-' and substrings are converted to lower case." | |||
| 3709 | ["Separate" | 3824 | ["Separate" |
| 3710 | (customize-set-variable 'vhdl-compose-create-files 'separate) | 3825 | (customize-set-variable 'vhdl-compose-create-files 'separate) |
| 3711 | :style radio :selected (eq 'separate vhdl-compose-create-files)]) | 3826 | :style radio :selected (eq 'separate vhdl-compose-create-files)]) |
| 3712 | ["Include Header" | 3827 | ["Create Configuration File" |
| 3713 | (customize-set-variable 'vhdl-compose-include-header | 3828 | (customize-set-variable 'vhdl-compose-configuration-create-file |
| 3714 | (not vhdl-compose-include-header)) | 3829 | (not vhdl-compose-configuration-create-file)) |
| 3715 | :style toggle :selected vhdl-compose-include-header] | 3830 | :style toggle :selected vhdl-compose-configuration-create-file] |
| 3716 | ["Architecture Name..." | 3831 | ["Hierarchical Configuration" |
| 3717 | (customize-option 'vhdl-compose-architecture-name) t] | 3832 | (customize-set-variable 'vhdl-compose-configuration-hierarchical |
| 3718 | ["Components Package Name..." | 3833 | (not vhdl-compose-configuration-hierarchical)) |
| 3719 | (customize-option 'vhdl-components-package-name) t] | 3834 | :style toggle :selected vhdl-compose-configuration-hierarchical] |
| 3720 | ["Use Components Package" | 3835 | ["Use Subconfiguration" |
| 3721 | (customize-set-variable 'vhdl-use-components-package | 3836 | (customize-set-variable 'vhdl-compose-configuration-use-subconfiguration |
| 3722 | (not vhdl-use-components-package)) | 3837 | (not vhdl-compose-configuration-use-subconfiguration)) |
| 3723 | :style toggle :selected vhdl-use-components-package] | 3838 | :style toggle :selected vhdl-compose-configuration-use-subconfiguration] |
| 3724 | "--" | 3839 | "--" |
| 3725 | ["Customize Group..." (customize-group 'vhdl-compose) t]) | 3840 | ["Customize Group..." (customize-group 'vhdl-compose) t]) |
| 3726 | ("Comment" | 3841 | ("Comment" |
| @@ -4172,13 +4287,13 @@ Usage: | |||
| 4172 | symbols are surrounded by one space, and multiple spaces are eliminated. | 4287 | symbols are surrounded by one space, and multiple spaces are eliminated. |
| 4173 | 4288 | ||
| 4174 | 4289 | ||
| 4175 | | CODE FILLING: | 4290 | CODE FILLING: |
| 4176 | | Code filling allows to condens code (e.g. sensitivity lists or port | 4291 | Code filling allows to condense code (e.g. sensitivity lists or port |
| 4177 | | maps) by removing comments and newlines and re-wrapping so that all | 4292 | maps) by removing comments and newlines and re-wrapping so that all |
| 4178 | | lines are maximally filled (block filling). `C-c C-f C-f' fills a list | 4293 | lines are maximally filled (block filling). `C-c C-f C-f' fills a list |
| 4179 | | enclosed by parenthesis, `C-c C-f C-g' a group of lines separated by | 4294 | enclosed by parenthesis, `C-c C-f C-g' a group of lines separated by |
| 4180 | | blank lines, `C-c C-f C-i' a block of lines with same indent, and | 4295 | blank lines, `C-c C-f C-i' a block of lines with same indent, and |
| 4181 | | `C-c C-f M-f' an entire region. | 4296 | `C-c C-f M-f' an entire region. |
| 4182 | 4297 | ||
| 4183 | 4298 | ||
| 4184 | CODE BEAUTIFICATION: | 4299 | CODE BEAUTIFICATION: |
| @@ -4203,21 +4318,21 @@ Usage: | |||
| 4203 | 4318 | ||
| 4204 | A clause with several generic/port names on the same line can be | 4319 | A clause with several generic/port names on the same line can be |
| 4205 | flattened (`C-c C-p C-f') so that only one name per line exists. The | 4320 | flattened (`C-c C-p C-f') so that only one name per line exists. The |
| 4206 | | direction of ports can be reversed (`C-c C-p C-r'), i.e., inputs become | 4321 | direction of ports can be reversed (`C-c C-p C-r'), i.e., inputs become |
| 4207 | | outputs and vice versa, which can be useful in testbenches. (This | 4322 | outputs and vice versa, which can be useful in testbenches. (This |
| 4208 | | reversion is done on the internal data structure and is only reflected | 4323 | reversion is done on the internal data structure and is only reflected |
| 4209 | | in subsequent paste operations.) | 4324 | in subsequent paste operations.) |
| 4210 | 4325 | ||
| 4211 | Names for actual ports, instances, testbenches, and | 4326 | Names for actual ports, instances, testbenches, and |
| 4212 | design-under-test instances can be derived from existing names according | 4327 | design-under-test instances can be derived from existing names according |
| 4213 | to options `vhdl-...-name'. See customization group `vhdl-port'. | 4328 | to options `vhdl-...-name'. See customization group `vhdl-port'. |
| 4214 | 4329 | ||
| 4215 | 4330 | ||
| 4216 | | SUBPROGRAM TRANSLATION: | 4331 | SUBPROGRAM TRANSLATION: |
| 4217 | | Similar functionality exists for copying/pasting the interface of | 4332 | Similar functionality exists for copying/pasting the interface of |
| 4218 | | subprograms (function/procedure). A subprogram interface can be copied | 4333 | subprograms (function/procedure). A subprogram interface can be copied |
| 4219 | | and then pasted as a subprogram declaration, body or call (uses | 4334 | and then pasted as a subprogram declaration, body or call (uses |
| 4220 | | association list with formals). | 4335 | association list with formals). |
| 4221 | 4336 | ||
| 4222 | 4337 | ||
| 4223 | TESTBENCH GENERATION: | 4338 | TESTBENCH GENERATION: |
| @@ -4273,38 +4388,54 @@ Usage: | |||
| 4273 | required by secondary units. | 4388 | required by secondary units. |
| 4274 | 4389 | ||
| 4275 | 4390 | ||
| 4276 | | STRUCTURAL COMPOSITION: | 4391 | STRUCTURAL COMPOSITION: |
| 4277 | | Enables simple structural composition. `C-c C-c C-n' creates a skeleton | 4392 | Enables simple structural composition. `C-c C-c C-n' creates a skeleton |
| 4278 | | for a new component. Subcomponents (i.e. component declaration and | 4393 | for a new component. Subcomponents (i.e. component declaration and |
| 4279 | | instantiation) can be automatically placed from a previously read port | 4394 | instantiation) can be automatically placed from a previously read port |
| 4280 | | \(`C-c C-c C-p') or directly from the hierarchy browser (`P'). Finally, | 4395 | \(`C-c C-c C-p') or directly from the hierarchy browser (`P'). Finally, |
| 4281 | | all subcomponents can be automatically connected using internal signals | 4396 | all subcomponents can be automatically connected using internal signals |
| 4282 | | and ports (`C-c C-c C-w') following these rules: | 4397 | and ports (`C-c C-c C-w') following these rules: |
| 4283 | | - subcomponent actual ports with same name are considered to be | 4398 | - subcomponent actual ports with same name are considered to be |
| 4284 | | connected by a signal (internal signal or port) | 4399 | connected by a signal (internal signal or port) |
| 4285 | | - signals that are only inputs to subcomponents are considered as | 4400 | - signals that are only inputs to subcomponents are considered as |
| 4286 | | inputs to this component -> input port created | 4401 | inputs to this component -> input port created |
| 4287 | | - signals that are only outputs from subcomponents are considered as | 4402 | - signals that are only outputs from subcomponents are considered as |
| 4288 | | outputs from this component -> output port created | 4403 | outputs from this component -> output port created |
| 4289 | | - signals that are inputs to AND outputs from subcomponents are | 4404 | - signals that are inputs to AND outputs from subcomponents are |
| 4290 | | considered as internal connections -> internal signal created | 4405 | considered as internal connections -> internal signal created |
| 4291 | | | 4406 | |
| 4292 | | Component declarations can be placed in a components package (option | 4407 | Purpose: With appropriate naming conventions it is possible to |
| 4293 | | `vhdl-use-components-package') which can be automatically generated for | 4408 | create higher design levels with only a few mouse clicks or key |
| 4294 | | an entire directory or project (`C-c C-c M-p'). The VHDL'93 direct | 4409 | strokes. A new design level can be created by simply generating a new |
| 4295 | | component instantiation is also supported (option | 4410 | component, placing the required subcomponents from the hierarchy |
| 4296 | | `vhdl-use-direct-instantiation'). | 4411 | browser, and wiring everything automatically. |
| 4297 | | | 4412 | |
| 4298 | | Purpose: With appropriate naming conventions it is possible to | 4413 | Note: Automatic wiring only works reliably on templates of new |
| 4299 | | create higher design levels with only a few mouse clicks or key | 4414 | components and component instantiations that were created by VHDL mode. |
| 4300 | | strokes. A new design level can be created by simply generating a new | 4415 | |
| 4301 | | component, placing the required subcomponents from the hierarchy | 4416 | Component declarations can be placed in a components package (option |
| 4302 | | browser, and wiring everything automatically. | 4417 | `vhdl-use-components-package') which can be automatically generated for |
| 4303 | | | 4418 | an entire directory or project (`C-c C-c M-p'). The VHDL'93 direct |
| 4304 | | Note: Automatic wiring only works reliably on templates of new | 4419 | component instantiation is also supported (option |
| 4305 | | components and component instantiations that were created by VHDL mode. | 4420 | `vhdl-use-direct-instantiation'). |
| 4421 | |||
| 4422 | | Configuration declarations can automatically be generated either from | ||
| 4423 | | the menu (`C-c C-c C-f') (for the architecture the cursor is in) or from | ||
| 4424 | | the speedbar menu (for the architecture under the cursor). The | ||
| 4425 | | configurations can optionally be hierarchical (i.e. include all | ||
| 4426 | | component levels of a hierarchical design, option | ||
| 4427 | | `vhdl-compose-configuration-hierarchical') or include subconfigurations | ||
| 4428 | | (option `vhdl-compose-configuration-use-subconfiguration'). For | ||
| 4429 | | subcomponents in hierarchical configurations, the most-recently-analyzed | ||
| 4430 | | (mra) architecture is selected. If another architecture is desired, it | ||
| 4431 | | can be marked as most-recently-analyzed (speedbar menu) before | ||
| 4432 | | generating the configuration. | ||
| 4306 | | | 4433 | | |
| 4307 | | See the options group `vhdl-compose' for all relevant user options. | 4434 | | Note: Configurations of subcomponents (i.e. hierarchical configuration |
| 4435 | | declarations) are currently not considered when displaying | ||
| 4436 | | configurations in speedbar. | ||
| 4437 | |||
| 4438 | See the options group `vhdl-compose' for all relevant user options. | ||
| 4308 | 4439 | ||
| 4309 | 4440 | ||
| 4310 | SOURCE FILE COMPILATION: | 4441 | SOURCE FILE COMPILATION: |
| @@ -4568,12 +4699,13 @@ Key bindings: | |||
| 4568 | (set (make-local-variable 'paragraph-separate) paragraph-start) | 4699 | (set (make-local-variable 'paragraph-separate) paragraph-start) |
| 4569 | (set (make-local-variable 'paragraph-ignore-fill-prefix) t) | 4700 | (set (make-local-variable 'paragraph-ignore-fill-prefix) t) |
| 4570 | (set (make-local-variable 'require-final-newline) | 4701 | (set (make-local-variable 'require-final-newline) |
| 4571 | mode-require-final-newline) | 4702 | (if vhdl-emacs-22 mode-require-final-newline t)) |
| 4572 | (set (make-local-variable 'parse-sexp-ignore-comments) t) | 4703 | (set (make-local-variable 'parse-sexp-ignore-comments) t) |
| 4573 | (set (make-local-variable 'indent-line-function) 'vhdl-indent-line) | 4704 | (set (make-local-variable 'indent-line-function) 'vhdl-indent-line) |
| 4574 | (set (make-local-variable 'comment-start) "--") | 4705 | (set (make-local-variable 'comment-start) "--") |
| 4575 | (set (make-local-variable 'comment-end) "") | 4706 | (set (make-local-variable 'comment-end) "") |
| 4576 | (set (make-local-variable 'comment-padding) "") | 4707 | (when vhdl-emacs-21 |
| 4708 | (set (make-local-variable 'comment-padding) "")) | ||
| 4577 | (set (make-local-variable 'comment-column) vhdl-inline-comment-column) | 4709 | (set (make-local-variable 'comment-column) vhdl-inline-comment-column) |
| 4578 | (set (make-local-variable 'end-comment-column) vhdl-end-comment-column) | 4710 | (set (make-local-variable 'end-comment-column) vhdl-end-comment-column) |
| 4579 | (set (make-local-variable 'comment-start-skip) "--+\\s-*") | 4711 | (set (make-local-variable 'comment-start-skip) "--+\\s-*") |
| @@ -4626,7 +4758,9 @@ Key bindings: | |||
| 4626 | (if noninteractive "" " See menu for documentation and release notes.")) | 4758 | (if noninteractive "" " See menu for documentation and release notes.")) |
| 4627 | 4759 | ||
| 4628 | ;; run hooks | 4760 | ;; run hooks |
| 4629 | (run-mode-hooks 'vhdl-mode-hook)) | 4761 | (if vhdl-emacs-22 |
| 4762 | (run-mode-hooks 'vhdl-mode-hook) | ||
| 4763 | (run-hooks 'vhdl-mode-hook))) | ||
| 4630 | 4764 | ||
| 4631 | (defun vhdl-activate-customizations () | 4765 | (defun vhdl-activate-customizations () |
| 4632 | "Activate all customizations on local variables." | 4766 | "Activate all customizations on local variables." |
| @@ -5235,6 +5369,7 @@ the offset is simply returned." | |||
| 5235 | (cond | 5369 | (cond |
| 5236 | ((nth 3 state) 'string) | 5370 | ((nth 3 state) 'string) |
| 5237 | ((nth 4 state) 'comment) | 5371 | ((nth 4 state) 'comment) |
| 5372 | ((vhdl-beginning-of-macro) 'pound) | ||
| 5238 | (t nil))))) | 5373 | (t nil))))) |
| 5239 | 5374 | ||
| 5240 | (defun vhdl-forward-comment (&optional direction) | 5375 | (defun vhdl-forward-comment (&optional direction) |
| @@ -5317,14 +5452,19 @@ negative, skip forward otherwise." | |||
| 5317 | 5452 | ||
| 5318 | (defun vhdl-forward-syntactic-ws (&optional lim) | 5453 | (defun vhdl-forward-syntactic-ws (&optional lim) |
| 5319 | "Forward skip of syntactic whitespace." | 5454 | "Forward skip of syntactic whitespace." |
| 5320 | (save-restriction | 5455 | (let* ((here (point-max)) |
| 5321 | (let* ((lim (or lim (point-max))) | 5456 | (hugenum (point-max))) |
| 5322 | (here lim) | 5457 | (while (/= here (point)) |
| 5323 | (hugenum (point-max))) | 5458 | (setq here (point)) |
| 5324 | (narrow-to-region lim (point)) | 5459 | (vhdl-forward-comment hugenum) |
| 5325 | (while (/= here (point)) | 5460 | ;; skip preprocessor directives |
| 5326 | (setq here (point)) | 5461 | (when (and (eq (char-after) ?#) |
| 5327 | (vhdl-forward-comment hugenum))))) | 5462 | (= (vhdl-point 'boi) (point))) |
| 5463 | (while (and (eq (char-before (vhdl-point 'eol)) ?\\) | ||
| 5464 | (= (forward-line 1) 0))) | ||
| 5465 | (end-of-line))) | ||
| 5466 | (if lim (goto-char (min (point) lim))))) | ||
| 5467 | |||
| 5328 | 5468 | ||
| 5329 | ;; This is the best we can do in Win-Emacs. | 5469 | ;; This is the best we can do in Win-Emacs. |
| 5330 | (defun vhdl-win-fsws (&optional lim) | 5470 | (defun vhdl-win-fsws (&optional lim) |
| @@ -5342,18 +5482,28 @@ negative, skip forward otherwise." | |||
| 5342 | (and (string-match "Win-Emacs" emacs-version) | 5482 | (and (string-match "Win-Emacs" emacs-version) |
| 5343 | (fset 'vhdl-forward-syntactic-ws 'vhdl-win-fsws)) | 5483 | (fset 'vhdl-forward-syntactic-ws 'vhdl-win-fsws)) |
| 5344 | 5484 | ||
| 5485 | (defun vhdl-beginning-of-macro (&optional lim) | ||
| 5486 | "Go to the beginning of a cpp macro definition (nicked from `cc-engine')." | ||
| 5487 | (let ((here (point))) | ||
| 5488 | (beginning-of-line) | ||
| 5489 | (while (eq (char-before (1- (point))) ?\\) | ||
| 5490 | (forward-line -1)) | ||
| 5491 | (back-to-indentation) | ||
| 5492 | (if (and (<= (point) here) | ||
| 5493 | (eq (char-after) ?#)) | ||
| 5494 | t | ||
| 5495 | (goto-char here) | ||
| 5496 | nil))) | ||
| 5497 | |||
| 5345 | (defun vhdl-backward-syntactic-ws (&optional lim) | 5498 | (defun vhdl-backward-syntactic-ws (&optional lim) |
| 5346 | "Backward skip over syntactic whitespace." | 5499 | "Backward skip over syntactic whitespace." |
| 5347 | (save-restriction | 5500 | (let* ((here (point-min)) |
| 5348 | (let* ((lim (or lim (point-min))) | 5501 | (hugenum (- (point-max)))) |
| 5349 | (here lim) | 5502 | (while (/= here (point)) |
| 5350 | (hugenum (- (point-max)))) | 5503 | (setq here (point)) |
| 5351 | (if (< lim (point)) | 5504 | (vhdl-forward-comment hugenum) |
| 5352 | (progn | 5505 | (vhdl-beginning-of-macro)) |
| 5353 | (narrow-to-region lim (point)) | 5506 | (if lim (goto-char (max (point) lim))))) |
| 5354 | (while (/= here (point)) | ||
| 5355 | (setq here (point)) | ||
| 5356 | (vhdl-forward-comment hugenum))))))) | ||
| 5357 | 5507 | ||
| 5358 | ;; This is the best we can do in Win-Emacs. | 5508 | ;; This is the best we can do in Win-Emacs. |
| 5359 | (defun vhdl-win-bsws (&optional lim) | 5509 | (defun vhdl-win-bsws (&optional lim) |
| @@ -5603,7 +5753,8 @@ keyword." | |||
| 5603 | (save-excursion | 5753 | (save-excursion |
| 5604 | (re-search-backward ";\\|\\bwhen\\b[^_]" lim 'move) | 5754 | (re-search-backward ";\\|\\bwhen\\b[^_]" lim 'move) |
| 5605 | (or (eq (following-char) ?\;) | 5755 | (or (eq (following-char) ?\;) |
| 5606 | (eq (point) lim))))) | 5756 | (eq (point) lim) |
| 5757 | (vhdl-in-literal))))) | ||
| 5607 | 5758 | ||
| 5608 | (defun vhdl-corresponding-begin (&optional lim) | 5759 | (defun vhdl-corresponding-begin (&optional lim) |
| 5609 | "If the word at the current position corresponds to an \"end\" | 5760 | "If the word at the current position corresponds to an \"end\" |
| @@ -5672,15 +5823,15 @@ of an identifier that just happens to contain an \"end\" keyword." | |||
| 5672 | ;; return an alist of (statement . keyword) mappings | 5823 | ;; return an alist of (statement . keyword) mappings |
| 5673 | '( | 5824 | '( |
| 5674 | ;; "begin ... end [id]": | 5825 | ;; "begin ... end [id]": |
| 5675 | ("begin" . nil) | 5826 | ("begin" . nil) |
| 5676 | ;; "architecture ... is ... begin ... end [id]": | 5827 | ;; "architecture ... is ... begin ... end [id]": |
| 5677 | ("architecture" . "is") | 5828 | ("architecture" . "is") |
| 5678 | ;; "configuration ... is ... end [id]": | 5829 | ;; "configuration ... is ... end [id]": |
| 5679 | ("configuration" . "is") | 5830 | ("configuration" . "is") |
| 5680 | ;; "entity ... is ... end [id]": | 5831 | ;; "entity ... is ... end [id]": |
| 5681 | ("entity" . "is") | 5832 | ("entity" . "is") |
| 5682 | ;; "package ... is ... end [id]": | 5833 | ;; "package ... is ... end [id]": |
| 5683 | ("package" . "is") | 5834 | ("package" . "is") |
| 5684 | ;; "procedure ... is ... begin ... end [id]": | 5835 | ;; "procedure ... is ... begin ... end [id]": |
| 5685 | ("procedure" . "is") | 5836 | ("procedure" . "is") |
| 5686 | ;; "function ... is ... begin ... end [id]": | 5837 | ;; "function ... is ... begin ... end [id]": |
| @@ -5721,7 +5872,7 @@ of an identifier that just happens to contain an \"end\" keyword." | |||
| 5721 | ))) | 5872 | ))) |
| 5722 | 5873 | ||
| 5723 | (defconst vhdl-trailer-re | 5874 | (defconst vhdl-trailer-re |
| 5724 | "\\b\\(is\\|then\\|generate\\|loop\\)\\b[^_]") | 5875 | "\\b\\(is\\|then\\|generate\\|loop\\|record\\)\\b[^_]") |
| 5725 | 5876 | ||
| 5726 | (defconst vhdl-statement-fwd-re | 5877 | (defconst vhdl-statement-fwd-re |
| 5727 | "\\b\\(if\\|for\\|while\\)\\b\\([^_]\\|\\'\\)" | 5878 | "\\b\\(if\\|for\\|while\\)\\b\\([^_]\\|\\'\\)" |
| @@ -6076,8 +6227,8 @@ Returns the location of the corresponding begin keyword, unless search | |||
| 6076 | stops due to beginning or end of buffer." | 6227 | stops due to beginning or end of buffer." |
| 6077 | ;; Note that if point is between the "defun" keyword and the | 6228 | ;; Note that if point is between the "defun" keyword and the |
| 6078 | ;; corresponding "begin" keyword, then that defun will not be | 6229 | ;; corresponding "begin" keyword, then that defun will not be |
| 6079 | ;; recognised, and the search will continue backwards. If point is | 6230 | ;; recognized, and the search will continue backwards. If point is |
| 6080 | ;; at the "begin" keyword, then the defun will be recognised. The | 6231 | ;; at the "begin" keyword, then the defun will be recognized. The |
| 6081 | ;; returned point is at the first character of the "defun" keyword. | 6232 | ;; returned point is at the first character of the "defun" keyword. |
| 6082 | (interactive "p") | 6233 | (interactive "p") |
| 6083 | (let ((count (or count 1)) | 6234 | (let ((count (or count 1)) |
| @@ -6138,8 +6289,8 @@ one. If within a string or comment, or next to a comment (only | |||
| 6138 | whitespace between), move by sentences instead of statements. | 6289 | whitespace between), move by sentences instead of statements. |
| 6139 | 6290 | ||
| 6140 | When called from a program, this function takes 3 optional args: the | 6291 | When called from a program, this function takes 3 optional args: the |
| 6141 | prefix arg, and a buffer position limit which is the farthest back to | 6292 | prefix arg, a buffer position limit which is the farthest back to |
| 6142 | search, and something whose meaning I don't understand." | 6293 | search, and an argument indicating an interactive call." |
| 6143 | (interactive "p\np") | 6294 | (interactive "p\np") |
| 6144 | (let ((count (or count 1)) | 6295 | (let ((count (or count 1)) |
| 6145 | (case-fold-search t) | 6296 | (case-fold-search t) |
| @@ -6698,6 +6849,8 @@ is not moved." | |||
| 6698 | (skip-chars-forward " \t") | 6849 | (skip-chars-forward " \t") |
| 6699 | (if (looking-at "--") | 6850 | (if (looking-at "--") |
| 6700 | (vhdl-add-syntax 'comment)) | 6851 | (vhdl-add-syntax 'comment)) |
| 6852 | (if (eq literal 'pound) | ||
| 6853 | (vhdl-add-syntax 'cpp-macro)) | ||
| 6701 | ;; return the syntax | 6854 | ;; return the syntax |
| 6702 | vhdl-syntactic-context)))) | 6855 | vhdl-syntactic-context)))) |
| 6703 | 6856 | ||
| @@ -6773,7 +6926,7 @@ only-lines." | |||
| 6773 | vhdl-comment-only-line-offset) | 6926 | vhdl-comment-only-line-offset) |
| 6774 | (or (cdr-safe vhdl-comment-only-line-offset) | 6927 | (or (cdr-safe vhdl-comment-only-line-offset) |
| 6775 | (car-safe vhdl-comment-only-line-offset) | 6928 | (car-safe vhdl-comment-only-line-offset) |
| 6776 | -1000 ;jam it against the left side | 6929 | -1000 ;jam it against the left side |
| 6777 | ))))) | 6930 | ))))) |
| 6778 | 6931 | ||
| 6779 | (defun vhdl-lineup-statement-cont (langelem) | 6932 | (defun vhdl-lineup-statement-cont (langelem) |
| @@ -7467,35 +7620,29 @@ end of line, do nothing in comments and strings." | |||
| 7467 | (setq end (point-marker)) | 7620 | (setq end (point-marker)) |
| 7468 | ;; have no space before and one space after `,' and ';' | 7621 | ;; have no space before and one space after `,' and ';' |
| 7469 | (goto-char beg) | 7622 | (goto-char beg) |
| 7470 | (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\)\\|\\(\\s-*\\([,;]\\)\\)" end t) | 7623 | (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\)\\|\\(\\s-*\\([,;]\\)\\)" end t) |
| 7471 | (if (match-string 1) | 7624 | (if (match-string 1) |
| 7472 | (goto-char (match-end 1)) | 7625 | (goto-char (match-end 1)) |
| 7473 | (replace-match "\\3 " nil nil nil 3))) | 7626 | (replace-match "\\3 " nil nil nil 3))) |
| 7474 | ;; have no space after `(' | 7627 | ;; have no space after `(' |
| 7475 | (goto-char beg) | 7628 | (goto-char beg) |
| 7476 | (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\)\\|\\((\\)\\s-+" end t) | 7629 | (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\)\\|\\((\\)\\s-+" end t) |
| 7477 | (if (match-string 1) | 7630 | (if (match-string 1) |
| 7478 | (goto-char (match-end 1)) | 7631 | (goto-char (match-end 1)) |
| 7479 | (replace-match "\\2"))) | 7632 | (replace-match "\\2"))) |
| 7480 | ;; have no space before `)' | 7633 | ;; have no space before `)' |
| 7481 | (goto-char beg) | 7634 | (goto-char beg) |
| 7482 | (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|^\\s-+\\)\\|\\s-+\\()\\)" end t) | 7635 | (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\|^\\s-+\\)\\|\\s-+\\()\\)" end t) |
| 7483 | (if (match-string 1) | 7636 | (if (match-string 1) |
| 7484 | (goto-char (match-end 1)) | 7637 | (goto-char (match-end 1)) |
| 7485 | (replace-match "\\2"))) | 7638 | (replace-match "\\2"))) |
| 7486 | ;; surround operator symbols by one space | 7639 | ;; surround operator symbols by one space |
| 7487 | (goto-char beg) | 7640 | (goto-char beg) |
| 7488 | (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\)\\|\\(\\([^/:<>=]\\)\\(:\\|=\\|<\\|>\\|:=\\|<=\\|>=\\|=>\\|/=\\)\\([^=>]\\|$\\)\\)" end t) | 7641 | (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\)\\|\\(\\([^/:<>=]\\)\\(:\\|=\\|<\\|>\\|:=\\|<=\\|>=\\|=>\\|/=\\)\\([^=>]\\|$\\)\\)" end t) |
| 7489 | (if (match-string 1) | 7642 | (if (match-string 1) |
| 7490 | (goto-char (match-end 1)) | 7643 | (goto-char (match-end 1)) |
| 7491 | (save-excursion | 7644 | (replace-match "\\3 \\4 \\5") |
| 7492 | (goto-char (match-beginning 4)) | 7645 | (goto-char (match-end 2)))) |
| 7493 | (unless (eq (preceding-char) ?\ ) | ||
| 7494 | (insert " ")) | ||
| 7495 | (goto-char (match-end 4)) | ||
| 7496 | (unless (eq (following-char) ?\ ) | ||
| 7497 | (insert " "))) | ||
| 7498 | (goto-char (match-end 4)))) | ||
| 7499 | ;; eliminate multiple spaces and spaces at end of line | 7646 | ;; eliminate multiple spaces and spaces at end of line |
| 7500 | (goto-char beg) | 7647 | (goto-char beg) |
| 7501 | (while (or (and (looking-at "--.*\n") (re-search-forward "--.*\n" end t)) | 7648 | (while (or (and (looking-at "--.*\n") (re-search-forward "--.*\n" end t)) |
| @@ -7509,7 +7656,8 @@ end of line, do nothing in comments and strings." | |||
| 7509 | (progn (replace-match " " nil nil) t)) | 7656 | (progn (replace-match " " nil nil) t)) |
| 7510 | (and (looking-at "\\s-+") (re-search-forward "\\s-+" end t) | 7657 | (and (looking-at "\\s-+") (re-search-forward "\\s-+" end t) |
| 7511 | (progn (replace-match " " nil nil) t)) | 7658 | (progn (replace-match " " nil nil) t)) |
| 7512 | (re-search-forward "[^ \t-]+" end t)))) | 7659 | ; (re-search-forward "[^ \t-]+" end t)))) |
| 7660 | (re-search-forward "[^ \t\"-]+" end t)))) | ||
| 7513 | (unless no-message (message "Fixing up whitespace...done"))) | 7661 | (unless no-message (message "Fixing up whitespace...done"))) |
| 7514 | 7662 | ||
| 7515 | (defun vhdl-fixup-whitespace-buffer () | 7663 | (defun vhdl-fixup-whitespace-buffer () |
| @@ -7627,7 +7775,7 @@ buffer." | |||
| 7627 | (message "Updating sensitivity lists...") | 7775 | (message "Updating sensitivity lists...") |
| 7628 | (while (re-search-forward "^\\s-*\\(\\w+[ \t\n]*:[ \t\n]*\\)?process\\>" nil t) | 7776 | (while (re-search-forward "^\\s-*\\(\\w+[ \t\n]*:[ \t\n]*\\)?process\\>" nil t) |
| 7629 | (goto-char (match-beginning 0)) | 7777 | (goto-char (match-beginning 0)) |
| 7630 | (condition-case nil (vhdl-update-sensitivity-list) (error))) | 7778 | (condition-case nil (vhdl-update-sensitivity-list) (error ""))) |
| 7631 | (message "Updating sensitivity lists...done")))) | 7779 | (message "Updating sensitivity lists...done")))) |
| 7632 | 7780 | ||
| 7633 | (defun vhdl-update-sensitivity-list () | 7781 | (defun vhdl-update-sensitivity-list () |
| @@ -7671,8 +7819,10 @@ buffer." | |||
| 7671 | ((re-search-forward "^\\s-*case\\>" proc-end t) | 7819 | ((re-search-forward "^\\s-*case\\>" proc-end t) |
| 7672 | (re-search-forward "\\<is\\>" proc-end t)) | 7820 | (re-search-forward "\\<is\\>" proc-end t)) |
| 7673 | ;; parameter list of procedure call | 7821 | ;; parameter list of procedure call |
| 7674 | ((re-search-forward "^\\s-*\\w+[ \t\n]*(" proc-end t) | 7822 | ((and (re-search-forward "^\\s-*\\w+[ \t\n]*(" proc-end t) |
| 7675 | (progn (backward-char) (forward-sexp) (point))))) | 7823 | (1- (point))) |
| 7824 | (progn (backward-char) (forward-sexp) | ||
| 7825 | (while (looking-at "(") (forward-sexp)) (point))))) | ||
| 7676 | name read-list sens-list signal-list | 7826 | name read-list sens-list signal-list |
| 7677 | sens-beg sens-end beg end margin) | 7827 | sens-beg sens-end beg end margin) |
| 7678 | ;; scan for signals in old sensitivity list | 7828 | ;; scan for signals in old sensitivity list |
| @@ -7713,10 +7863,16 @@ buffer." | |||
| 7713 | (< (point) (caar tmp-list))) | 7863 | (< (point) (caar tmp-list))) |
| 7714 | (setq tmp-list (cdr tmp-list))) | 7864 | (setq tmp-list (cdr tmp-list))) |
| 7715 | (and tmp-list (< (point) (cdar tmp-list)))))) | 7865 | (and tmp-list (< (point) (cdar tmp-list)))))) |
| 7716 | (while (vhdl-re-search-forward "[^'\"]\\<\\([a-zA-Z]\\w*\\)\\>" end t) | 7866 | (while (vhdl-re-search-forward "[^'\"]\\<\\([a-zA-Z]\\w*\\)\\>[ \t\n]*\\('\\(\\w+\\)\\|\\(=>\\)\\)?" end t) |
| 7717 | (setq name (match-string 1)) | 7867 | (setq name (match-string 1)) |
| 7718 | (when (member (downcase name) signal-list) | 7868 | (when (and (not (match-string 4)) ; not when formal parameter |
| 7719 | (add-to-list 'read-list name))))) | 7869 | (not (and (match-string 3) ; not event attribute |
| 7870 | (not (member (downcase (match-string 3)) | ||
| 7871 | '("event" "last_event" "transaction"))))) | ||
| 7872 | (member (downcase name) signal-list)) | ||
| 7873 | (unless (member-ignore-case name read-list) | ||
| 7874 | (setq read-list (cons name read-list)))) | ||
| 7875 | (goto-char (match-end 1))))) | ||
| 7720 | (setq scan-regions-list (cdr scan-regions-list))) | 7876 | (setq scan-regions-list (cdr scan-regions-list))) |
| 7721 | ;; update sensitivity list | 7877 | ;; update sensitivity list |
| 7722 | (goto-char sens-beg) | 7878 | (goto-char sens-beg) |
| @@ -7740,65 +7896,94 @@ buffer." | |||
| 7740 | 7896 | ||
| 7741 | (defun vhdl-get-visible-signals () | 7897 | (defun vhdl-get-visible-signals () |
| 7742 | "Get all signals visible in the current block." | 7898 | "Get all signals visible in the current block." |
| 7743 | (save-excursion | 7899 | (let (beg end signal-list entity-name file-name) |
| 7744 | (let (beg end signal-list entity-name file-name) | 7900 | (vhdl-prepare-search-2 |
| 7745 | ;; search for signals declared in surrounding block declarative parts | 7901 | ;; get entity name |
| 7746 | (save-excursion | 7902 | (save-excursion |
| 7747 | (while (and (progn (while (and (setq beg (re-search-backward "^\\s-*\\(\\w+\\s-*:\\s-*block\\|\\(end\\)\\s-+block\\)\\>" nil t)) | 7903 | (unless (and (re-search-backward "^\\(architecture\\s-+\\w+\\s-+of\\s-+\\(\\w+\\)\\|end\\)\\>" nil t) |
| 7748 | (match-string 2)) | ||
| 7749 | (goto-char (match-end 2)) | ||
| 7750 | (vhdl-backward-sexp) | ||
| 7751 | (re-search-backward "^\\s-*\\w+\\s-*:\\s-*block\\>" nil t)) | ||
| 7752 | beg) | ||
| 7753 | (setq end (re-search-forward "^\\s-*begin\\>" nil t))) | ||
| 7754 | ;; scan for all declared signal names | ||
| 7755 | (goto-char beg) | ||
| 7756 | (while (re-search-forward "^\\s-*signal\\>" end t) | ||
| 7757 | (while (and (not (looking-at "[ \t\n]*:")) | ||
| 7758 | (re-search-forward "[ \t\n,]+\\(\\w+\\)" end t)) | ||
| 7759 | (setq signal-list | ||
| 7760 | (cons (downcase (match-string 1)) signal-list)))) | ||
| 7761 | (goto-char beg))) | ||
| 7762 | ;; search for signals declared in architecture declarative part | ||
| 7763 | (if (not (and (setq beg (re-search-backward "^\\(architecture\\s-+\\w+\\s-+of\\s-+\\(\\w+\\)\\|end\\)\\>" nil t)) | ||
| 7764 | (not (equal "END" (upcase (match-string 1)))) | 7904 | (not (equal "END" (upcase (match-string 1)))) |
| 7765 | (setq entity-name (match-string 2)) | 7905 | (setq entity-name (match-string 2))) |
| 7766 | (setq end (re-search-forward "^begin\\>" nil t)))) | 7906 | (error "ERROR: Not within an architecture"))) |
| 7767 | (error "ERROR: No architecture declarative part found") | 7907 | ;; search for signals declared in entity port clause |
| 7768 | ;; scan for all declared signal names | 7908 | (save-excursion |
| 7769 | (goto-char beg) | 7909 | (goto-char (point-min)) |
| 7770 | (while (re-search-forward "^\\s-*signal\\>" end t) | 7910 | (unless (re-search-forward (concat "^entity\\s-+" entity-name "\\>") nil t) |
| 7771 | (while (and (not (looking-at "[ \t\n]*:")) | 7911 | (setq file-name |
| 7772 | (re-search-forward "[ \t\n,]+\\(\\w+\\)" end t)) | 7912 | (concat (vhdl-replace-string vhdl-entity-file-name entity-name t) |
| 7773 | (setq signal-list | 7913 | "." (file-name-extension (buffer-file-name))))) |
| 7774 | (cons (downcase (match-string 1)) signal-list))))) | 7914 | (vhdl-visit-file |
| 7775 | ;; search for signals declared in entity port clause | 7915 | file-name t |
| 7776 | (goto-char (point-min)) | 7916 | (vhdl-prepare-search-2 |
| 7777 | (unless (re-search-forward (concat "^entity\\s-+" entity-name "\\>") nil t) | 7917 | (goto-char (point-min)) |
| 7778 | (setq file-name | 7918 | (if (not (re-search-forward (concat "^entity\\s-+" entity-name "\\>") nil t)) |
| 7779 | (concat (vhdl-replace-string vhdl-entity-file-name entity-name) | 7919 | (error "ERROR: Entity \"%s\" not found:\n --> see option `vhdl-entity-file-name'" entity-name) |
| 7780 | "." (file-name-extension (buffer-file-name))))) | 7920 | (when (setq beg (re-search-forward |
| 7781 | (vhdl-visit-file | 7921 | "^\\s-*port[ \t\n]*(" |
| 7782 | file-name t | 7922 | (save-excursion |
| 7783 | (vhdl-prepare-search-2 | 7923 | (re-search-forward "^end\\>" nil t)) t)) |
| 7784 | (goto-char (point-min)) | 7924 | (setq end (save-excursion |
| 7785 | (if (not (re-search-forward (concat "^entity\\s-+" entity-name "\\>") nil t)) | 7925 | (backward-char) (forward-sexp) (point))) |
| 7786 | (error "ERROR: Entity \"%s\" not found:\n --> see option `vhdl-entity-file-name'" entity-name) | 7926 | (vhdl-forward-syntactic-ws) |
| 7787 | (when (setq beg (re-search-forward | 7927 | (while (< (point) end) |
| 7788 | "^\\s-*port[ \t\n]*(" | 7928 | (when (looking-at "signal[ \t\n]+") |
| 7789 | (save-excursion | 7929 | (goto-char (match-end 0))) |
| 7790 | (re-search-forward "^end\\>" nil t)) t)) | 7930 | (while (looking-at "\\(\\w+\\)[ \t\n,]+") |
| 7791 | (setq end (save-excursion | 7931 | (setq signal-list |
| 7792 | (backward-char) (forward-sexp) (point))) | 7932 | (cons (downcase (match-string 1)) signal-list)) |
| 7793 | (vhdl-forward-syntactic-ws) | 7933 | (goto-char (match-end 0)) |
| 7794 | (while (< (point) end) | 7934 | (vhdl-forward-syntactic-ws)) |
| 7795 | (while (and (not (looking-at "[ \t\n]*:")) | 7935 | (re-search-forward ";" end 1) |
| 7796 | (re-search-forward "[ \t\n,]*\\(\\w+\\)" end t)) | 7936 | (vhdl-forward-syntactic-ws))))))) |
| 7797 | (setq signal-list | 7937 | ;; search for signals declared in architecture declarative part |
| 7798 | (cons (downcase (match-string 1)) signal-list))) | 7938 | (save-excursion |
| 7799 | (re-search-forward ";" end 1) | 7939 | (if (not (and (setq beg (re-search-backward "^\\(architecture\\s-+\\w+\\s-+of\\s-+\\(\\w+\\)\\|end\\)\\>" nil t)) |
| 7800 | (vhdl-forward-syntactic-ws)))))) | 7940 | (not (equal "END" (upcase (match-string 1)))) |
| 7801 | signal-list))) | 7941 | (setq end (re-search-forward "^begin\\>" nil t)))) |
| 7942 | (error "ERROR: No architecture declarative part found") | ||
| 7943 | ;; scan for all declared signal and alias names | ||
| 7944 | (goto-char beg) | ||
| 7945 | (while (re-search-forward "^\\s-*\\(\\(signal\\)\\|alias\\)\\>" end t) | ||
| 7946 | (when (= 0 (nth 0 (parse-partial-sexp beg (point)))) | ||
| 7947 | (if (match-string 2) | ||
| 7948 | ;; scan signal name | ||
| 7949 | (while (looking-at "[ \t\n,]+\\(\\w+\\)") | ||
| 7950 | (setq signal-list | ||
| 7951 | (cons (downcase (match-string 1)) signal-list)) | ||
| 7952 | (goto-char (match-end 0))) | ||
| 7953 | ;; scan alias name, check is alias of (declared) signal | ||
| 7954 | (when (and (looking-at "[ \t\n]+\\(\\w+\\)[^;]*\\<is[ \t\n]+\\(\\w+\\)") | ||
| 7955 | (member (downcase (match-string 2)) signal-list)) | ||
| 7956 | (setq signal-list | ||
| 7957 | (cons (downcase (match-string 1)) signal-list)) | ||
| 7958 | (goto-char (match-end 0)))) | ||
| 7959 | (setq beg (point)))))) | ||
| 7960 | ;; search for signals declared in surrounding block declarative parts | ||
| 7961 | (save-excursion | ||
| 7962 | (while (and (progn (while (and (setq beg (re-search-backward "^\\s-*\\(\\w+\\s-*:\\s-*block\\|\\(end\\)\\s-+block\\)\\>" nil t)) | ||
| 7963 | (match-string 2)) | ||
| 7964 | (goto-char (match-end 2)) | ||
| 7965 | (vhdl-backward-sexp) | ||
| 7966 | (re-search-backward "^\\s-*\\w+\\s-*:\\s-*block\\>" nil t)) | ||
| 7967 | beg) | ||
| 7968 | (setq end (re-search-forward "^\\s-*begin\\>" nil t))) | ||
| 7969 | ;; scan for all declared signal names | ||
| 7970 | (goto-char beg) | ||
| 7971 | (while (re-search-forward "^\\s-*\\(\\(signal\\)\\|alias\\)\\>" end t) | ||
| 7972 | (when (= 0 (nth 0 (parse-partial-sexp beg (point)))) | ||
| 7973 | (if (match-string 2) | ||
| 7974 | ;; scan signal name | ||
| 7975 | (while (looking-at "[ \t\n,]+\\(\\w+\\)") | ||
| 7976 | (setq signal-list | ||
| 7977 | (cons (downcase (match-string 1)) signal-list)) | ||
| 7978 | (goto-char (match-end 0))) | ||
| 7979 | ;; scan alias name, check is alias of (declared) signal | ||
| 7980 | (when (and (looking-at "[ \t\n]+\\(\\w+\\)[^;]*\\<is[ \t\n]+\\(\\w+\\)") | ||
| 7981 | (member (downcase (match-string 2)) signal-list)) | ||
| 7982 | (setq signal-list | ||
| 7983 | (cons (downcase (match-string 1)) signal-list)) | ||
| 7984 | (goto-char (match-end 0)))))) | ||
| 7985 | (goto-char beg))) | ||
| 7986 | signal-list))) | ||
| 7802 | 7987 | ||
| 7803 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 7988 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 7804 | ;; Generic/port clause fixing | 7989 | ;; Generic/port clause fixing |
| @@ -9620,11 +9805,14 @@ specification, if not already there." | |||
| 9620 | (match-string 2)))) | 9805 | (match-string 2)))) |
| 9621 | (equal (downcase library) "work")) | 9806 | (equal (downcase library) "work")) |
| 9622 | (vhdl-insert-keyword "LIBRARY ") | 9807 | (vhdl-insert-keyword "LIBRARY ") |
| 9623 | (insert library ";\n") | 9808 | (insert library ";") |
| 9624 | (indent-to margin)) | 9809 | (when package |
| 9625 | (vhdl-insert-keyword "USE ") | 9810 | (insert "\n") |
| 9626 | (insert library "." package) | 9811 | (indent-to margin))) |
| 9627 | (vhdl-insert-keyword ".ALL;")))) | 9812 | (when package |
| 9813 | (vhdl-insert-keyword "USE ") | ||
| 9814 | (insert library "." package) | ||
| 9815 | (vhdl-insert-keyword ".ALL;"))))) | ||
| 9628 | 9816 | ||
| 9629 | (defun vhdl-template-package-math-complex () | 9817 | (defun vhdl-template-package-math-complex () |
| 9630 | "Insert specification of `math_complex' package." | 9818 | "Insert specification of `math_complex' package." |
| @@ -10323,7 +10511,10 @@ else insert tab (used for word completion in VHDL minibuffer)." | |||
| 10323 | (save-match-data | 10511 | (save-match-data |
| 10324 | (save-excursion | 10512 | (save-excursion |
| 10325 | (goto-char (match-end 5)) | 10513 | (goto-char (match-end 5)) |
| 10326 | (forward-word 1) (forward-sexp) | 10514 | (forward-word 1) |
| 10515 | (vhdl-forward-syntactic-ws) | ||
| 10516 | (when (looking-at "(") | ||
| 10517 | (forward-sexp)) | ||
| 10327 | (re-search-forward "\\<is\\>\\|\\(;\\)" nil t)) | 10518 | (re-search-forward "\\<is\\>\\|\\(;\\)" nil t)) |
| 10328 | (match-string 1))) | 10519 | (match-string 1))) |
| 10329 | ;; not consider configuration specifications | 10520 | ;; not consider configuration specifications |
| @@ -10683,12 +10874,14 @@ but not if inside a comment or quote)." | |||
| 10683 | (vhdl-current-line) string))) | 10874 | (vhdl-current-line) string))) |
| 10684 | nil)) | 10875 | nil)) |
| 10685 | 10876 | ||
| 10686 | (defun vhdl-replace-string (regexp-cons string) | 10877 | (defun vhdl-replace-string (regexp-cons string &optional adjust-case) |
| 10687 | "Replace STRING from car of REGEXP-CONS to cdr of REGEXP-CONS." | 10878 | "Replace STRING from car of REGEXP-CONS to cdr of REGEXP-CONS." |
| 10688 | (vhdl-prepare-search-1 | 10879 | (vhdl-prepare-search-1 |
| 10689 | (if (string-match (car regexp-cons) string) | 10880 | (if (string-match (car regexp-cons) string) |
| 10690 | (funcall vhdl-file-name-case | 10881 | (if adjust-case |
| 10691 | (replace-match (cdr regexp-cons) t nil string)) | 10882 | (funcall vhdl-file-name-case |
| 10883 | (replace-match (cdr regexp-cons) t nil string)) | ||
| 10884 | (replace-match (cdr regexp-cons) t nil string)) | ||
| 10692 | string))) | 10885 | string))) |
| 10693 | 10886 | ||
| 10694 | (defun vhdl-parse-group-comment () | 10887 | (defun vhdl-parse-group-comment () |
| @@ -10697,6 +10890,7 @@ but not if inside a comment or quote)." | |||
| 10697 | string) | 10890 | string) |
| 10698 | (vhdl-forward-comment (point-max)) | 10891 | (vhdl-forward-comment (point-max)) |
| 10699 | (setq string (buffer-substring-no-properties start (point))) | 10892 | (setq string (buffer-substring-no-properties start (point))) |
| 10893 | (vhdl-forward-syntactic-ws) | ||
| 10700 | ;; strip off leading blanks and first newline | 10894 | ;; strip off leading blanks and first newline |
| 10701 | (while (string-match "^\\(\\s-+\\)" string) | 10895 | (while (string-match "^\\(\\s-+\\)" string) |
| 10702 | (setq string (concat (substring string 0 (match-beginning 1)) | 10896 | (setq string (concat (substring string 0 (match-beginning 1)) |
| @@ -10722,11 +10916,13 @@ with INDENT." | |||
| 10722 | "Indicates whether a port has been flattened.") | 10916 | "Indicates whether a port has been flattened.") |
| 10723 | 10917 | ||
| 10724 | (defun vhdl-port-flatten (&optional as-alist) | 10918 | (defun vhdl-port-flatten (&optional as-alist) |
| 10725 | "Flatten port list so that only one generic/port exists per line." | 10919 | "Flatten port list so that only one generic/port exists per line. |
| 10920 | This operation is performed on an internally stored port and is only | ||
| 10921 | reflected in a subsequent paste operation." | ||
| 10726 | (interactive) | 10922 | (interactive) |
| 10727 | (if (not vhdl-port-list) | 10923 | (if (not vhdl-port-list) |
| 10728 | (error "ERROR: No port has been read") | 10924 | (error "ERROR: No port has been read") |
| 10729 | (message "Flattening port...") | 10925 | (message "Flattening port for next paste...") |
| 10730 | (let ((new-vhdl-port-list (list (car vhdl-port-list))) | 10926 | (let ((new-vhdl-port-list (list (car vhdl-port-list))) |
| 10731 | (old-vhdl-port-list (cdr vhdl-port-list)) | 10927 | (old-vhdl-port-list (cdr vhdl-port-list)) |
| 10732 | old-port-list new-port-list old-port new-port names) | 10928 | old-port-list new-port-list old-port new-port names) |
| @@ -10749,17 +10945,19 @@ with INDENT." | |||
| 10749 | (setq vhdl-port-list | 10945 | (setq vhdl-port-list |
| 10750 | (append new-vhdl-port-list (list old-vhdl-port-list)) | 10946 | (append new-vhdl-port-list (list old-vhdl-port-list)) |
| 10751 | vhdl-port-flattened t) | 10947 | vhdl-port-flattened t) |
| 10752 | (message "Flattening port...done")))) | 10948 | (message "Flattening port for next paste...done")))) |
| 10753 | 10949 | ||
| 10754 | (defvar vhdl-port-reversed-direction nil | 10950 | (defvar vhdl-port-reversed-direction nil |
| 10755 | "Indicates whether port directions are reversed.") | 10951 | "Indicates whether port directions are reversed.") |
| 10756 | 10952 | ||
| 10757 | (defun vhdl-port-reverse-direction () | 10953 | (defun vhdl-port-reverse-direction () |
| 10758 | "Reverse direction for all ports (useful in testbenches)." | 10954 | "Reverse direction for all ports (useful in testbenches). |
| 10955 | This operation is performed on an internally stored port and is only | ||
| 10956 | reflected in a subsequent paste operation." | ||
| 10759 | (interactive) | 10957 | (interactive) |
| 10760 | (if (not vhdl-port-list) | 10958 | (if (not vhdl-port-list) |
| 10761 | (error "ERROR: No port has been read") | 10959 | (error "ERROR: No port has been read") |
| 10762 | (message "Reversing port directions...") | 10960 | (message "Reversing port directions for next paste...") |
| 10763 | (let ((port-list (nth 2 vhdl-port-list)) | 10961 | (let ((port-list (nth 2 vhdl-port-list)) |
| 10764 | port-dir-car port-dir) | 10962 | port-dir-car port-dir) |
| 10765 | ;; traverse port list and reverse directions | 10963 | ;; traverse port list and reverse directions |
| @@ -10772,7 +10970,7 @@ with INDENT." | |||
| 10772 | (t port-dir))) | 10970 | (t port-dir))) |
| 10773 | (setq port-list (cdr port-list))) | 10971 | (setq port-list (cdr port-list))) |
| 10774 | (setq vhdl-port-reversed-direction (not vhdl-port-reversed-direction)) | 10972 | (setq vhdl-port-reversed-direction (not vhdl-port-reversed-direction)) |
| 10775 | (message "Reversing port directions...done")))) | 10973 | (message "Reversing port directions for next paste...done")))) |
| 10776 | 10974 | ||
| 10777 | (defun vhdl-port-copy () | 10975 | (defun vhdl-port-copy () |
| 10778 | "Get generic and port information from an entity or component declaration." | 10976 | "Get generic and port information from an entity or component declaration." |
| @@ -10803,8 +11001,8 @@ with INDENT." | |||
| 10803 | (setq group-comment (vhdl-parse-group-comment)) | 11001 | (setq group-comment (vhdl-parse-group-comment)) |
| 10804 | (setq end-of-list (vhdl-parse-string ")[ \t\n]*;[ \t\n]*" t)) | 11002 | (setq end-of-list (vhdl-parse-string ")[ \t\n]*;[ \t\n]*" t)) |
| 10805 | (while (not end-of-list) | 11003 | (while (not end-of-list) |
| 10806 | ;; parse names | 11004 | ;; parse names (accept extended identifiers) |
| 10807 | (vhdl-parse-string "\\(\\w+\\)[ \t\n]*") | 11005 | (vhdl-parse-string "\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*") |
| 10808 | (setq names (list (match-string-no-properties 1))) | 11006 | (setq names (list (match-string-no-properties 1))) |
| 10809 | (while (vhdl-parse-string ",[ \t\n]*\\(\\w+\\)[ \t\n]*" t) | 11007 | (while (vhdl-parse-string ",[ \t\n]*\\(\\w+\\)[ \t\n]*" t) |
| 10810 | (setq names | 11008 | (setq names |
| @@ -10870,7 +11068,7 @@ with INDENT." | |||
| 10870 | (while (not end-of-list) | 11068 | (while (not end-of-list) |
| 10871 | ;; parse object | 11069 | ;; parse object |
| 10872 | (setq object | 11070 | (setq object |
| 10873 | (and (vhdl-parse-string "\\(signal\\|quantity\\|terminal\\)[ \t\n]*" t) | 11071 | (and (vhdl-parse-string "\\<\\(signal\\|quantity\\|terminal\\)\\>[ \t\n]*" t) |
| 10874 | (match-string-no-properties 1))) | 11072 | (match-string-no-properties 1))) |
| 10875 | ;; parse names (accept extended identifiers) | 11073 | ;; parse names (accept extended identifiers) |
| 10876 | (vhdl-parse-string "\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*") | 11074 | (vhdl-parse-string "\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*") |
| @@ -10880,7 +11078,7 @@ with INDENT." | |||
| 10880 | ;; parse direction | 11078 | ;; parse direction |
| 10881 | (vhdl-parse-string ":[ \t\n]*") | 11079 | (vhdl-parse-string ":[ \t\n]*") |
| 10882 | (setq direct | 11080 | (setq direct |
| 10883 | (and (vhdl-parse-string "\\(in\\|out\\|inout\\|buffer\\|linkage\\)[ \t\n]+" t) | 11081 | (and (vhdl-parse-string "\\<\\(in\\|out\\|inout\\|buffer\\|linkage\\)\\>[ \t\n]+" t) |
| 10884 | (match-string-no-properties 1))) | 11082 | (match-string-no-properties 1))) |
| 10885 | ;; parse type | 11083 | ;; parse type |
| 10886 | (vhdl-parse-string "\\([^();\n]+\\)") | 11084 | (vhdl-parse-string "\\([^();\n]+\\)") |
| @@ -11097,7 +11295,10 @@ with INDENT." | |||
| 11097 | (car (nth 0 (car generic-list))) | 11295 | (car (nth 0 (car generic-list))) |
| 11098 | (or (nth 2 (car generic-list)) " "))) | 11296 | (or (nth 2 (car generic-list)) " "))) |
| 11099 | (setq generic-list (cdr generic-list)) | 11297 | (setq generic-list (cdr generic-list)) |
| 11100 | (insert (if generic-list ", " ")"))) | 11298 | (insert (if generic-list ", " ")")) |
| 11299 | (when (and (not generic-list) secondary | ||
| 11300 | (null (nth 2 vhdl-port-list))) | ||
| 11301 | (insert ";"))) | ||
| 11101 | (unless vhdl-argument-list-indent | 11302 | (unless vhdl-argument-list-indent |
| 11102 | (insert "\n") (indent-to (+ margin vhdl-basic-offset))) | 11303 | (insert "\n") (indent-to (+ margin vhdl-basic-offset))) |
| 11103 | (setq list-margin (current-column)) | 11304 | (setq list-margin (current-column)) |
| @@ -11113,6 +11314,9 @@ with INDENT." | |||
| 11113 | (or (nth 2 generic) ""))) | 11314 | (or (nth 2 generic) ""))) |
| 11114 | (setq generic-list (cdr generic-list)) | 11315 | (setq generic-list (cdr generic-list)) |
| 11115 | (insert (if generic-list "," ")")) | 11316 | (insert (if generic-list "," ")")) |
| 11317 | (when (and (not generic-list) secondary | ||
| 11318 | (null (nth 2 vhdl-port-list))) | ||
| 11319 | (insert ";")) | ||
| 11116 | ;; paste comment | 11320 | ;; paste comment |
| 11117 | (when (or vhdl-include-type-comments | 11321 | (when (or vhdl-include-type-comments |
| 11118 | (and vhdl-include-port-comments (nth 3 generic))) | 11322 | (and vhdl-include-port-comments (nth 3 generic))) |
| @@ -11140,7 +11344,7 @@ with INDENT." | |||
| 11140 | (insert (vhdl-replace-string vhdl-actual-port-name | 11344 | (insert (vhdl-replace-string vhdl-actual-port-name |
| 11141 | (car (nth 0 (car port-list))))) | 11345 | (car (nth 0 (car port-list))))) |
| 11142 | (setq port-list (cdr port-list)) | 11346 | (setq port-list (cdr port-list)) |
| 11143 | (insert (if port-list ", " ");"))) | 11347 | (insert (if port-list ", " ")"))) |
| 11144 | (unless vhdl-argument-list-indent | 11348 | (unless vhdl-argument-list-indent |
| 11145 | (insert "\n") (indent-to (+ margin vhdl-basic-offset))) | 11349 | (insert "\n") (indent-to (+ margin vhdl-basic-offset))) |
| 11146 | (setq list-margin (current-column)) | 11350 | (setq list-margin (current-column)) |
| @@ -11220,6 +11424,8 @@ with INDENT." | |||
| 11220 | (when (nth 2 vhdl-port-list) | 11424 | (when (nth 2 vhdl-port-list) |
| 11221 | (insert "\n") (indent-to (+ margin vhdl-basic-offset)) | 11425 | (insert "\n") (indent-to (+ margin vhdl-basic-offset)) |
| 11222 | (vhdl-port-paste-port-map)) | 11426 | (vhdl-port-paste-port-map)) |
| 11427 | (unless (or (nth 1 vhdl-port-list) (nth 2 vhdl-port-list)) | ||
| 11428 | (insert ";")) | ||
| 11223 | (message "Pasting port as instantiation \"%s\"...done" name)) | 11429 | (message "Pasting port as instantiation \"%s\"...done" name)) |
| 11224 | (setq vhdl-port-list orig-vhdl-port-list)))) | 11430 | (setq vhdl-port-list orig-vhdl-port-list)))) |
| 11225 | 11431 | ||
| @@ -11361,7 +11567,9 @@ with INDENT." | |||
| 11361 | ;; open entity file | 11567 | ;; open entity file |
| 11362 | (unless (eq vhdl-testbench-create-files 'none) | 11568 | (unless (eq vhdl-testbench-create-files 'none) |
| 11363 | (setq ent-file-name | 11569 | (setq ent-file-name |
| 11364 | (concat ent-name "." (file-name-extension (buffer-file-name)))) | 11570 | (concat (vhdl-replace-string vhdl-testbench-entity-file-name |
| 11571 | ent-name t) | ||
| 11572 | "." (file-name-extension (buffer-file-name)))) | ||
| 11365 | (if (file-exists-p ent-file-name) | 11573 | (if (file-exists-p ent-file-name) |
| 11366 | (if (y-or-n-p | 11574 | (if (y-or-n-p |
| 11367 | (concat "File \"" ent-file-name "\" exists; overwrite? ")) | 11575 | (concat "File \"" ent-file-name "\" exists; overwrite? ")) |
| @@ -11408,8 +11616,9 @@ with INDENT." | |||
| 11408 | (insert "\n") | 11616 | (insert "\n") |
| 11409 | (setq ent-buffer (current-buffer)) | 11617 | (setq ent-buffer (current-buffer)) |
| 11410 | (setq arch-file-name | 11618 | (setq arch-file-name |
| 11411 | (concat ent-name "_" arch-name "." | 11619 | (concat (vhdl-replace-string vhdl-testbench-architecture-file-name |
| 11412 | (file-name-extension (buffer-file-name)))) | 11620 | (concat ent-name " " arch-name) t) |
| 11621 | "." (file-name-extension (buffer-file-name)))) | ||
| 11413 | (when (and (file-exists-p arch-file-name) | 11622 | (when (and (file-exists-p arch-file-name) |
| 11414 | (not (y-or-n-p (concat "File \"" arch-file-name | 11623 | (not (y-or-n-p (concat "File \"" arch-file-name |
| 11415 | "\" exists; overwrite? ")))) | 11624 | "\" exists; overwrite? ")))) |
| @@ -11714,7 +11923,7 @@ with INDENT." | |||
| 11714 | (vhdl-paste-group-comment (nth 5 vhdl-subprog-list) list-margin)) | 11923 | (vhdl-paste-group-comment (nth 5 vhdl-subprog-list) list-margin)) |
| 11715 | ;; paste return type | 11924 | ;; paste return type |
| 11716 | (insert "return " (nth 3 vhdl-subprog-list)) | 11925 | (insert "return " (nth 3 vhdl-subprog-list)) |
| 11717 | (if (eq kind 'decl) (insert ";") (vhdl-insert-keyword " is")) | 11926 | (if (eq kind 'decl) (insert ";") (vhdl-insert-keyword " is")) |
| 11718 | (when (and vhdl-include-port-comments (nth 4 vhdl-subprog-list)) | 11927 | (when (and vhdl-include-port-comments (nth 4 vhdl-subprog-list)) |
| 11719 | (vhdl-comment-insert-inline (nth 4 vhdl-subprog-list) t))) | 11928 | (vhdl-comment-insert-inline (nth 4 vhdl-subprog-list) t))) |
| 11720 | ;; align parameter list | 11929 | ;; align parameter list |
| @@ -11938,7 +12147,9 @@ options vhdl-upper-case-{keywords,types,attributes,enum-values}." | |||
| 11938 | "Return the line number of the line containing point." | 12147 | "Return the line number of the line containing point." |
| 11939 | (save-restriction | 12148 | (save-restriction |
| 11940 | (widen) | 12149 | (widen) |
| 11941 | (1+ (count-lines (point-min) (line-beginning-position))))) | 12150 | (save-excursion |
| 12151 | (beginning-of-line) | ||
| 12152 | (1+ (count-lines 1 (point)))))) | ||
| 11942 | 12153 | ||
| 11943 | (defun vhdl-line-kill-entire (&optional arg) | 12154 | (defun vhdl-line-kill-entire (&optional arg) |
| 11944 | "Delete entire line." | 12155 | "Delete entire line." |
| @@ -12065,7 +12276,8 @@ File statistics: \"%s\"\n\ | |||
| 12065 | # statements : %5d\n\ | 12276 | # statements : %5d\n\ |
| 12066 | # code lines : %5d\n\ | 12277 | # code lines : %5d\n\ |
| 12067 | # total lines : %5d\n\ " | 12278 | # total lines : %5d\n\ " |
| 12068 | (buffer-file-name) no-stats no-code-lines no-lines))) | 12279 | (buffer-file-name) no-stats no-code-lines no-lines) |
| 12280 | (unless vhdl-emacs-21 (vhdl-show-messages)))) | ||
| 12069 | 12281 | ||
| 12070 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 12282 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 12071 | ;; Help functions | 12283 | ;; Help functions |
| @@ -12108,6 +12320,12 @@ File statistics: \"%s\"\n\ | |||
| 12108 | (vhdl-warning (format "Unknown VHDL project: \"%s\"" name)))) | 12320 | (vhdl-warning (format "Unknown VHDL project: \"%s\"" name)))) |
| 12109 | (vhdl-speedbar-update-current-project)) | 12321 | (vhdl-speedbar-update-current-project)) |
| 12110 | 12322 | ||
| 12323 | (defun vhdl-set-default-project () | ||
| 12324 | "Set current project as default on startup." | ||
| 12325 | (interactive) | ||
| 12326 | (customize-set-variable 'vhdl-project vhdl-project) | ||
| 12327 | (customize-save-customized)) | ||
| 12328 | |||
| 12111 | (defun vhdl-toggle-project (name token indent) | 12329 | (defun vhdl-toggle-project (name token indent) |
| 12112 | "Set current project to NAME or unset if NAME is current project." | 12330 | "Set current project to NAME or unset if NAME is current project." |
| 12113 | (vhdl-set-project (if (equal name vhdl-project) "" name))) | 12331 | (vhdl-set-project (if (equal name vhdl-project) "" name))) |
| @@ -12165,7 +12383,7 @@ File statistics: \"%s\"\n\ | |||
| 12165 | (load-file file-name) | 12383 | (load-file file-name) |
| 12166 | (when (/= (length (aget vhdl-project-alist vhdl-project t)) 10) | 12384 | (when (/= (length (aget vhdl-project-alist vhdl-project t)) 10) |
| 12167 | (adelete 'vhdl-project-alist vhdl-project) | 12385 | (adelete 'vhdl-project-alist vhdl-project) |
| 12168 | (error)) | 12386 | (error "")) |
| 12169 | (when not-make-current | 12387 | (when not-make-current |
| 12170 | (setq vhdl-project current-project)) | 12388 | (setq vhdl-project current-project)) |
| 12171 | (vhdl-update-mode-menu) | 12389 | (vhdl-update-mode-menu) |
| @@ -12373,8 +12591,8 @@ File statistics: \"%s\"\n\ | |||
| 12373 | (save-match-data | 12591 | (save-match-data |
| 12374 | (goto-char (match-end 1)) | 12592 | (goto-char (match-end 1)) |
| 12375 | ;; move to next item | 12593 | ;; move to next item |
| 12376 | (if (looking-at "\\s-*,") | 12594 | (if (looking-at "\\(\\s-*,\\)") |
| 12377 | (goto-char (match-end 0)) | 12595 | (goto-char (match-end 1)) |
| 12378 | (end-of-line) t)))) | 12596 | (end-of-line) t)))) |
| 12379 | (error t))) | 12597 | (error t))) |
| 12380 | 12598 | ||
| @@ -12422,7 +12640,7 @@ This does highlighting of keywords and standard identifiers.") | |||
| 12422 | "postponed\\|process\\|" | 12640 | "postponed\\|process\\|" |
| 12423 | (when (vhdl-standard-p 'ams) "procedural\\|") | 12641 | (when (vhdl-standard-p 'ams) "procedural\\|") |
| 12424 | "with\\|while" | 12642 | "with\\|while" |
| 12425 | "\\)\\>\\|\\w+\\s-*\\(([^\n]*)\\)*\\s-*<=\\)") | 12643 | "\\)\\>\\|\\w+\\s-*\\(([^\n]*)\\|\\.\\w+\\)*\\s-*<=\\)") |
| 12426 | 1 'font-lock-function-name-face) | 12644 | 1 'font-lock-function-name-face) |
| 12427 | 12645 | ||
| 12428 | ;; highlight label and component name of component instantiations | 12646 | ;; highlight label and component name of component instantiations |
| @@ -12489,7 +12707,7 @@ This does highlighting of keywords and standard identifiers.") | |||
| 12489 | (list | 12707 | (list |
| 12490 | (concat | 12708 | (concat |
| 12491 | "^\\s-*attribute\\s-+\\(\\w+\\)") | 12709 | "^\\s-*attribute\\s-+\\(\\w+\\)") |
| 12492 | 1 'vhdl-attribute) | 12710 | 1 'vhdl-font-lock-attribute-face) |
| 12493 | 12711 | ||
| 12494 | ;; highlight type/nature name in (sub)type/(sub)nature declarations | 12712 | ;; highlight type/nature name in (sub)type/(sub)nature declarations |
| 12495 | (list | 12713 | (list |
| @@ -12521,7 +12739,7 @@ This does highlighting of keywords and standard identifiers.") | |||
| 12521 | (while (= (preceding-char) ?\)) (backward-sexp)) | 12739 | (while (= (preceding-char) ?\)) (backward-sexp)) |
| 12522 | (skip-syntax-backward "w_") | 12740 | (skip-syntax-backward "w_") |
| 12523 | (skip-syntax-backward " ") | 12741 | (skip-syntax-backward " ") |
| 12524 | (when (memq (preceding-char) '(?n ?N)) | 12742 | (when (memq (preceding-char) '(?n ?N ?|)) |
| 12525 | (goto-char (point-max)))) | 12743 | (goto-char (point-max)))) |
| 12526 | (goto-char (match-end 1)) (1 font-lock-variable-name-face))) | 12744 | (goto-char (match-end 1)) (1 font-lock-variable-name-face))) |
| 12527 | 12745 | ||
| @@ -12547,39 +12765,40 @@ This does highlighting of additional reserved words.") | |||
| 12547 | 12765 | ||
| 12548 | (defconst vhdl-font-lock-keywords-5 | 12766 | (defconst vhdl-font-lock-keywords-5 |
| 12549 | ;; background highlight translate-off regions | 12767 | ;; background highlight translate-off regions |
| 12550 | '((vhdl-match-translate-off (0 vhdl-translate-off-face append))) | 12768 | '((vhdl-match-translate-off (0 vhdl-font-lock-translate-off-face append))) |
| 12551 | "For consideration as a value of `vhdl-font-lock-keywords'. | 12769 | "For consideration as a value of `vhdl-font-lock-keywords'. |
| 12552 | This does background highlighting of translate-off regions.") | 12770 | This does background highlighting of translate-off regions.") |
| 12553 | 12771 | ||
| 12554 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 12772 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 12555 | ;; Font and color definitions | 12773 | ;; Font and color definitions |
| 12556 | 12774 | ||
| 12557 | (defvar vhdl-prompt-face 'vhdl-prompt | 12775 | (defvar vhdl-font-lock-prompt-face 'vhdl-font-lock-prompt-face |
| 12558 | "Face name to use for prompts.") | 12776 | "Face name to use for prompts.") |
| 12559 | 12777 | ||
| 12560 | (defvar vhdl-attribute-face 'vhdl-attribute | 12778 | (defvar vhdl-font-lock-attribute-face 'vhdl-font-lock-attribute-face |
| 12561 | "Face name to use for standardized attributes.") | 12779 | "Face name to use for standardized attributes.") |
| 12562 | 12780 | ||
| 12563 | (defvar vhdl-enumvalue-face 'vhdl-enumvalue | 12781 | (defvar vhdl-font-lock-enumvalue-face 'vhdl-font-lock-enumvalue-face |
| 12564 | "Face name to use for standardized enumeration values.") | 12782 | "Face name to use for standardized enumeration values.") |
| 12565 | 12783 | ||
| 12566 | (defvar vhdl-function-face 'vhdl-function | 12784 | (defvar vhdl-font-lock-function-face 'vhdl-font-lock-function-face |
| 12567 | "Face name to use for standardized functions and packages.") | 12785 | "Face name to use for standardized functions and packages.") |
| 12568 | 12786 | ||
| 12569 | (defvar vhdl-directive-face 'vhdl-directive | 12787 | (defvar vhdl-font-lock-directive-face 'vhdl-font-lock-directive-face |
| 12570 | "Face name to use for directives.") | 12788 | "Face name to use for directives.") |
| 12571 | 12789 | ||
| 12572 | (defvar vhdl-reserved-words-face 'vhdl-reserved-words | 12790 | (defvar vhdl-font-lock-reserved-words-face 'vhdl-font-lock-reserved-words-face |
| 12573 | "Face name to use for additional reserved words.") | 12791 | "Face name to use for additional reserved words.") |
| 12574 | 12792 | ||
| 12575 | (defvar vhdl-translate-off-face 'vhdl-translate-off | 12793 | (defvar vhdl-font-lock-translate-off-face 'vhdl-font-lock-translate-off-face |
| 12576 | "Face name to use for translate-off regions.") | 12794 | "Face name to use for translate-off regions.") |
| 12577 | 12795 | ||
| 12578 | ;; face names to use for words with special syntax. | 12796 | ;; face names to use for words with special syntax. |
| 12579 | (let ((syntax-alist vhdl-special-syntax-alist) | 12797 | (let ((syntax-alist vhdl-special-syntax-alist) |
| 12580 | name) | 12798 | name) |
| 12581 | (while syntax-alist | 12799 | (while syntax-alist |
| 12582 | (setq name (vhdl-function-name "vhdl" (nth 0 (car syntax-alist)))) | 12800 | (setq name (vhdl-function-name |
| 12801 | "vhdl-font-lock" (nth 0 (car syntax-alist)) "face")) | ||
| 12583 | (eval `(defvar ,name ',name | 12802 | (eval `(defvar ,name ',name |
| 12584 | ,(concat "Face name to use for " | 12803 | ,(concat "Face name to use for " |
| 12585 | (nth 0 (car syntax-alist)) "."))) | 12804 | (nth 0 (car syntax-alist)) "."))) |
| @@ -12603,59 +12822,49 @@ This does background highlighting of translate-off regions.") | |||
| 12603 | (custom-add-to-group | 12822 | (custom-add-to-group |
| 12604 | 'vhdl-highlight-faces 'font-lock-variable-name-face 'custom-face) | 12823 | 'vhdl-highlight-faces 'font-lock-variable-name-face 'custom-face) |
| 12605 | 12824 | ||
| 12606 | (defface vhdl-prompt | 12825 | (defface vhdl-font-lock-prompt-face |
| 12607 | '((((min-colors 88) (class color) (background light)) | 12826 | '((((class color) (background light)) (:foreground "Red" :bold t)) |
| 12827 | (((min-colors 88) (class color) (background light)) | ||
| 12608 | (:foreground "Red1" :bold t)) | 12828 | (:foreground "Red1" :bold t)) |
| 12609 | (((class color) (background light)) (:foreground "Red" :bold t)) | ||
| 12610 | (((class color) (background dark)) (:foreground "Pink" :bold t)) | 12829 | (((class color) (background dark)) (:foreground "Pink" :bold t)) |
| 12611 | (t (:inverse-video t))) | 12830 | (t (:inverse-video t))) |
| 12612 | "Font lock mode face used to highlight prompts." | 12831 | "Font lock mode face used to highlight prompts." |
| 12613 | :group 'vhdl-highlight-faces | 12832 | :group 'vhdl-highlight-faces |
| 12614 | :group 'font-lock-highlighting-faces) | 12833 | :group 'font-lock-highlighting-faces) |
| 12615 | ;; backward-compatibility alias | ||
| 12616 | (put 'vhdl-font-lock-prompt-face 'face-alias 'vhdl-prompt) | ||
| 12617 | 12834 | ||
| 12618 | (defface vhdl-attribute | 12835 | (defface vhdl-font-lock-attribute-face |
| 12619 | '((((class color) (background light)) (:foreground "Orchid")) | 12836 | '((((class color) (background light)) (:foreground "Orchid")) |
| 12620 | (((class color) (background dark)) (:foreground "LightSteelBlue")) | 12837 | (((class color) (background dark)) (:foreground "LightSteelBlue")) |
| 12621 | (t (:italic t :bold t))) | 12838 | (t (:italic t :bold t))) |
| 12622 | "Font lock mode face used to highlight standardized attributes." | 12839 | "Font lock mode face used to highlight standardized attributes." |
| 12623 | :group 'vhdl-highlight-faces | 12840 | :group 'vhdl-highlight-faces |
| 12624 | :group 'font-lock-highlighting-faces) | 12841 | :group 'font-lock-highlighting-faces) |
| 12625 | ;; backward-compatibility alias | ||
| 12626 | (put 'vhdl-font-lock-attribute-face 'face-alias 'vhdl-attribute) | ||
| 12627 | 12842 | ||
| 12628 | (defface vhdl-enumvalue | 12843 | (defface vhdl-font-lock-enumvalue-face |
| 12629 | '((((class color) (background light)) (:foreground "SaddleBrown")) | 12844 | '((((class color) (background light)) (:foreground "SaddleBrown")) |
| 12630 | (((class color) (background dark)) (:foreground "BurlyWood")) | 12845 | (((class color) (background dark)) (:foreground "BurlyWood")) |
| 12631 | (t (:italic t :bold t))) | 12846 | (t (:italic t :bold t))) |
| 12632 | "Font lock mode face used to highlight standardized enumeration values." | 12847 | "Font lock mode face used to highlight standardized enumeration values." |
| 12633 | :group 'vhdl-highlight-faces | 12848 | :group 'vhdl-highlight-faces |
| 12634 | :group 'font-lock-highlighting-faces) | 12849 | :group 'font-lock-highlighting-faces) |
| 12635 | ;; backward-compatibility alias | ||
| 12636 | (put 'vhdl-font-lock-enumvalue-face 'face-alias 'vhdl-enumvalue) | ||
| 12637 | 12850 | ||
| 12638 | (defface vhdl-function | 12851 | (defface vhdl-font-lock-function-face |
| 12639 | '((((class color) (background light)) (:foreground "Cyan4")) | 12852 | '((((class color) (background light)) (:foreground "Cyan4")) |
| 12640 | (((class color) (background dark)) (:foreground "Orchid1")) | 12853 | (((class color) (background dark)) (:foreground "Orchid1")) |
| 12641 | (t (:italic t :bold t))) | 12854 | (t (:italic t :bold t))) |
| 12642 | "Font lock mode face used to highlight standardized functions and packages." | 12855 | "Font lock mode face used to highlight standardized functions and packages." |
| 12643 | :group 'vhdl-highlight-faces | 12856 | :group 'vhdl-highlight-faces |
| 12644 | :group 'font-lock-highlighting-faces) | 12857 | :group 'font-lock-highlighting-faces) |
| 12645 | ;; backward-compatibility alias | ||
| 12646 | (put 'vhdl-font-lock-function-face 'face-alias 'vhdl-function) | ||
| 12647 | 12858 | ||
| 12648 | (defface vhdl-directive | 12859 | (defface vhdl-font-lock-directive-face |
| 12649 | '((((class color) (background light)) (:foreground "CadetBlue")) | 12860 | '((((class color) (background light)) (:foreground "CadetBlue")) |
| 12650 | (((class color) (background dark)) (:foreground "Aquamarine")) | 12861 | (((class color) (background dark)) (:foreground "Aquamarine")) |
| 12651 | (t (:italic t :bold t))) | 12862 | (t (:italic t :bold t))) |
| 12652 | "Font lock mode face used to highlight directives." | 12863 | "Font lock mode face used to highlight directives." |
| 12653 | :group 'vhdl-highlight-faces | 12864 | :group 'vhdl-highlight-faces |
| 12654 | :group 'font-lock-highlighting-faces) | 12865 | :group 'font-lock-highlighting-faces) |
| 12655 | ;; backward-compatibility alias | ||
| 12656 | (put 'vhdl-font-lock-directive-face 'face-alias 'vhdl-directive) | ||
| 12657 | 12866 | ||
| 12658 | (defface vhdl-reserved-word | 12867 | (defface vhdl-font-lock-reserved-words-face |
| 12659 | '((((class color) (background light)) (:foreground "Orange" :bold t)) | 12868 | '((((class color) (background light)) (:foreground "Orange" :bold t)) |
| 12660 | (((min-colors 88) (class color) (background dark)) | 12869 | (((min-colors 88) (class color) (background dark)) |
| 12661 | (:foreground "Yellow1" :bold t)) | 12870 | (:foreground "Yellow1" :bold t)) |
| @@ -12664,23 +12873,20 @@ This does background highlighting of translate-off regions.") | |||
| 12664 | "Font lock mode face used to highlight additional reserved words." | 12873 | "Font lock mode face used to highlight additional reserved words." |
| 12665 | :group 'vhdl-highlight-faces | 12874 | :group 'vhdl-highlight-faces |
| 12666 | :group 'font-lock-highlighting-faces) | 12875 | :group 'font-lock-highlighting-faces) |
| 12667 | ;; backward-compatibility alias | ||
| 12668 | (put 'vhdl-font-lock-reserved-words-face 'face-alias 'vhdl-reserved-word) | ||
| 12669 | 12876 | ||
| 12670 | (defface vhdl-translate-off | 12877 | (defface vhdl-font-lock-translate-off-face |
| 12671 | '((((class color) (background light)) (:background "LightGray")) | 12878 | '((((class color) (background light)) (:background "LightGray")) |
| 12672 | (((class color) (background dark)) (:background "DimGray")) | 12879 | (((class color) (background dark)) (:background "DimGray")) |
| 12673 | (t ())) | 12880 | (t ())) |
| 12674 | "Font lock mode face used to background highlight translate-off regions." | 12881 | "Font lock mode face used to background highlight translate-off regions." |
| 12675 | :group 'vhdl-highlight-faces | 12882 | :group 'vhdl-highlight-faces |
| 12676 | :group 'font-lock-highlighting-faces) | 12883 | :group 'font-lock-highlighting-faces) |
| 12677 | ;; backward-compatibility alias | ||
| 12678 | (put 'vhdl-font-lock-translate-off-face 'face-alias 'vhdl-translate-off) | ||
| 12679 | 12884 | ||
| 12680 | ;; font lock mode faces used to highlight words with special syntax. | 12885 | ;; font lock mode faces used to highlight words with special syntax. |
| 12681 | (let ((syntax-alist vhdl-special-syntax-alist)) | 12886 | (let ((syntax-alist vhdl-special-syntax-alist)) |
| 12682 | (while syntax-alist | 12887 | (while syntax-alist |
| 12683 | (eval `(defface ,(vhdl-function-name "vhdl" (caar syntax-alist)) | 12888 | (eval `(defface ,(vhdl-function-name |
| 12889 | "vhdl-font-lock" (caar syntax-alist) "face") | ||
| 12684 | '((((class color) (background light)) | 12890 | '((((class color) (background light)) |
| 12685 | (:foreground ,(nth 2 (car syntax-alist)))) | 12891 | (:foreground ,(nth 2 (car syntax-alist)))) |
| 12686 | (((class color) (background dark)) | 12892 | (((class color) (background dark)) |
| @@ -12697,23 +12903,28 @@ This does background highlighting of translate-off regions.") | |||
| 12697 | 12903 | ||
| 12698 | (defun vhdl-font-lock-init () | 12904 | (defun vhdl-font-lock-init () |
| 12699 | "Initialize fontification." | 12905 | "Initialize fontification." |
| 12700 | ;; highlight template prompts and directives | 12906 | ;; highlight template prompts and directives |
| 12701 | (setq vhdl-font-lock-keywords-0 | 12907 | (setq vhdl-font-lock-keywords-0 |
| 12702 | (list (list (concat "\\(^\\|[ \t(.']\\)\\(<" | 12908 | (list (list (concat "\\(^\\|[ \t(.']\\)\\(<" |
| 12703 | vhdl-template-prompt-syntax ">\\)") | 12909 | vhdl-template-prompt-syntax ">\\)") |
| 12704 | 2 'vhdl-prompt t) | 12910 | 2 'vhdl-font-lock-prompt-face t) |
| 12705 | (list (concat "--\\s-*" | 12911 | (list (concat "--\\s-*" |
| 12706 | vhdl-directive-keywords-regexp "\\s-+\\(.*\\)$") | 12912 | vhdl-directive-keywords-regexp "\\s-+\\(.*\\)$") |
| 12707 | 2 'vhdl-directive t))) | 12913 | 2 'vhdl-font-lock-directive-face t) |
| 12914 | ;; highlight c-preprocessor directives | ||
| 12915 | (list "^#[ \t]*\\(\\w+\\)\\([ \t]+\\(\\w+\\)\\)?" | ||
| 12916 | '(1 font-lock-builtin-face) | ||
| 12917 | '(3 font-lock-variable-name-face nil t)))) | ||
| 12708 | ;; highlight keywords and standardized types, attributes, enumeration | 12918 | ;; highlight keywords and standardized types, attributes, enumeration |
| 12709 | ;; values, and subprograms | 12919 | ;; values, and subprograms |
| 12710 | (setq vhdl-font-lock-keywords-1 | 12920 | (setq vhdl-font-lock-keywords-1 |
| 12711 | (list | 12921 | (list |
| 12712 | (list (concat "'" vhdl-attributes-regexp) 1 'vhdl-attribute) | 12922 | (list (concat "'" vhdl-attributes-regexp) |
| 12923 | 1 'vhdl-font-lock-attribute-face) | ||
| 12713 | (list vhdl-types-regexp 1 'font-lock-type-face) | 12924 | (list vhdl-types-regexp 1 'font-lock-type-face) |
| 12714 | (list vhdl-functions-regexp 1 'vhdl-function) | 12925 | (list vhdl-functions-regexp 1 'vhdl-font-lock-function-face) |
| 12715 | (list vhdl-packages-regexp 1 'vhdl-function) | 12926 | (list vhdl-packages-regexp 1 'vhdl-font-lock-function-face) |
| 12716 | (list vhdl-enum-values-regexp 1 'vhdl-enumvalue) | 12927 | (list vhdl-enum-values-regexp 1 'vhdl-font-lock-enumvalue-face) |
| 12717 | (list vhdl-keywords-regexp 1 'font-lock-keyword-face))) | 12928 | (list vhdl-keywords-regexp 1 'font-lock-keyword-face))) |
| 12718 | ;; highlight words with special syntax. | 12929 | ;; highlight words with special syntax. |
| 12719 | (setq vhdl-font-lock-keywords-3 | 12930 | (setq vhdl-font-lock-keywords-3 |
| @@ -12724,13 +12935,14 @@ This does background highlighting of translate-off regions.") | |||
| 12724 | (cons | 12935 | (cons |
| 12725 | (cons (concat "\\<\\(" (nth 1 (car syntax-alist)) "\\)\\>") | 12936 | (cons (concat "\\<\\(" (nth 1 (car syntax-alist)) "\\)\\>") |
| 12726 | (vhdl-function-name | 12937 | (vhdl-function-name |
| 12727 | "vhdl" (nth 0 (car syntax-alist)))) | 12938 | "vhdl-font-lock" (nth 0 (car syntax-alist)) "face")) |
| 12728 | keywords)) | 12939 | keywords)) |
| 12729 | (setq syntax-alist (cdr syntax-alist))) | 12940 | (setq syntax-alist (cdr syntax-alist))) |
| 12730 | keywords)) | 12941 | keywords)) |
| 12731 | ;; highlight additional reserved words | 12942 | ;; highlight additional reserved words |
| 12732 | (setq vhdl-font-lock-keywords-4 | 12943 | (setq vhdl-font-lock-keywords-4 |
| 12733 | (list (list vhdl-reserved-words-regexp 1 'vhdl-reserved-word))) | 12944 | (list (list vhdl-reserved-words-regexp 1 |
| 12945 | 'vhdl-font-lock-reserved-words-face))) | ||
| 12734 | ;; highlight everything together | 12946 | ;; highlight everything together |
| 12735 | (setq vhdl-font-lock-keywords | 12947 | (setq vhdl-font-lock-keywords |
| 12736 | (append | 12948 | (append |
| @@ -12755,7 +12967,7 @@ This does background highlighting of translate-off regions.") | |||
| 12755 | '(font-lock-syntactic-keywords . vhdl-font-lock-syntactic-keywords))) | 12967 | '(font-lock-syntactic-keywords . vhdl-font-lock-syntactic-keywords))) |
| 12756 | (when (fboundp 'font-lock-unset-defaults) | 12968 | (when (fboundp 'font-lock-unset-defaults) |
| 12757 | (font-lock-unset-defaults)) ; not implemented in XEmacs | 12969 | (font-lock-unset-defaults)) ; not implemented in XEmacs |
| 12758 | (font-lock-set-defaults) ;What for? --Stef | 12970 | (font-lock-set-defaults) |
| 12759 | (font-lock-mode nil) | 12971 | (font-lock-mode nil) |
| 12760 | (font-lock-mode t)) | 12972 | (font-lock-mode t)) |
| 12761 | 12973 | ||
| @@ -12768,12 +12980,18 @@ This does background highlighting of translate-off regions.") | |||
| 12768 | (unless (or (not vhdl-print-customize-faces) | 12980 | (unless (or (not vhdl-print-customize-faces) |
| 12769 | ps-print-color-p) | 12981 | ps-print-color-p) |
| 12770 | (set (make-local-variable 'ps-bold-faces) | 12982 | (set (make-local-variable 'ps-bold-faces) |
| 12771 | '(font-lock-keyword-face font-lock-type-face | 12983 | '(font-lock-keyword-face |
| 12772 | vhdl-attribute vhdl-enumvalue vhdl-directive)) | 12984 | font-lock-type-face |
| 12985 | vhdl-font-lock-attribute-face | ||
| 12986 | vhdl-font-lock-enumvalue-face | ||
| 12987 | vhdl-font-lock-directive-face)) | ||
| 12773 | (set (make-local-variable 'ps-italic-faces) | 12988 | (set (make-local-variable 'ps-italic-faces) |
| 12774 | '(font-lock-comment-face | 12989 | '(font-lock-comment-face |
| 12775 | font-lock-function-name-face font-lock-type-face | 12990 | font-lock-function-name-face |
| 12776 | vhdl-attribute vhdl-enumvalue vhdl-directive)) | 12991 | font-lock-type-face |
| 12992 | vhdl-font-lock-attribute-face | ||
| 12993 | vhdl-font-lock-enumvalue-face | ||
| 12994 | vhdl-font-lock-directive-face)) | ||
| 12777 | (set (make-local-variable 'ps-underlined-faces) | 12995 | (set (make-local-variable 'ps-underlined-faces) |
| 12778 | '(font-lock-string-face)) | 12996 | '(font-lock-string-face)) |
| 12779 | (setq ps-always-build-face-reference t)) | 12997 | (setq ps-always-build-face-reference t)) |
| @@ -12817,9 +13035,9 @@ project/directory.") | |||
| 12817 | ;; (ent-key ent-name ent-file ent-line | 13035 | ;; (ent-key ent-name ent-file ent-line |
| 12818 | ;; (arch-key arch-name arch-file arch-line | 13036 | ;; (arch-key arch-name arch-file arch-line |
| 12819 | ;; (inst-key inst-name inst-file inst-line inst-comp-name inst-ent-key | 13037 | ;; (inst-key inst-name inst-file inst-line inst-comp-name inst-ent-key |
| 12820 | ;; inst-arch-key inst-conf-key inst-lib-key) | 13038 | ;; inst-arch-key inst-conf-key inst-lib-key inst-path) |
| 12821 | ;; (lib-name pack-key)) | 13039 | ;; (lib-name pack-key)) |
| 12822 | ;; (lib-name pack-key)) | 13040 | ;; mra-key (lib-name pack-key)) |
| 12823 | 13041 | ||
| 12824 | (defvar vhdl-config-alist nil | 13042 | (defvar vhdl-config-alist nil |
| 12825 | "Cache with configurations for each project/directory.") | 13043 | "Cache with configurations for each project/directory.") |
| @@ -12827,7 +13045,7 @@ project/directory.") | |||
| 12827 | ;; (cache-key | 13045 | ;; (cache-key |
| 12828 | ;; (conf-key conf-name conf-file conf-line ent-key arch-key | 13046 | ;; (conf-key conf-name conf-file conf-line ent-key arch-key |
| 12829 | ;; (inst-key inst-comp-name inst-ent-key inst-arch-key | 13047 | ;; (inst-key inst-comp-name inst-ent-key inst-arch-key |
| 12830 | ;; inst-conf-key inst-lib-key) | 13048 | ;; inst-conf-key inst-lib-key) |
| 12831 | ;; (lib-name pack-key))) | 13049 | ;; (lib-name pack-key))) |
| 12832 | 13050 | ||
| 12833 | (defvar vhdl-package-alist nil | 13051 | (defvar vhdl-package-alist nil |
| @@ -12852,7 +13070,7 @@ project/directory.") | |||
| 12852 | ;; structure: (parenthesised expression means list of such entries) | 13070 | ;; structure: (parenthesised expression means list of such entries) |
| 12853 | ;; (cache-key | 13071 | ;; (cache-key |
| 12854 | ;; (file-name (ent-list) (arch-list) (arch-ent-list) (conf-list) | 13072 | ;; (file-name (ent-list) (arch-list) (arch-ent-list) (conf-list) |
| 12855 | ;; (pack-list) (pack-body-list) (inst-list) (inst-ent-list)) | 13073 | ;; (pack-list) (pack-body-list) (inst-list) (inst-ent-list)) |
| 12856 | 13074 | ||
| 12857 | (defvar vhdl-directory-alist nil | 13075 | (defvar vhdl-directory-alist nil |
| 12858 | "Cache with source directories for each project.") | 13076 | "Cache with source directories for each project.") |
| @@ -12985,7 +13203,6 @@ hierarchy otherwise.") | |||
| 12985 | (let* ((ent-name (match-string-no-properties 1)) | 13203 | (let* ((ent-name (match-string-no-properties 1)) |
| 12986 | (ent-key (downcase ent-name)) | 13204 | (ent-key (downcase ent-name)) |
| 12987 | (ent-entry (aget ent-alist ent-key t)) | 13205 | (ent-entry (aget ent-alist ent-key t)) |
| 12988 | (arch-alist (nth 3 ent-entry)) | ||
| 12989 | (lib-alist (vhdl-scan-context-clause))) | 13206 | (lib-alist (vhdl-scan-context-clause))) |
| 12990 | (if (nth 1 ent-entry) | 13207 | (if (nth 1 ent-entry) |
| 12991 | (vhdl-warning-when-idle | 13208 | (vhdl-warning-when-idle |
| @@ -12995,10 +13212,11 @@ hierarchy otherwise.") | |||
| 12995 | (setq ent-list (cons ent-key ent-list)) | 13212 | (setq ent-list (cons ent-key ent-list)) |
| 12996 | (aput 'ent-alist ent-key | 13213 | (aput 'ent-alist ent-key |
| 12997 | (list ent-name file-name (vhdl-current-line) | 13214 | (list ent-name file-name (vhdl-current-line) |
| 12998 | arch-alist lib-alist))))) | 13215 | (nth 3 ent-entry) (nth 4 ent-entry) |
| 13216 | lib-alist))))) | ||
| 12999 | ;; scan for architectures | 13217 | ;; scan for architectures |
| 13000 | (goto-char (point-min)) | 13218 | (goto-char (point-min)) |
| 13001 | (while (re-search-forward "^[ \t]*architecture[ \t\n]+\\(\\w+\\)[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t) | 13219 | (while (re-search-forward "^[ \t]*architecture[ \t\n]+\\(\\w+\\)[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t) |
| 13002 | (let* ((arch-name (match-string-no-properties 1)) | 13220 | (let* ((arch-name (match-string-no-properties 1)) |
| 13003 | (arch-key (downcase arch-name)) | 13221 | (arch-key (downcase arch-name)) |
| 13004 | (ent-name (match-string-no-properties 2)) | 13222 | (ent-name (match-string-no-properties 2)) |
| @@ -13021,7 +13239,7 @@ hierarchy otherwise.") | |||
| 13021 | (list (or (nth 0 ent-entry) ent-name) | 13239 | (list (or (nth 0 ent-entry) ent-name) |
| 13022 | (nth 1 ent-entry) (nth 2 ent-entry) | 13240 | (nth 1 ent-entry) (nth 2 ent-entry) |
| 13023 | (vhdl-sort-alist arch-alist) | 13241 | (vhdl-sort-alist arch-alist) |
| 13024 | (nth 4 ent-entry)))))) | 13242 | arch-key (nth 5 ent-entry)))))) |
| 13025 | ;; scan for configurations | 13243 | ;; scan for configurations |
| 13026 | (goto-char (point-min)) | 13244 | (goto-char (point-min)) |
| 13027 | (while (re-search-forward "^[ \t]*configuration[ \t\n]+\\(\\w+\\)[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t) | 13245 | (while (re-search-forward "^[ \t]*configuration[ \t\n]+\\(\\w+\\)[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t) |
| @@ -13138,47 +13356,61 @@ hierarchy otherwise.") | |||
| 13138 | (beg-of-unit (point)) | 13356 | (beg-of-unit (point)) |
| 13139 | (end-of-unit (vhdl-get-end-of-unit)) | 13357 | (end-of-unit (vhdl-get-end-of-unit)) |
| 13140 | (inst-no 0) | 13358 | (inst-no 0) |
| 13141 | inst-alist) | 13359 | inst-alist inst-path) |
| 13142 | ;; scan for contained instantiations | 13360 | ;; scan for contained instantiations |
| 13143 | (while (and (re-search-forward | 13361 | (while (and (re-search-forward |
| 13144 | (concat "^[ \t]*\\(\\w+\\)[ \t\n]*:[ \t\n]*\\(" | 13362 | (concat "^[ \t]*\\(\\w+\\)[ \t\n]*:[ \t\n]*\\(" |
| 13145 | "\\(\\w+\\)[ \t\n]+\\(--[^\n]*\n[ \t\n]*\\)*\\(generic\\|port\\)[ \t\n]+map\\>\\|" | 13363 | "\\(\\w+\\)[ \t\n]+\\(--[^\n]*\n[ \t\n]*\\)*\\(generic\\|port\\)[ \t\n]+map\\>\\|" |
| 13146 | "component[ \t\n]+\\(\\w+\\)\\|" | 13364 | "component[ \t\n]+\\(\\w+\\)\\|" |
| 13147 | "\\(\\(entity\\)\\|configuration\\)[ \t\n]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n]*(\\(\\w+\\))\\)?\\)") end-of-unit t) | 13365 | "\\(\\(entity\\)\\|configuration\\)[ \t\n]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n]*(\\(\\w+\\))\\)?\\|" |
| 13366 | "\\(\\(for\\|if\\)\\>[^;:]+\\<generate\\>\\|block\\>\\)\\)\\|" | ||
| 13367 | "\\(^[ \t]*end[ \t\n]+\\(generate\\|block\\)\\>\\)") end-of-unit t) | ||
| 13148 | (or (not limit-hier-inst-no) | 13368 | (or (not limit-hier-inst-no) |
| 13149 | (<= (setq inst-no (1+ inst-no)) | 13369 | (<= (setq inst-no (1+ inst-no)) |
| 13150 | limit-hier-inst-no))) | 13370 | limit-hier-inst-no))) |
| 13151 | (let* ((inst-name (match-string-no-properties 1)) | 13371 | (cond |
| 13152 | (inst-key (downcase inst-name)) | 13372 | ;; block/generate beginning found |
| 13153 | (inst-comp-name | 13373 | ((match-string 14) |
| 13154 | (or (match-string-no-properties 3) | 13374 | (setq inst-path |
| 13155 | (match-string-no-properties 6))) | 13375 | (cons (match-string-no-properties 1) inst-path))) |
| 13156 | (inst-ent-key | 13376 | ;; block/generate end found |
| 13157 | (or (and (match-string 8) | 13377 | ((match-string 16) |
| 13158 | (vhdl-match-string-downcase 11)) | 13378 | (setq inst-path (cdr inst-path))) |
| 13159 | (and inst-comp-name | 13379 | ;; instantiation found |
| 13160 | (downcase inst-comp-name)))) | 13380 | (t |
| 13161 | (inst-arch-key (vhdl-match-string-downcase 13)) | 13381 | (let* ((inst-name (match-string-no-properties 1)) |
| 13162 | (inst-conf-key | 13382 | (inst-key (downcase inst-name)) |
| 13163 | (and (not (match-string 8)) | 13383 | (inst-comp-name |
| 13164 | (vhdl-match-string-downcase 11))) | 13384 | (or (match-string-no-properties 3) |
| 13165 | (inst-lib-key (vhdl-match-string-downcase 10))) | 13385 | (match-string-no-properties 6))) |
| 13166 | (goto-char (match-end 1)) | 13386 | (inst-ent-key |
| 13167 | (setq inst-list (cons inst-key inst-list) | 13387 | (or (and (match-string 8) |
| 13168 | inst-ent-list (cons inst-ent-key inst-ent-list)) | 13388 | (vhdl-match-string-downcase 11)) |
| 13169 | (setq inst-alist | 13389 | (and inst-comp-name |
| 13170 | (append | 13390 | (downcase inst-comp-name)))) |
| 13171 | inst-alist | 13391 | (inst-arch-key (vhdl-match-string-downcase 13)) |
| 13172 | (list (list inst-key inst-name file-name | 13392 | (inst-conf-key |
| 13173 | (vhdl-current-line) inst-comp-name | 13393 | (and (not (match-string 8)) |
| 13174 | inst-ent-key inst-arch-key | 13394 | (vhdl-match-string-downcase 11))) |
| 13175 | inst-conf-key inst-lib-key)))))) | 13395 | (inst-lib-key (vhdl-match-string-downcase 10))) |
| 13396 | (goto-char (match-end 1)) | ||
| 13397 | (setq inst-list (cons inst-key inst-list) | ||
| 13398 | inst-ent-list | ||
| 13399 | (cons inst-ent-key inst-ent-list)) | ||
| 13400 | (setq inst-alist | ||
| 13401 | (append | ||
| 13402 | inst-alist | ||
| 13403 | (list (list inst-key inst-name file-name | ||
| 13404 | (vhdl-current-line) inst-comp-name | ||
| 13405 | inst-ent-key inst-arch-key | ||
| 13406 | inst-conf-key inst-lib-key | ||
| 13407 | (reverse inst-path))))))))) | ||
| 13176 | ;; scan for contained configuration specifications | 13408 | ;; scan for contained configuration specifications |
| 13177 | (goto-char beg-of-unit) | 13409 | (goto-char beg-of-unit) |
| 13178 | (while (re-search-forward | 13410 | (while (re-search-forward |
| 13179 | (concat "^[ \t]*for[ \t\n]+\\(\\w+\\([ \t\n]*,[ \t\n]*\\w+\\)*\\)[ \t\n]*:[ \t\n]*\\(\\w+\\)[ \t\n]+\\(--[^\n]*\n[ \t\n]*\\)*" | 13411 | (concat "^[ \t]*for[ \t\n]+\\(\\w+\\([ \t\n]*,[ \t\n]*\\w+\\)*\\)[ \t\n]*:[ \t\n]*\\(\\w+\\)[ \t\n]+\\(--[^\n]*\n[ \t\n]*\\)*" |
| 13180 | "use[ \t\n]+\\(\\(entity\\)\\|configuration\\)[ \t\n]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n]*(\\(\\w+\\))\\)?") end-of-unit t) | 13412 | "use[ \t\n]+\\(\\(entity\\)\\|configuration\\)[ \t\n]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n]*(\\(\\w+\\))\\)?") end-of-unit t) |
| 13181 | (let* ((inst-comp-name (match-string-no-properties 3)) | 13413 | (let* ((inst-comp-name (match-string-no-properties 3)) |
| 13182 | (inst-ent-key | 13414 | (inst-ent-key |
| 13183 | (and (match-string 6) | 13415 | (and (match-string 6) |
| 13184 | (vhdl-match-string-downcase 9))) | 13416 | (vhdl-match-string-downcase 9))) |
| @@ -13222,7 +13454,7 @@ hierarchy otherwise.") | |||
| 13222 | (aput 'ent-alist ent-key | 13454 | (aput 'ent-alist ent-key |
| 13223 | (list (nth 0 ent-entry) (nth 1 ent-entry) | 13455 | (list (nth 0 ent-entry) (nth 1 ent-entry) |
| 13224 | (nth 2 ent-entry) (vhdl-sort-alist arch-alist) | 13456 | (nth 2 ent-entry) (vhdl-sort-alist arch-alist) |
| 13225 | (nth 4 ent-entry))) | 13457 | (nth 4 ent-entry) (nth 5 ent-entry))) |
| 13226 | (when (and limit-hier-inst-no | 13458 | (when (and limit-hier-inst-no |
| 13227 | (> inst-no limit-hier-inst-no)) | 13459 | (> inst-no limit-hier-inst-no)) |
| 13228 | (message "WARNING: Scan limit (hierarchy: instances per architecture) reached in file:\n \"%s\"" file-name) | 13460 | (message "WARNING: Scan limit (hierarchy: instances per architecture) reached in file:\n \"%s\"" file-name) |
| @@ -13415,7 +13647,7 @@ of PROJECT." | |||
| 13415 | (if (or (nth 1 entry) arch-alist) | 13647 | (if (or (nth 1 entry) arch-alist) |
| 13416 | (aput 'ent-alist ent-key | 13648 | (aput 'ent-alist ent-key |
| 13417 | (list (nth 0 entry) (nth 1 entry) (nth 2 entry) | 13649 | (list (nth 0 entry) (nth 1 entry) (nth 2 entry) |
| 13418 | arch-alist (nth 4 entry))) | 13650 | arch-alist (nth 4 entry) (nth 5 entry))) |
| 13419 | (adelete 'ent-alist ent-key))) | 13651 | (adelete 'ent-alist ent-key))) |
| 13420 | (setq arch-list (cdr arch-list) | 13652 | (setq arch-list (cdr arch-list) |
| 13421 | arch-ent-list (cdr arch-ent-list))) | 13653 | arch-ent-list (cdr arch-ent-list))) |
| @@ -13479,6 +13711,7 @@ of PROJECT." | |||
| 13479 | updated)) | 13711 | updated)) |
| 13480 | (setq file-list (cdr file-list))) | 13712 | (setq file-list (cdr file-list))) |
| 13481 | (setq vhdl-modified-file-list nil) | 13713 | (setq vhdl-modified-file-list nil) |
| 13714 | (vhdl-speedbar-update-current-unit) | ||
| 13482 | (when updated (message "Updating hierarchy...done"))))) | 13715 | (when updated (message "Updating hierarchy...done"))))) |
| 13483 | 13716 | ||
| 13484 | ;; structure (parenthesised expression means list of such entries) | 13717 | ;; structure (parenthesised expression means list of such entries) |
| @@ -13533,17 +13766,18 @@ entity ENT-KEY." | |||
| 13533 | (setq inst-ent-entry (aget ent-alist inst-ent-key t)) | 13766 | (setq inst-ent-entry (aget ent-alist inst-ent-key t)) |
| 13534 | ;; determine architecture | 13767 | ;; determine architecture |
| 13535 | (setq inst-arch-key | 13768 | (setq inst-arch-key |
| 13536 | (or (nth 3 (car tmp-list)) ; from configuration | 13769 | (or (nth 3 (car tmp-list)) ; from configuration |
| 13537 | (nth 4 inst-conf-entry) ; from subconfiguration | 13770 | (nth 4 inst-conf-entry) ; from subconfiguration |
| 13538 | (nth 6 inst-entry) ; from direct instantiation | 13771 | (nth 6 inst-entry) ; from direct instantiation |
| 13539 | (nth 4 (aget conf-alist (nth 7 inst-entry))) | 13772 | (nth 4 (aget conf-alist (nth 7 inst-entry))) |
| 13540 | ; from configuration spec. | 13773 | ; from configuration spec. |
| 13541 | (caar (nth 3 inst-ent-entry)))) ; random (simplified MRA) | 13774 | (nth 4 inst-ent-entry) ; MRA |
| 13775 | (caar (nth 3 inst-ent-entry)))) ; first alphabetically | ||
| 13542 | (setq inst-arch-entry (aget (nth 3 inst-ent-entry) inst-arch-key t)) | 13776 | (setq inst-arch-entry (aget (nth 3 inst-ent-entry) inst-arch-key t)) |
| 13543 | ;; set library | 13777 | ;; set library |
| 13544 | (setq inst-lib-key | 13778 | (setq inst-lib-key |
| 13545 | (or (nth 5 (car tmp-list)) ; from configuration | 13779 | (or (nth 5 (car tmp-list)) ; from configuration |
| 13546 | (nth 8 inst-entry))) ; from direct instantiation | 13780 | (nth 8 inst-entry))) ; from direct instantiation |
| 13547 | ;; gather information for this instance | 13781 | ;; gather information for this instance |
| 13548 | (setq comp-entry | 13782 | (setq comp-entry |
| 13549 | (list (nth 1 inst-entry) | 13783 | (list (nth 1 inst-entry) |
| @@ -13715,7 +13949,7 @@ entity ENT-KEY." | |||
| 13715 | (progn (load-file file-dir-name) | 13949 | (progn (load-file file-dir-name) |
| 13716 | (string< (mapconcat | 13950 | (string< (mapconcat |
| 13717 | (lambda (a) (format "%3d" (string-to-number a))) | 13951 | (lambda (a) (format "%3d" (string-to-number a))) |
| 13718 | (split-string "3.31.14" "\\.") "") | 13952 | (split-string "3.33" "\\.") "") |
| 13719 | (mapconcat | 13953 | (mapconcat |
| 13720 | (lambda (a) (format "%3d" (string-to-number a))) | 13954 | (lambda (a) (format "%3d" (string-to-number a))) |
| 13721 | (split-string vhdl-cache-version "\\.") ""))) | 13955 | (split-string vhdl-cache-version "\\.") ""))) |
| @@ -13775,6 +14009,8 @@ if required." | |||
| 13775 | (define-key vhdl-speedbar-key-map "_" 'vhdl-speedbar-contract-all) | 14009 | (define-key vhdl-speedbar-key-map "_" 'vhdl-speedbar-contract-all) |
| 13776 | (define-key vhdl-speedbar-key-map "C" 'vhdl-speedbar-port-copy) | 14010 | (define-key vhdl-speedbar-key-map "C" 'vhdl-speedbar-port-copy) |
| 13777 | (define-key vhdl-speedbar-key-map "P" 'vhdl-speedbar-place-component) | 14011 | (define-key vhdl-speedbar-key-map "P" 'vhdl-speedbar-place-component) |
| 14012 | (define-key vhdl-speedbar-key-map "F" 'vhdl-speedbar-configuration) | ||
| 14013 | (define-key vhdl-speedbar-key-map "A" 'vhdl-speedbar-select-mra) | ||
| 13778 | (define-key vhdl-speedbar-key-map "K" 'vhdl-speedbar-make-design) | 14014 | (define-key vhdl-speedbar-key-map "K" 'vhdl-speedbar-make-design) |
| 13779 | (define-key vhdl-speedbar-key-map "R" 'vhdl-speedbar-rescan-hierarchy) | 14015 | (define-key vhdl-speedbar-key-map "R" 'vhdl-speedbar-rescan-hierarchy) |
| 13780 | (define-key vhdl-speedbar-key-map "S" 'vhdl-save-caches) | 14016 | (define-key vhdl-speedbar-key-map "S" 'vhdl-save-caches) |
| @@ -13816,6 +14052,10 @@ if required." | |||
| 13816 | (vhdl-speedbar-check-unit 'subprogram))] | 14052 | (vhdl-speedbar-check-unit 'subprogram))] |
| 13817 | ["Place Component" vhdl-speedbar-place-component | 14053 | ["Place Component" vhdl-speedbar-place-component |
| 13818 | (vhdl-speedbar-check-unit 'entity)] | 14054 | (vhdl-speedbar-check-unit 'entity)] |
| 14055 | ["Generate Configuration" vhdl-speedbar-configuration | ||
| 14056 | (vhdl-speedbar-check-unit 'architecture)] | ||
| 14057 | ["Select as MRA" vhdl-speedbar-select-mra | ||
| 14058 | (vhdl-speedbar-check-unit 'architecture)] | ||
| 13819 | ["Make" vhdl-speedbar-make-design | 14059 | ["Make" vhdl-speedbar-make-design |
| 13820 | (save-excursion (beginning-of-line) (looking-at "[0-9]+: *[[<]"))] | 14060 | (save-excursion (beginning-of-line) (looking-at "[0-9]+: *[[<]"))] |
| 13821 | ["Generate Makefile" vhdl-speedbar-generate-makefile | 14061 | ["Generate Makefile" vhdl-speedbar-generate-makefile |
| @@ -13982,7 +14222,7 @@ otherwise use cached data." | |||
| 13982 | 'bracket ?+ 'vhdl-speedbar-expand-entity (nth 0 ent-entry) | 14222 | 'bracket ?+ 'vhdl-speedbar-expand-entity (nth 0 ent-entry) |
| 13983 | (nth 1 ent-entry) 'vhdl-speedbar-find-file | 14223 | (nth 1 ent-entry) 'vhdl-speedbar-find-file |
| 13984 | (cons (nth 2 ent-entry) (nth 3 ent-entry)) | 14224 | (cons (nth 2 ent-entry) (nth 3 ent-entry)) |
| 13985 | 'vhdl-speedbar-entity depth) | 14225 | 'vhdl-speedbar-entity-face depth) |
| 13986 | (unless (nth 2 ent-entry) | 14226 | (unless (nth 2 ent-entry) |
| 13987 | (end-of-line 0) (insert "!") (forward-char 1)) | 14227 | (end-of-line 0) (insert "!") (forward-char 1)) |
| 13988 | (unless (member (nth 0 ent-entry) ent-inst-list) | 14228 | (unless (member (nth 0 ent-entry) ent-inst-list) |
| @@ -13996,7 +14236,7 @@ otherwise use cached data." | |||
| 13996 | 'bracket ?+ 'vhdl-speedbar-expand-config (nth 0 conf-entry) | 14236 | 'bracket ?+ 'vhdl-speedbar-expand-config (nth 0 conf-entry) |
| 13997 | (nth 1 conf-entry) 'vhdl-speedbar-find-file | 14237 | (nth 1 conf-entry) 'vhdl-speedbar-find-file |
| 13998 | (cons (nth 2 conf-entry) (nth 3 conf-entry)) | 14238 | (cons (nth 2 conf-entry) (nth 3 conf-entry)) |
| 13999 | 'vhdl-speedbar-configuration depth) | 14239 | 'vhdl-speedbar-configuration-face depth) |
| 14000 | (setq conf-alist (cdr conf-alist))) | 14240 | (setq conf-alist (cdr conf-alist))) |
| 14001 | ;; insert packages | 14241 | ;; insert packages |
| 14002 | (when pack-alist (vhdl-speedbar-make-title-line "Packages:" depth)) | 14242 | (when pack-alist (vhdl-speedbar-make-title-line "Packages:" depth)) |
| @@ -14165,7 +14405,8 @@ otherwise use cached data." | |||
| 14165 | (ent-entry (aget ent-alist token t)) | 14405 | (ent-entry (aget ent-alist token t)) |
| 14166 | (arch-alist (nth 3 ent-entry)) | 14406 | (arch-alist (nth 3 ent-entry)) |
| 14167 | (inst-alist (vhdl-get-instantiations token indent)) | 14407 | (inst-alist (vhdl-get-instantiations token indent)) |
| 14168 | (subpack-alist (nth 4 ent-entry)) | 14408 | (subpack-alist (nth 5 ent-entry)) |
| 14409 | (multiple-arch (> (length arch-alist) 1)) | ||
| 14169 | arch-entry inst-entry) | 14410 | arch-entry inst-entry) |
| 14170 | (if (not (or arch-alist inst-alist subpack-alist)) | 14411 | (if (not (or arch-alist inst-alist subpack-alist)) |
| 14171 | (speedbar-change-expand-button-char ??) | 14412 | (speedbar-change-expand-button-char ??) |
| @@ -14187,7 +14428,10 @@ otherwise use cached data." | |||
| 14187 | (cons token (nth 0 arch-entry)) | 14428 | (cons token (nth 0 arch-entry)) |
| 14188 | (nth 1 arch-entry) 'vhdl-speedbar-find-file | 14429 | (nth 1 arch-entry) 'vhdl-speedbar-find-file |
| 14189 | (cons (nth 2 arch-entry) (nth 3 arch-entry)) | 14430 | (cons (nth 2 arch-entry) (nth 3 arch-entry)) |
| 14190 | 'vhdl-speedbar-architecture (1+ indent)) | 14431 | 'vhdl-speedbar-architecture-face (1+ indent)) |
| 14432 | (when (and multiple-arch | ||
| 14433 | (equal (nth 0 arch-entry) (nth 4 ent-entry))) | ||
| 14434 | (end-of-line 0) (insert " (mra)") (forward-char 1)) | ||
| 14191 | (setq arch-alist (cdr arch-alist))) | 14435 | (setq arch-alist (cdr arch-alist))) |
| 14192 | ;; insert instantiations | 14436 | ;; insert instantiations |
| 14193 | (when inst-alist | 14437 | (when inst-alist |
| @@ -14370,7 +14614,7 @@ otherwise use cached data." | |||
| 14370 | (cons token (nth 0 comp-entry)) | 14614 | (cons token (nth 0 comp-entry)) |
| 14371 | (nth 1 comp-entry) 'vhdl-speedbar-find-file | 14615 | (nth 1 comp-entry) 'vhdl-speedbar-find-file |
| 14372 | (cons (nth 2 comp-entry) (nth 3 comp-entry)) | 14616 | (cons (nth 2 comp-entry) (nth 3 comp-entry)) |
| 14373 | 'vhdl-speedbar-entity (1+ indent)) | 14617 | 'vhdl-speedbar-entity-face (1+ indent)) |
| 14374 | (setq comp-alist (cdr comp-alist))) | 14618 | (setq comp-alist (cdr comp-alist))) |
| 14375 | ;; insert subprograms | 14619 | ;; insert subprograms |
| 14376 | (when func-alist | 14620 | (when func-alist |
| @@ -14420,7 +14664,8 @@ otherwise use cached data." | |||
| 14420 | (setq pack-entry (aget pack-alist pack-key t)) | 14664 | (setq pack-entry (aget pack-alist pack-key t)) |
| 14421 | (vhdl-speedbar-make-subpack-line | 14665 | (vhdl-speedbar-make-subpack-line |
| 14422 | (or (nth 0 pack-entry) pack-key) lib-name | 14666 | (or (nth 0 pack-entry) pack-key) lib-name |
| 14423 | (cons (nth 1 pack-entry) (nth 2 pack-entry)) indent) | 14667 | (cons (nth 1 pack-entry) (nth 2 pack-entry)) |
| 14668 | (cons (nth 6 pack-entry) (nth 7 pack-entry)) indent) | ||
| 14424 | (setq subpack-alist (cdr subpack-alist))))) | 14669 | (setq subpack-alist (cdr subpack-alist))))) |
| 14425 | 14670 | ||
| 14426 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 14671 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -14486,43 +14731,43 @@ NO-POSITION non-nil means do not re-position cursor." | |||
| 14486 | (let* ((file-entry (aget file-alist speedbar-last-selected-file t))) | 14731 | (let* ((file-entry (aget file-alist speedbar-last-selected-file t))) |
| 14487 | (vhdl-speedbar-update-units | 14732 | (vhdl-speedbar-update-units |
| 14488 | "\\[.\\] " (nth 0 file-entry) | 14733 | "\\[.\\] " (nth 0 file-entry) |
| 14489 | speedbar-last-selected-file 'vhdl-speedbar-entity) | 14734 | speedbar-last-selected-file 'vhdl-speedbar-entity-face) |
| 14490 | (vhdl-speedbar-update-units | 14735 | (vhdl-speedbar-update-units |
| 14491 | "{.} " (nth 1 file-entry) | 14736 | "{.} " (nth 1 file-entry) |
| 14492 | speedbar-last-selected-file 'vhdl-speedbar-architecture) | 14737 | speedbar-last-selected-file 'vhdl-speedbar-architecture-face) |
| 14493 | (vhdl-speedbar-update-units | 14738 | (vhdl-speedbar-update-units |
| 14494 | "\\[.\\] " (nth 3 file-entry) | 14739 | "\\[.\\] " (nth 3 file-entry) |
| 14495 | speedbar-last-selected-file 'vhdl-speedbar-configuration) | 14740 | speedbar-last-selected-file 'vhdl-speedbar-configuration-face) |
| 14496 | (vhdl-speedbar-update-units | 14741 | (vhdl-speedbar-update-units |
| 14497 | "[]>] " (nth 4 file-entry) | 14742 | "[]>] " (nth 4 file-entry) |
| 14498 | speedbar-last-selected-file 'vhdl-speedbar-package) | 14743 | speedbar-last-selected-file 'vhdl-speedbar-package-face) |
| 14499 | (vhdl-speedbar-update-units | 14744 | (vhdl-speedbar-update-units |
| 14500 | "\\[.\\].+(" '("body") | 14745 | "\\[.\\].+(" '("body") |
| 14501 | speedbar-last-selected-file 'vhdl-speedbar-package) | 14746 | speedbar-last-selected-file 'vhdl-speedbar-package-face) |
| 14502 | (vhdl-speedbar-update-units | 14747 | (vhdl-speedbar-update-units |
| 14503 | "> " (nth 6 file-entry) | 14748 | "> " (nth 6 file-entry) |
| 14504 | speedbar-last-selected-file 'vhdl-speedbar-instantiation)) | 14749 | speedbar-last-selected-file 'vhdl-speedbar-instantiation-face)) |
| 14505 | ;; highlight current units | 14750 | ;; highlight current units |
| 14506 | (let* ((file-entry (aget file-alist file-name t))) | 14751 | (let* ((file-entry (aget file-alist file-name t))) |
| 14507 | (setq | 14752 | (setq |
| 14508 | pos (vhdl-speedbar-update-units | 14753 | pos (vhdl-speedbar-update-units |
| 14509 | "\\[.\\] " (nth 0 file-entry) | 14754 | "\\[.\\] " (nth 0 file-entry) |
| 14510 | file-name 'vhdl-speedbar-entity-selected pos) | 14755 | file-name 'vhdl-speedbar-entity-selected-face pos) |
| 14511 | pos (vhdl-speedbar-update-units | 14756 | pos (vhdl-speedbar-update-units |
| 14512 | "{.} " (nth 1 file-entry) | 14757 | "{.} " (nth 1 file-entry) |
| 14513 | file-name 'vhdl-speedbar-architecture-selected pos) | 14758 | file-name 'vhdl-speedbar-architecture-selected-face pos) |
| 14514 | pos (vhdl-speedbar-update-units | 14759 | pos (vhdl-speedbar-update-units |
| 14515 | "\\[.\\] " (nth 3 file-entry) | 14760 | "\\[.\\] " (nth 3 file-entry) |
| 14516 | file-name 'vhdl-speedbar-configuration-selected pos) | 14761 | file-name 'vhdl-speedbar-configuration-selected-face pos) |
| 14517 | pos (vhdl-speedbar-update-units | 14762 | pos (vhdl-speedbar-update-units |
| 14518 | "[]>] " (nth 4 file-entry) | 14763 | "[]>] " (nth 4 file-entry) |
| 14519 | file-name 'vhdl-speedbar-package-selected pos) | 14764 | file-name 'vhdl-speedbar-package-selected-face pos) |
| 14520 | pos (vhdl-speedbar-update-units | 14765 | pos (vhdl-speedbar-update-units |
| 14521 | "\\[.\\].+(" '("body") | 14766 | "\\[.\\].+(" '("body") |
| 14522 | file-name 'vhdl-speedbar-package-selected pos) | 14767 | file-name 'vhdl-speedbar-package-selected-face pos) |
| 14523 | pos (vhdl-speedbar-update-units | 14768 | pos (vhdl-speedbar-update-units |
| 14524 | "> " (nth 6 file-entry) | 14769 | "> " (nth 6 file-entry) |
| 14525 | file-name 'vhdl-speedbar-instantiation-selected pos)))))) | 14770 | file-name 'vhdl-speedbar-instantiation-selected-face pos)))))) |
| 14526 | ;; move speedbar so the first highlighted unit is visible | 14771 | ;; move speedbar so the first highlighted unit is visible |
| 14527 | (when (and pos (not no-position)) | 14772 | (when (and pos (not no-position)) |
| 14528 | (goto-char pos) | 14773 | (goto-char pos) |
| @@ -14573,21 +14818,21 @@ NO-POSITION non-nil means do not re-position cursor." | |||
| 14573 | (insert "(top)") | 14818 | (insert "(top)") |
| 14574 | (insert inst-name) | 14819 | (insert inst-name) |
| 14575 | (speedbar-make-button | 14820 | (speedbar-make-button |
| 14576 | start (point) 'vhdl-speedbar-instantiation 'speedbar-highlight-face | 14821 | start (point) 'vhdl-speedbar-instantiation-face 'speedbar-highlight-face |
| 14577 | 'vhdl-speedbar-find-file inst-file-marker)) | 14822 | 'vhdl-speedbar-find-file inst-file-marker)) |
| 14578 | (insert delimiter) | 14823 | (insert delimiter) |
| 14579 | (when ent-name | 14824 | (when ent-name |
| 14580 | (setq start (point)) | 14825 | (setq start (point)) |
| 14581 | (insert ent-name) | 14826 | (insert ent-name) |
| 14582 | (speedbar-make-button | 14827 | (speedbar-make-button |
| 14583 | start (point) 'vhdl-speedbar-entity 'speedbar-highlight-face | 14828 | start (point) 'vhdl-speedbar-entity-face 'speedbar-highlight-face |
| 14584 | 'vhdl-speedbar-find-file ent-file-marker) | 14829 | 'vhdl-speedbar-find-file ent-file-marker) |
| 14585 | (when arch-name | 14830 | (when arch-name |
| 14586 | (insert " (") | 14831 | (insert " (") |
| 14587 | (setq start (point)) | 14832 | (setq start (point)) |
| 14588 | (insert arch-name) | 14833 | (insert arch-name) |
| 14589 | (speedbar-make-button | 14834 | (speedbar-make-button |
| 14590 | start (point) 'vhdl-speedbar-architecture 'speedbar-highlight-face | 14835 | start (point) 'vhdl-speedbar-architecture-face 'speedbar-highlight-face |
| 14591 | 'vhdl-speedbar-find-file arch-file-marker) | 14836 | 'vhdl-speedbar-find-file arch-file-marker) |
| 14592 | (insert ")")) | 14837 | (insert ")")) |
| 14593 | (when conf-name | 14838 | (when conf-name |
| @@ -14595,14 +14840,14 @@ NO-POSITION non-nil means do not re-position cursor." | |||
| 14595 | (setq start (point)) | 14840 | (setq start (point)) |
| 14596 | (insert conf-name) | 14841 | (insert conf-name) |
| 14597 | (speedbar-make-button | 14842 | (speedbar-make-button |
| 14598 | start (point) 'vhdl-speedbar-configuration 'speedbar-highlight-face | 14843 | start (point) 'vhdl-speedbar-configuration-face 'speedbar-highlight-face |
| 14599 | 'vhdl-speedbar-find-file conf-file-marker) | 14844 | 'vhdl-speedbar-find-file conf-file-marker) |
| 14600 | (insert ")"))) | 14845 | (insert ")"))) |
| 14601 | (when (and lib-name (not (equal lib-name (downcase (vhdl-work-library))))) | 14846 | (when (and lib-name (not (equal lib-name (downcase (vhdl-work-library))))) |
| 14602 | (setq start (point)) | 14847 | (setq start (point)) |
| 14603 | (insert " (" lib-name ")") | 14848 | (insert " (" lib-name ")") |
| 14604 | (put-text-property (+ 2 start) (1- (point)) 'face | 14849 | (put-text-property (+ 2 start) (1- (point)) 'face |
| 14605 | 'vhdl-speedbar-library)) | 14850 | 'vhdl-speedbar-library-face)) |
| 14606 | (insert-char ?\n 1) | 14851 | (insert-char ?\n 1) |
| 14607 | (put-text-property visible-start (point) 'invisible nil))) | 14852 | (put-text-property visible-start (point) 'invisible nil))) |
| 14608 | 14853 | ||
| @@ -14626,7 +14871,7 @@ NO-POSITION non-nil means do not re-position cursor." | |||
| 14626 | (setq start (point)) | 14871 | (setq start (point)) |
| 14627 | (insert pack-name) | 14872 | (insert pack-name) |
| 14628 | (speedbar-make-button | 14873 | (speedbar-make-button |
| 14629 | start (point) 'vhdl-speedbar-package 'speedbar-highlight-face | 14874 | start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face |
| 14630 | 'vhdl-speedbar-find-file pack-file-marker) | 14875 | 'vhdl-speedbar-find-file pack-file-marker) |
| 14631 | (unless (car pack-file-marker) | 14876 | (unless (car pack-file-marker) |
| 14632 | (insert "!")) | 14877 | (insert "!")) |
| @@ -14635,14 +14880,14 @@ NO-POSITION non-nil means do not re-position cursor." | |||
| 14635 | (setq start (point)) | 14880 | (setq start (point)) |
| 14636 | (insert "body") | 14881 | (insert "body") |
| 14637 | (speedbar-make-button | 14882 | (speedbar-make-button |
| 14638 | start (point) 'vhdl-speedbar-package 'speedbar-highlight-face | 14883 | start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face |
| 14639 | 'vhdl-speedbar-find-file body-file-marker) | 14884 | 'vhdl-speedbar-find-file body-file-marker) |
| 14640 | (insert ")")) | 14885 | (insert ")")) |
| 14641 | (insert-char ?\n 1) | 14886 | (insert-char ?\n 1) |
| 14642 | (put-text-property visible-start (point) 'invisible nil))) | 14887 | (put-text-property visible-start (point) 'invisible nil))) |
| 14643 | 14888 | ||
| 14644 | (defun vhdl-speedbar-make-subpack-line (pack-name lib-name pack-file-marker | 14889 | (defun vhdl-speedbar-make-subpack-line (pack-name lib-name pack-file-marker |
| 14645 | depth) | 14890 | pack-body-file-marker depth) |
| 14646 | "Insert used package entry." | 14891 | "Insert used package entry." |
| 14647 | (let ((start (point)) | 14892 | (let ((start (point)) |
| 14648 | visible-start) | 14893 | visible-start) |
| @@ -14659,12 +14904,20 @@ NO-POSITION non-nil means do not re-position cursor." | |||
| 14659 | (setq start (point)) | 14904 | (setq start (point)) |
| 14660 | (insert pack-name) | 14905 | (insert pack-name) |
| 14661 | (speedbar-make-button | 14906 | (speedbar-make-button |
| 14662 | start (point) 'vhdl-speedbar-package 'speedbar-highlight-face | 14907 | start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face |
| 14663 | 'vhdl-speedbar-find-file pack-file-marker) | 14908 | 'vhdl-speedbar-find-file pack-file-marker) |
| 14909 | (when (car pack-body-file-marker) | ||
| 14910 | (insert " (") | ||
| 14911 | (setq start (point)) | ||
| 14912 | (insert "body") | ||
| 14913 | (speedbar-make-button | ||
| 14914 | start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face | ||
| 14915 | 'vhdl-speedbar-find-file pack-body-file-marker) | ||
| 14916 | (insert ")")) | ||
| 14664 | (setq start (point)) | 14917 | (setq start (point)) |
| 14665 | (insert " (" lib-name ")") | 14918 | (insert " (" lib-name ")") |
| 14666 | (put-text-property (+ 2 start) (1- (point)) 'face | 14919 | (put-text-property (+ 2 start) (1- (point)) 'face |
| 14667 | 'vhdl-speedbar-library) | 14920 | 'vhdl-speedbar-library-face) |
| 14668 | (insert-char ?\n 1) | 14921 | (insert-char ?\n 1) |
| 14669 | (put-text-property visible-start (point) 'invisible nil))) | 14922 | (put-text-property visible-start (point) 'invisible nil))) |
| 14670 | 14923 | ||
| @@ -14687,14 +14940,14 @@ NO-POSITION non-nil means do not re-position cursor." | |||
| 14687 | (setq start (point)) | 14940 | (setq start (point)) |
| 14688 | (insert func-name) | 14941 | (insert func-name) |
| 14689 | (speedbar-make-button | 14942 | (speedbar-make-button |
| 14690 | start (point) 'vhdl-speedbar-subprogram 'speedbar-highlight-face | 14943 | start (point) 'vhdl-speedbar-subprogram-face 'speedbar-highlight-face |
| 14691 | 'vhdl-speedbar-find-file func-file-marker) | 14944 | 'vhdl-speedbar-find-file func-file-marker) |
| 14692 | (when (car func-body-file-marker) | 14945 | (when (car func-body-file-marker) |
| 14693 | (insert " (") | 14946 | (insert " (") |
| 14694 | (setq start (point)) | 14947 | (setq start (point)) |
| 14695 | (insert "body") | 14948 | (insert "body") |
| 14696 | (speedbar-make-button | 14949 | (speedbar-make-button |
| 14697 | start (point) 'vhdl-speedbar-subprogram 'speedbar-highlight-face | 14950 | start (point) 'vhdl-speedbar-subprogram-face 'speedbar-highlight-face |
| 14698 | 'vhdl-speedbar-find-file func-body-file-marker) | 14951 | 'vhdl-speedbar-find-file func-body-file-marker) |
| 14699 | (insert ")")) | 14952 | (insert ")")) |
| 14700 | (insert-char ?\n 1) | 14953 | (insert-char ?\n 1) |
| @@ -14782,22 +15035,22 @@ NO-POSITION non-nil means do not re-position cursor." | |||
| 14782 | (message | 15035 | (message |
| 14783 | "%s \"%s\" in \"%s\"" | 15036 | "%s \"%s\" in \"%s\"" |
| 14784 | ;; design unit kind | 15037 | ;; design unit kind |
| 14785 | (cond ((or (eq face 'vhdl-speedbar-entity) | 15038 | (cond ((or (eq face 'vhdl-speedbar-entity-face) |
| 14786 | (eq face 'vhdl-speedbar-entity-selected)) | 15039 | (eq face 'vhdl-speedbar-entity-selected-face)) |
| 14787 | (if (equal (match-string 2) ">") "Component" "Entity")) | 15040 | (if (equal (match-string 2) ">") "Component" "Entity")) |
| 14788 | ((or (eq face 'vhdl-speedbar-architecture) | 15041 | ((or (eq face 'vhdl-speedbar-architecture-face) |
| 14789 | (eq face 'vhdl-speedbar-architecture-selected)) | 15042 | (eq face 'vhdl-speedbar-architecture-selected-face)) |
| 14790 | "Architecture") | 15043 | "Architecture") |
| 14791 | ((or (eq face 'vhdl-speedbar-configuration) | 15044 | ((or (eq face 'vhdl-speedbar-configuration-face) |
| 14792 | (eq face 'vhdl-speedbar-configuration-selected)) | 15045 | (eq face 'vhdl-speedbar-configuration-selected-face)) |
| 14793 | "Configuration") | 15046 | "Configuration") |
| 14794 | ((or (eq face 'vhdl-speedbar-package) | 15047 | ((or (eq face 'vhdl-speedbar-package-face) |
| 14795 | (eq face 'vhdl-speedbar-package-selected)) | 15048 | (eq face 'vhdl-speedbar-package-selected-face)) |
| 14796 | "Package") | 15049 | "Package") |
| 14797 | ((or (eq face 'vhdl-speedbar-instantiation) | 15050 | ((or (eq face 'vhdl-speedbar-instantiation-face) |
| 14798 | (eq face 'vhdl-speedbar-instantiation-selected)) | 15051 | (eq face 'vhdl-speedbar-instantiation-selected-face)) |
| 14799 | "Instantiation") | 15052 | "Instantiation") |
| 14800 | ((eq face 'vhdl-speedbar-subprogram) | 15053 | ((eq face 'vhdl-speedbar-subprogram-face) |
| 14801 | "Subprogram") | 15054 | "Subprogram") |
| 14802 | (t "")) | 15055 | (t "")) |
| 14803 | ;; design unit name | 15056 | ;; design unit name |
| @@ -14817,6 +15070,18 @@ NO-POSITION non-nil means do not re-position cursor." | |||
| 14817 | (set-text-properties 0 (length string) nil string) | 15070 | (set-text-properties 0 (length string) nil string) |
| 14818 | string)) | 15071 | string)) |
| 14819 | 15072 | ||
| 15073 | (defun vhdl-speedbar-higher-text () | ||
| 15074 | "Get speedbar-line-text of higher level." | ||
| 15075 | (let (depth string) | ||
| 15076 | (save-excursion | ||
| 15077 | (beginning-of-line) | ||
| 15078 | (looking-at "^\\([0-9]+\\):") | ||
| 15079 | (setq depth (string-to-number (match-string 1))) | ||
| 15080 | (when (re-search-backward (format "^%d: *[[<{][-+?][]>}] \\([^ \n]+\\)" (1- depth)) nil t) | ||
| 15081 | (setq string (match-string 1)) | ||
| 15082 | (set-text-properties 0 (length string) nil string) | ||
| 15083 | string)))) | ||
| 15084 | |||
| 14820 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 15085 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 14821 | ;; Help functions | 15086 | ;; Help functions |
| 14822 | 15087 | ||
| @@ -14941,6 +15206,31 @@ is already shown in a buffer." | |||
| 14941 | (vhdl-compose-place-component) | 15206 | (vhdl-compose-place-component) |
| 14942 | (select-frame speedbar-frame))) | 15207 | (select-frame speedbar-frame))) |
| 14943 | 15208 | ||
| 15209 | (defun vhdl-speedbar-configuration () | ||
| 15210 | "Generate configuration for the architecture under the cursor." | ||
| 15211 | (interactive) | ||
| 15212 | (if (not (vhdl-speedbar-check-unit 'architecture)) | ||
| 15213 | (error "ERROR: No architecture under cursor") | ||
| 15214 | (let ((arch-name (vhdl-speedbar-line-text)) | ||
| 15215 | (ent-name (vhdl-speedbar-higher-text))) | ||
| 15216 | (if (fboundp 'speedbar-select-attached-frame) | ||
| 15217 | (speedbar-select-attached-frame) | ||
| 15218 | (select-frame speedbar-attached-frame)) | ||
| 15219 | (vhdl-compose-configuration ent-name arch-name)))) | ||
| 15220 | |||
| 15221 | (defun vhdl-speedbar-select-mra () | ||
| 15222 | "Select the architecture under the cursor as MRA." | ||
| 15223 | (interactive) | ||
| 15224 | (if (not (vhdl-speedbar-check-unit 'architecture)) | ||
| 15225 | (error "ERROR: No architecture under cursor") | ||
| 15226 | (let* ((arch-key (downcase (vhdl-speedbar-line-text))) | ||
| 15227 | (ent-key (downcase (vhdl-speedbar-higher-text))) | ||
| 15228 | (ent-alist (aget vhdl-entity-alist | ||
| 15229 | (or (vhdl-project-p) default-directory) t)) | ||
| 15230 | (ent-entry (aget ent-alist ent-key t))) | ||
| 15231 | (setcar (cddr (cddr ent-entry)) arch-key) ; (nth 4 ent-entry) | ||
| 15232 | (speedbar-refresh)))) | ||
| 15233 | |||
| 14944 | (defun vhdl-speedbar-make-design () | 15234 | (defun vhdl-speedbar-make-design () |
| 14945 | "Make (compile) design unit or directory/project under the cursor." | 15235 | "Make (compile) design unit or directory/project under the cursor." |
| 14946 | (interactive) | 15236 | (interactive) |
| @@ -14973,11 +15263,15 @@ expansion function)." | |||
| 14973 | (speedbar-position-cursor-on-line) | 15263 | (speedbar-position-cursor-on-line) |
| 14974 | (cond ((eq design-unit 'entity) | 15264 | (cond ((eq design-unit 'entity) |
| 14975 | (memq (get-text-property (match-end 0) 'face) | 15265 | (memq (get-text-property (match-end 0) 'face) |
| 14976 | '(vhdl-speedbar-entity | 15266 | '(vhdl-speedbar-entity-face |
| 14977 | vhdl-speedbar-entity-selected))) | 15267 | vhdl-speedbar-entity-selected-face))) |
| 15268 | ((eq design-unit 'architecture) | ||
| 15269 | (memq (get-text-property (match-end 0) 'face) | ||
| 15270 | '(vhdl-speedbar-architecture-face | ||
| 15271 | vhdl-speedbar-architecture-selected-face))) | ||
| 14978 | ((eq design-unit 'subprogram) | 15272 | ((eq design-unit 'subprogram) |
| 14979 | (eq (get-text-property (match-end 0) 'face) | 15273 | (eq (get-text-property (match-end 0) 'face) |
| 14980 | 'vhdl-speedbar-subprogram)) | 15274 | 'vhdl-speedbar-subprogram-face)) |
| 14981 | (t nil)))) | 15275 | (t nil)))) |
| 14982 | 15276 | ||
| 14983 | (defun vhdl-speedbar-set-depth (depth) | 15277 | (defun vhdl-speedbar-set-depth (depth) |
| @@ -14988,106 +15282,80 @@ expansion function)." | |||
| 14988 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 15282 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 14989 | ;; Fontification | 15283 | ;; Fontification |
| 14990 | 15284 | ||
| 14991 | (defface vhdl-speedbar-entity | 15285 | (defface vhdl-speedbar-entity-face |
| 14992 | '((((class color) (background light)) (:foreground "ForestGreen")) | 15286 | '((((class color) (background light)) (:foreground "ForestGreen")) |
| 14993 | (((class color) (background dark)) (:foreground "PaleGreen"))) | 15287 | (((class color) (background dark)) (:foreground "PaleGreen"))) |
| 14994 | "Face used for displaying entity names." | 15288 | "Face used for displaying entity names." |
| 14995 | :group 'speedbar-faces) | 15289 | :group 'speedbar-faces) |
| 14996 | ;; backward-compatibility alias | ||
| 14997 | (put 'vhdl-speedbar-entity-face 'face-alias 'vhdl-speedbar-entity) | ||
| 14998 | 15290 | ||
| 14999 | (defface vhdl-speedbar-architecture | 15291 | (defface vhdl-speedbar-architecture-face |
| 15000 | '((((min-colors 88) (class color) (background light)) (:foreground "Blue1")) | 15292 | '((((class color) (background light)) (:foreground "Blue")) |
| 15001 | (((class color) (background light)) (:foreground "Blue")) | 15293 | (((min-colors 88) (class color) (background light)) (:foreground "Blue1")) |
| 15002 | (((class color) (background dark)) (:foreground "LightSkyBlue"))) | 15294 | (((class color) (background dark)) (:foreground "LightSkyBlue"))) |
| 15003 | "Face used for displaying architecture names." | 15295 | "Face used for displaying architecture names." |
| 15004 | :group 'speedbar-faces) | 15296 | :group 'speedbar-faces) |
| 15005 | ;; backward-compatibility alias | ||
| 15006 | (put 'vhdl-speedbar-architecture-face 'face-alias 'vhdl-speedbar-architecture) | ||
| 15007 | 15297 | ||
| 15008 | (defface vhdl-speedbar-configuration | 15298 | (defface vhdl-speedbar-configuration-face |
| 15009 | '((((class color) (background light)) (:foreground "DarkGoldenrod")) | 15299 | '((((class color) (background light)) (:foreground "DarkGoldenrod")) |
| 15010 | (((class color) (background dark)) (:foreground "Salmon"))) | 15300 | (((class color) (background dark)) (:foreground "Salmon"))) |
| 15011 | "Face used for displaying configuration names." | 15301 | "Face used for displaying configuration names." |
| 15012 | :group 'speedbar-faces) | 15302 | :group 'speedbar-faces) |
| 15013 | ;; backward-compatibility alias | ||
| 15014 | (put 'vhdl-speedbar-configuration-face 'face-alias 'vhdl-speedbar-configuration) | ||
| 15015 | 15303 | ||
| 15016 | (defface vhdl-speedbar-package | 15304 | (defface vhdl-speedbar-package-face |
| 15017 | '((((class color) (background light)) (:foreground "Grey50")) | 15305 | '((((class color) (background light)) (:foreground "Grey50")) |
| 15018 | (((class color) (background dark)) (:foreground "Grey80"))) | 15306 | (((class color) (background dark)) (:foreground "Grey80"))) |
| 15019 | "Face used for displaying package names." | 15307 | "Face used for displaying package names." |
| 15020 | :group 'speedbar-faces) | 15308 | :group 'speedbar-faces) |
| 15021 | ;; backward-compatibility alias | ||
| 15022 | (put 'vhdl-speedbar-package-face 'face-alias 'vhdl-speedbar-package) | ||
| 15023 | 15309 | ||
| 15024 | (defface vhdl-speedbar-library | 15310 | (defface vhdl-speedbar-library-face |
| 15025 | '((((class color) (background light)) (:foreground "Purple")) | 15311 | '((((class color) (background light)) (:foreground "Purple")) |
| 15026 | (((class color) (background dark)) (:foreground "Orchid1"))) | 15312 | (((class color) (background dark)) (:foreground "Orchid1"))) |
| 15027 | "Face used for displaying library names." | 15313 | "Face used for displaying library names." |
| 15028 | :group 'speedbar-faces) | 15314 | :group 'speedbar-faces) |
| 15029 | ;; backward-compatibility alias | ||
| 15030 | (put 'vhdl-speedbar-library-face 'face-alias 'vhdl-speedbar-library) | ||
| 15031 | 15315 | ||
| 15032 | (defface vhdl-speedbar-instantiation | 15316 | (defface vhdl-speedbar-instantiation-face |
| 15033 | '((((class color) (background light)) (:foreground "Brown")) | 15317 | '((((class color) (background light)) (:foreground "Brown")) |
| 15034 | (((min-colors 88) (class color) (background dark)) (:foreground "Yellow1")) | 15318 | (((min-colors 88) (class color) (background dark)) (:foreground "Yellow1")) |
| 15035 | (((class color) (background dark)) (:foreground "Yellow"))) | 15319 | (((class color) (background dark)) (:foreground "Yellow"))) |
| 15036 | "Face used for displaying instantiation names." | 15320 | "Face used for displaying instantiation names." |
| 15037 | :group 'speedbar-faces) | 15321 | :group 'speedbar-faces) |
| 15038 | ;; backward-compatibility alias | ||
| 15039 | (put 'vhdl-speedbar-instantiation-face 'face-alias 'vhdl-speedbar-instantiation) | ||
| 15040 | 15322 | ||
| 15041 | (defface vhdl-speedbar-subprogram | 15323 | (defface vhdl-speedbar-subprogram-face |
| 15042 | '((((class color) (background light)) (:foreground "Orchid4")) | 15324 | '((((class color) (background light)) (:foreground "Orchid4")) |
| 15043 | (((class color) (background dark)) (:foreground "BurlyWood2"))) | 15325 | (((class color) (background dark)) (:foreground "BurlyWood2"))) |
| 15044 | "Face used for displaying subprogram names." | 15326 | "Face used for displaying subprogram names." |
| 15045 | :group 'speedbar-faces) | 15327 | :group 'speedbar-faces) |
| 15046 | ;; backward-compatibility alias | ||
| 15047 | (put 'vhdl-speedbar-subprogram-face 'face-alias 'vhdl-speedbar-subprogram) | ||
| 15048 | 15328 | ||
| 15049 | (defface vhdl-speedbar-entity-selected | 15329 | (defface vhdl-speedbar-entity-selected-face |
| 15050 | '((((class color) (background light)) (:foreground "ForestGreen" :underline t)) | 15330 | '((((class color) (background light)) (:foreground "ForestGreen" :underline t)) |
| 15051 | (((class color) (background dark)) (:foreground "PaleGreen" :underline t))) | 15331 | (((class color) (background dark)) (:foreground "PaleGreen" :underline t))) |
| 15052 | "Face used for displaying entity names." | 15332 | "Face used for displaying entity names." |
| 15053 | :group 'speedbar-faces) | 15333 | :group 'speedbar-faces) |
| 15054 | ;; backward-compatibility alias | ||
| 15055 | (put 'vhdl-speedbar-entity-selected-face 'face-alias 'vhdl-speedbar-entity-selected) | ||
| 15056 | 15334 | ||
| 15057 | (defface vhdl-speedbar-architecture-selected | 15335 | (defface vhdl-speedbar-architecture-selected-face |
| 15058 | '((((min-colors 88) (class color) (background light)) (:foreground "Blue1" :underline t)) | 15336 | '((((class color) (background light)) (:foreground "Blue" :underline t)) |
| 15059 | (((min-colors 88) (class color) (background light)) (:foreground "Blue1" :underline t)) | 15337 | (((min-colors 88) (class color) (background light)) (:foreground "Blue1" :underline t)) |
| 15060 | (((class color) (background light)) (:foreground "Blue" :underline t)) | ||
| 15061 | (((class color) (background dark)) (:foreground "LightSkyBlue" :underline t))) | 15338 | (((class color) (background dark)) (:foreground "LightSkyBlue" :underline t))) |
| 15062 | "Face used for displaying architecture names." | 15339 | "Face used for displaying architecture names." |
| 15063 | :group 'speedbar-faces) | 15340 | :group 'speedbar-faces) |
| 15064 | ;; backward-compatibility alias | ||
| 15065 | (put 'vhdl-speedbar-architecture-selected-face 'face-alias 'vhdl-speedbar-architecture-selected) | ||
| 15066 | 15341 | ||
| 15067 | (defface vhdl-speedbar-configuration-selected | 15342 | (defface vhdl-speedbar-configuration-selected-face |
| 15068 | '((((class color) (background light)) (:foreground "DarkGoldenrod" :underline t)) | 15343 | '((((class color) (background light)) (:foreground "DarkGoldenrod" :underline t)) |
| 15069 | (((class color) (background dark)) (:foreground "Salmon" :underline t))) | 15344 | (((class color) (background dark)) (:foreground "Salmon" :underline t))) |
| 15070 | "Face used for displaying configuration names." | 15345 | "Face used for displaying configuration names." |
| 15071 | :group 'speedbar-faces) | 15346 | :group 'speedbar-faces) |
| 15072 | ;; backward-compatibility alias | ||
| 15073 | (put 'vhdl-speedbar-configuration-selected-face 'face-alias 'vhdl-speedbar-configuration-selected) | ||
| 15074 | 15347 | ||
| 15075 | (defface vhdl-speedbar-package-selected | 15348 | (defface vhdl-speedbar-package-selected-face |
| 15076 | '((((class color) (background light)) (:foreground "Grey50" :underline t)) | 15349 | '((((class color) (background light)) (:foreground "Grey50" :underline t)) |
| 15077 | (((class color) (background dark)) (:foreground "Grey80" :underline t))) | 15350 | (((class color) (background dark)) (:foreground "Grey80" :underline t))) |
| 15078 | "Face used for displaying package names." | 15351 | "Face used for displaying package names." |
| 15079 | :group 'speedbar-faces) | 15352 | :group 'speedbar-faces) |
| 15080 | ;; backward-compatibility alias | ||
| 15081 | (put 'vhdl-speedbar-package-selected-face 'face-alias 'vhdl-speedbar-package-selected) | ||
| 15082 | 15353 | ||
| 15083 | (defface vhdl-speedbar-instantiation-selected | 15354 | (defface vhdl-speedbar-instantiation-selected-face |
| 15084 | '((((class color) (background light)) (:foreground "Brown" :underline t)) | 15355 | '((((class color) (background light)) (:foreground "Brown" :underline t)) |
| 15085 | (((min-colors 88) (class color) (background dark)) (:foreground "Yellow1" :underline t)) | ||
| 15086 | (((class color) (background dark)) (:foreground "Yellow" :underline t))) | 15356 | (((class color) (background dark)) (:foreground "Yellow" :underline t))) |
| 15087 | "Face used for displaying instantiation names." | 15357 | "Face used for displaying instantiation names." |
| 15088 | :group 'speedbar-faces) | 15358 | :group 'speedbar-faces) |
| 15089 | ;; backward-compatibility alias | ||
| 15090 | (put 'vhdl-speedbar-instantiation-selected-face 'face-alias 'vhdl-speedbar-instantiation-selected) | ||
| 15091 | 15359 | ||
| 15092 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 15360 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 15093 | ;; Initialization | 15361 | ;; Initialization |
| @@ -15139,7 +15407,7 @@ expansion function)." | |||
| 15139 | ;; open entity file | 15407 | ;; open entity file |
| 15140 | (unless (eq vhdl-compose-create-files 'none) | 15408 | (unless (eq vhdl-compose-create-files 'none) |
| 15141 | (setq ent-file-name | 15409 | (setq ent-file-name |
| 15142 | (concat (vhdl-replace-string vhdl-entity-file-name ent-name) | 15410 | (concat (vhdl-replace-string vhdl-entity-file-name ent-name t) |
| 15143 | "." (file-name-extension (buffer-file-name)))) | 15411 | "." (file-name-extension (buffer-file-name)))) |
| 15144 | (when (and (file-exists-p ent-file-name) | 15412 | (when (and (file-exists-p ent-file-name) |
| 15145 | (not (y-or-n-p (concat "File \"" ent-file-name | 15413 | (not (y-or-n-p (concat "File \"" ent-file-name |
| @@ -15180,7 +15448,7 @@ expansion function)." | |||
| 15180 | (setq ent-buffer (current-buffer)) | 15448 | (setq ent-buffer (current-buffer)) |
| 15181 | (setq arch-file-name | 15449 | (setq arch-file-name |
| 15182 | (concat (vhdl-replace-string vhdl-architecture-file-name | 15450 | (concat (vhdl-replace-string vhdl-architecture-file-name |
| 15183 | (concat ent-name " " arch-name)) | 15451 | (concat ent-name " " arch-name) t) |
| 15184 | "." (file-name-extension (buffer-file-name)))) | 15452 | "." (file-name-extension (buffer-file-name)))) |
| 15185 | (when (and (file-exists-p arch-file-name) | 15453 | (when (and (file-exists-p arch-file-name) |
| 15186 | (not (y-or-n-p (concat "File \"" arch-file-name | 15454 | (not (y-or-n-p (concat "File \"" arch-file-name |
| @@ -15217,7 +15485,7 @@ expansion function)." | |||
| 15217 | (vhdl-insert-keyword "END ") | 15485 | (vhdl-insert-keyword "END ") |
| 15218 | (unless (vhdl-standard-p '87) (vhdl-insert-keyword "ARCHITECTURE ")) | 15486 | (unless (vhdl-standard-p '87) (vhdl-insert-keyword "ARCHITECTURE ")) |
| 15219 | (insert arch-name ";\n\n") | 15487 | (insert arch-name ";\n\n") |
| 15220 | ;; insert footer | 15488 | ;; insert footer and save |
| 15221 | (if (and vhdl-compose-include-header (not (equal vhdl-file-footer ""))) | 15489 | (if (and vhdl-compose-include-header (not (equal vhdl-file-footer ""))) |
| 15222 | (vhdl-template-footer) | 15490 | (vhdl-template-footer) |
| 15223 | (vhdl-comment-display-line) (insert "\n")) | 15491 | (vhdl-comment-display-line) (insert "\n")) |
| @@ -15245,7 +15513,7 @@ component instantiation." | |||
| 15245 | (error "ERROR: No architecture found")) | 15513 | (error "ERROR: No architecture found")) |
| 15246 | (let* ((ent-name (match-string 1)) | 15514 | (let* ((ent-name (match-string 1)) |
| 15247 | (ent-file-name | 15515 | (ent-file-name |
| 15248 | (concat (vhdl-replace-string vhdl-entity-file-name ent-name) | 15516 | (concat (vhdl-replace-string vhdl-entity-file-name ent-name t) |
| 15249 | "." (file-name-extension (buffer-file-name)))) | 15517 | "." (file-name-extension (buffer-file-name)))) |
| 15250 | (orig-buffer (current-buffer))) | 15518 | (orig-buffer (current-buffer))) |
| 15251 | (message "Placing component \"%s\"..." (nth 0 vhdl-port-list)) | 15519 | (message "Placing component \"%s\"..." (nth 0 vhdl-port-list)) |
| @@ -15297,14 +15565,14 @@ component instantiation." | |||
| 15297 | (error "ERROR: No architecture found")) | 15565 | (error "ERROR: No architecture found")) |
| 15298 | (let* ((ent-name (match-string 1)) | 15566 | (let* ((ent-name (match-string 1)) |
| 15299 | (ent-file-name | 15567 | (ent-file-name |
| 15300 | (concat (vhdl-replace-string vhdl-entity-file-name ent-name) | 15568 | (concat (vhdl-replace-string vhdl-entity-file-name ent-name t) |
| 15301 | "." (file-name-extension (buffer-file-name)))) | 15569 | "." (file-name-extension (buffer-file-name)))) |
| 15302 | (arch-decl-pos (point-marker)) | 15570 | (arch-decl-pos (point-marker)) |
| 15303 | (arch-stat-pos (re-search-forward "^begin\\>" nil)) | 15571 | (arch-stat-pos (re-search-forward "^begin\\>" nil)) |
| 15304 | (arch-end-pos (re-search-forward "^end\\>" nil)) | 15572 | (arch-end-pos (re-search-forward "^end\\>" nil)) |
| 15305 | (pack-name (vhdl-get-components-package-name)) | 15573 | (pack-name (vhdl-get-components-package-name)) |
| 15306 | (pack-file-name | 15574 | (pack-file-name |
| 15307 | (concat (vhdl-replace-string vhdl-package-file-name pack-name) | 15575 | (concat (vhdl-replace-string vhdl-package-file-name pack-name t) |
| 15308 | "." (file-name-extension (buffer-file-name)))) | 15576 | "." (file-name-extension (buffer-file-name)))) |
| 15309 | inst-name comp-name comp-ent-name comp-ent-file-name has-generic | 15577 | inst-name comp-name comp-ent-name comp-ent-file-name has-generic |
| 15310 | port-alist generic-alist inst-alist | 15578 | port-alist generic-alist inst-alist |
| @@ -15340,7 +15608,7 @@ component instantiation." | |||
| 15340 | (vhdl-port-copy))) | 15608 | (vhdl-port-copy))) |
| 15341 | ;; ... from entity declaration (direct instantiation) | 15609 | ;; ... from entity declaration (direct instantiation) |
| 15342 | (setq comp-ent-file-name | 15610 | (setq comp-ent-file-name |
| 15343 | (concat (vhdl-replace-string vhdl-entity-file-name comp-ent-name) | 15611 | (concat (vhdl-replace-string vhdl-entity-file-name comp-ent-name t) |
| 15344 | "." (file-name-extension (buffer-file-name)))) | 15612 | "." (file-name-extension (buffer-file-name)))) |
| 15345 | (vhdl-visit-file | 15613 | (vhdl-visit-file |
| 15346 | comp-ent-file-name t | 15614 | comp-ent-file-name t |
| @@ -15351,7 +15619,8 @@ component instantiation." | |||
| 15351 | (vhdl-port-copy)))) | 15619 | (vhdl-port-copy)))) |
| 15352 | (vhdl-port-flatten t) | 15620 | (vhdl-port-flatten t) |
| 15353 | (setq generic-alist (nth 1 vhdl-port-list) | 15621 | (setq generic-alist (nth 1 vhdl-port-list) |
| 15354 | port-alist (nth 2 vhdl-port-list)) | 15622 | port-alist (nth 2 vhdl-port-list) |
| 15623 | vhdl-port-list nil) | ||
| 15355 | (setq constant-alist nil | 15624 | (setq constant-alist nil |
| 15356 | signal-alist nil) | 15625 | signal-alist nil) |
| 15357 | (when has-generic | 15626 | (when has-generic |
| @@ -15620,7 +15889,7 @@ current project/directory." | |||
| 15620 | (let* ((project (vhdl-project-p)) | 15889 | (let* ((project (vhdl-project-p)) |
| 15621 | (pack-name (vhdl-get-components-package-name)) | 15890 | (pack-name (vhdl-get-components-package-name)) |
| 15622 | (pack-file-name | 15891 | (pack-file-name |
| 15623 | (concat (vhdl-replace-string vhdl-package-file-name pack-name) | 15892 | (concat (vhdl-replace-string vhdl-package-file-name pack-name t) |
| 15624 | "." (file-name-extension (buffer-file-name)))) | 15893 | "." (file-name-extension (buffer-file-name)))) |
| 15625 | (ent-alist (aget vhdl-entity-alist | 15894 | (ent-alist (aget vhdl-entity-alist |
| 15626 | (or project default-directory) t)) | 15895 | (or project default-directory) t)) |
| @@ -15679,6 +15948,178 @@ current project/directory." | |||
| 15679 | (message "Generating components package \"%s\"...done\n File created: \"%s\"" | 15948 | (message "Generating components package \"%s\"...done\n File created: \"%s\"" |
| 15680 | pack-name pack-file-name))) | 15949 | pack-name pack-file-name))) |
| 15681 | 15950 | ||
| 15951 | (defun vhdl-compose-configuration-architecture (ent-name arch-name inst-alist | ||
| 15952 | &optional insert-conf) | ||
| 15953 | "Generate block configuration for architecture." | ||
| 15954 | (let ((margin (current-indentation)) | ||
| 15955 | (beg (save-excursion (beginning-of-line) (point))) | ||
| 15956 | ent-entry inst-entry inst-path inst-prev-path cons-key tmp-alist) | ||
| 15957 | ;; insert block configuration (for architecture) | ||
| 15958 | (vhdl-insert-keyword "FOR ") (insert arch-name "\n") | ||
| 15959 | (setq margin (+ margin vhdl-basic-offset)) | ||
| 15960 | ;; process all instances | ||
| 15961 | (while inst-alist | ||
| 15962 | (setq inst-entry (car inst-alist)) | ||
| 15963 | ;; is component? | ||
| 15964 | (when (nth 4 inst-entry) | ||
| 15965 | (setq insert-conf t) | ||
| 15966 | (setq inst-path (nth 9 inst-entry)) | ||
| 15967 | ;; skip common path with previous instance | ||
| 15968 | (while (and inst-path (equal (car inst-path) (car inst-prev-path))) | ||
| 15969 | (setq inst-path (cdr inst-path) | ||
| 15970 | inst-prev-path (cdr inst-prev-path))) | ||
| 15971 | ;; insert block configuration end (for previous block/generate) | ||
| 15972 | (while inst-prev-path | ||
| 15973 | (setq margin (- margin vhdl-basic-offset)) | ||
| 15974 | (indent-to margin) | ||
| 15975 | (vhdl-insert-keyword "END FOR;\n") | ||
| 15976 | (setq inst-prev-path (cdr inst-prev-path))) | ||
| 15977 | ;; insert block configuration beginning (for current block/generate) | ||
| 15978 | (indent-to margin) | ||
| 15979 | (while inst-path | ||
| 15980 | (setq margin (+ margin vhdl-basic-offset)) | ||
| 15981 | (vhdl-insert-keyword "FOR ") | ||
| 15982 | (insert (car inst-path) "\n") | ||
| 15983 | (indent-to margin) | ||
| 15984 | (setq inst-path (cdr inst-path))) | ||
| 15985 | ;; insert component configuration beginning | ||
| 15986 | (vhdl-insert-keyword "FOR ") | ||
| 15987 | (insert (nth 1 inst-entry) " : " (nth 4 inst-entry) "\n") | ||
| 15988 | ;; find subconfiguration | ||
| 15989 | (setq conf-key (nth 7 inst-entry)) | ||
| 15990 | (setq tmp-alist conf-alist) | ||
| 15991 | ;; use first configuration found for instance's entity | ||
| 15992 | (while (and tmp-alist (null conf-key)) | ||
| 15993 | (when (equal (nth 5 inst-entry) (nth 4 (car tmp-alist))) | ||
| 15994 | (setq conf-key (nth 0 (car tmp-alist)))) | ||
| 15995 | (setq tmp-alist (cdr tmp-alist))) | ||
| 15996 | (setq conf-entry (aget conf-alist conf-key t)) | ||
| 15997 | ;; insert binding indication ... | ||
| 15998 | ;; ... with subconfiguration (if exists) | ||
| 15999 | (if (and vhdl-compose-configuration-use-subconfiguration conf-entry) | ||
| 16000 | (progn | ||
| 16001 | (indent-to (+ margin vhdl-basic-offset)) | ||
| 16002 | (vhdl-insert-keyword "USE CONFIGURATION ") | ||
| 16003 | (insert (vhdl-work-library) "." (nth 0 conf-entry)) | ||
| 16004 | (insert ";\n")) | ||
| 16005 | ;; ... with entity (if exists) | ||
| 16006 | (setq ent-entry (aget ent-alist (nth 5 inst-entry) t)) | ||
| 16007 | (when ent-entry | ||
| 16008 | (indent-to (+ margin vhdl-basic-offset)) | ||
| 16009 | (vhdl-insert-keyword "USE ENTITY ") | ||
| 16010 | (insert (vhdl-work-library) "." (nth 0 ent-entry)) | ||
| 16011 | ;; insert architecture name (if architecture exists) | ||
| 16012 | (when (nth 3 ent-entry) | ||
| 16013 | (setq arch-name | ||
| 16014 | ;; choose architecture name a) from configuration, | ||
| 16015 | ;; b) from mra, or c) from first architecture | ||
| 16016 | (or (nth 0 (aget (nth 3 ent-entry) | ||
| 16017 | (or (nth 6 inst-entry) | ||
| 16018 | (nth 4 ent-entry)) t)) | ||
| 16019 | (nth 1 (car (nth 3 ent-entry))))) | ||
| 16020 | (insert "(" arch-name ")")) | ||
| 16021 | (insert ";\n") | ||
| 16022 | ;; insert block configuration (for architecture of subcomponent) | ||
| 16023 | (when (and vhdl-compose-configuration-hierarchical | ||
| 16024 | (nth 3 ent-entry)) | ||
| 16025 | (indent-to (+ margin vhdl-basic-offset)) | ||
| 16026 | (vhdl-compose-configuration-architecture | ||
| 16027 | (nth 0 ent-entry) arch-name | ||
| 16028 | (nth 3 (aget (nth 3 ent-entry) (downcase arch-name) t)))))) | ||
| 16029 | ;; insert component configuration end | ||
| 16030 | (indent-to margin) | ||
| 16031 | (vhdl-insert-keyword "END FOR;\n") | ||
| 16032 | (setq inst-prev-path (nth 9 inst-entry))) | ||
| 16033 | (setq inst-alist (cdr inst-alist))) | ||
| 16034 | ;; insert block configuration end (for block/generate) | ||
| 16035 | (while inst-prev-path | ||
| 16036 | (setq margin (- margin vhdl-basic-offset)) | ||
| 16037 | (indent-to margin) | ||
| 16038 | (vhdl-insert-keyword "END FOR;\n") | ||
| 16039 | (setq inst-prev-path (cdr inst-prev-path))) | ||
| 16040 | (indent-to (- margin vhdl-basic-offset)) | ||
| 16041 | ;; insert block configuration end or remove beginning (for architecture) | ||
| 16042 | (if insert-conf | ||
| 16043 | (vhdl-insert-keyword "END FOR;\n") | ||
| 16044 | (delete-region beg (point))))) | ||
| 16045 | |||
| 16046 | (defun vhdl-compose-configuration (&optional ent-name arch-name) | ||
| 16047 | "Generate configuration declaration." | ||
| 16048 | (interactive) | ||
| 16049 | (vhdl-require-hierarchy-info) | ||
| 16050 | (let ((ent-alist (aget vhdl-entity-alist | ||
| 16051 | (or (vhdl-project-p) default-directory) t)) | ||
| 16052 | (conf-alist (aget vhdl-config-alist | ||
| 16053 | (or (vhdl-project-p) default-directory) t)) | ||
| 16054 | (from-speedbar ent-name) | ||
| 16055 | inst-alist conf-name conf-file-name pos) | ||
| 16056 | (vhdl-prepare-search-2 | ||
| 16057 | ;; get entity and architecture name | ||
| 16058 | (unless ent-name | ||
| 16059 | (save-excursion | ||
| 16060 | (unless (and (re-search-backward "^\\(architecture\\s-+\\(\\w+\\)\\s-+of\\s-+\\(\\w+\\)\\|end\\)\\>" nil t) | ||
| 16061 | (not (equal "END" (upcase (match-string 1)))) | ||
| 16062 | (setq ent-name (match-string-no-properties 3)) | ||
| 16063 | (setq arch-name (match-string-no-properties 2))) | ||
| 16064 | (error "ERROR: Not within an architecture")))) | ||
| 16065 | (setq conf-name (vhdl-replace-string | ||
| 16066 | vhdl-compose-configuration-name | ||
| 16067 | (concat ent-name " " arch-name))) | ||
| 16068 | (setq inst-alist | ||
| 16069 | (nth 3 (aget (nth 3 (aget ent-alist (downcase ent-name) t)) | ||
| 16070 | (downcase arch-name) t)))) | ||
| 16071 | (message "Generating configuration \"%s\"..." conf-name) | ||
| 16072 | (if vhdl-compose-configuration-create-file | ||
| 16073 | ;; open configuration file | ||
| 16074 | (progn | ||
| 16075 | (setq conf-file-name | ||
| 16076 | (concat (vhdl-replace-string vhdl-configuration-file-name | ||
| 16077 | conf-name t) | ||
| 16078 | "." (file-name-extension (buffer-file-name)))) | ||
| 16079 | (when (and (file-exists-p conf-file-name) | ||
| 16080 | (not (y-or-n-p (concat "File \"" conf-file-name | ||
| 16081 | "\" exists; overwrite? ")))) | ||
| 16082 | (error "ERROR: Creating configuration...aborted")) | ||
| 16083 | (find-file conf-file-name) | ||
| 16084 | (erase-buffer) | ||
| 16085 | (set-buffer-modified-p nil) | ||
| 16086 | ;; insert header | ||
| 16087 | (if vhdl-compose-include-header | ||
| 16088 | (progn (vhdl-template-header | ||
| 16089 | (concat "Configuration declaration for design \"" | ||
| 16090 | ent-name "(" arch-name ")\"")) | ||
| 16091 | (goto-char (point-max))) | ||
| 16092 | (vhdl-comment-display-line) (insert "\n\n"))) | ||
| 16093 | ;; goto end of architecture | ||
| 16094 | (unless from-speedbar | ||
| 16095 | (re-search-forward "^end\\>" nil) | ||
| 16096 | (end-of-line) (insert "\n\n") | ||
| 16097 | (vhdl-comment-display-line) (insert "\n\n"))) | ||
| 16098 | ;; insert library clause | ||
| 16099 | (setq pos (point)) | ||
| 16100 | (vhdl-template-standard-package (vhdl-work-library) nil) | ||
| 16101 | (when (/= pos (point)) | ||
| 16102 | (insert "\n\n")) | ||
| 16103 | ;; insert configuration | ||
| 16104 | (vhdl-insert-keyword "CONFIGURATION ") (insert conf-name) | ||
| 16105 | (vhdl-insert-keyword " OF ") (insert ent-name) | ||
| 16106 | (vhdl-insert-keyword " IS\n") | ||
| 16107 | (indent-to vhdl-basic-offset) | ||
| 16108 | ;; insert block configuration (for architecture) | ||
| 16109 | (vhdl-compose-configuration-architecture ent-name arch-name inst-alist t) | ||
| 16110 | (vhdl-insert-keyword "END ") (insert conf-name ";") | ||
| 16111 | (when conf-file-name | ||
| 16112 | ;; insert footer and save | ||
| 16113 | (insert "\n\n") | ||
| 16114 | (if (and vhdl-compose-include-header (not (equal vhdl-file-footer ""))) | ||
| 16115 | (vhdl-template-footer) | ||
| 16116 | (vhdl-comment-display-line) (insert "\n")) | ||
| 16117 | (save-buffer)) | ||
| 16118 | (message | ||
| 16119 | (concat (format "Generating configuration \"%s\"...done" conf-name) | ||
| 16120 | (and conf-file-name | ||
| 16121 | (format "\n File created: \"%s\"" conf-file-name)))))) | ||
| 16122 | |||
| 15682 | 16123 | ||
| 15683 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 16124 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 15684 | ;;; Compilation / Makefile generation | 16125 | ;;; Compilation / Makefile generation |
| @@ -15859,11 +16300,17 @@ do not print any file names." | |||
| 15859 | (compile (concat command " " options " " file-name))) | 16300 | (compile (concat command " " options " " file-name))) |
| 15860 | (vhdl-warning "Your project settings tell me not to compile this file")))) | 16301 | (vhdl-warning "Your project settings tell me not to compile this file")))) |
| 15861 | 16302 | ||
| 16303 | (defvar vhdl-make-target "all" | ||
| 16304 | "Default target for `vhdl-make' command.") | ||
| 16305 | |||
| 15862 | (defun vhdl-make (&optional target) | 16306 | (defun vhdl-make (&optional target) |
| 15863 | "Call make command for compilation of all updated source files (requires | 16307 | "Call make command for compilation of all updated source files (requires |
| 15864 | `Makefile'). Optional argument TARGET allows to compile the design | 16308 | `Makefile'). Optional argument TARGET allows to compile the design |
| 15865 | specified by a target." | 16309 | specified by a target." |
| 15866 | (interactive) | 16310 | (interactive) |
| 16311 | (setq vhdl-make-target | ||
| 16312 | (or target (read-from-minibuffer "Target: " vhdl-make-target | ||
| 16313 | vhdl-minibuffer-local-map))) | ||
| 15867 | (vhdl-compile-init) | 16314 | (vhdl-compile-init) |
| 15868 | (let* ((project (aget vhdl-project-alist vhdl-project)) | 16315 | (let* ((project (aget vhdl-project-alist vhdl-project)) |
| 15869 | (compiler (or (aget vhdl-compiler-alist vhdl-compiler) | 16316 | (compiler (or (aget vhdl-compiler-alist vhdl-compiler) |
| @@ -15875,7 +16322,7 @@ specified by a target." | |||
| 15875 | (error "ERROR: Compile directory does not exist: \"%s\"" default-directory)) | 16322 | (error "ERROR: Compile directory does not exist: \"%s\"" default-directory)) |
| 15876 | ;; run make | 16323 | ;; run make |
| 15877 | (compile (concat (if (equal command "") "make" command) | 16324 | (compile (concat (if (equal command "") "make" command) |
| 15878 | " " options " " target)))) | 16325 | " " options " " vhdl-make-target)))) |
| 15879 | 16326 | ||
| 15880 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 16327 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 15881 | ;; Makefile generation | 16328 | ;; Makefile generation |
| @@ -15954,7 +16401,7 @@ specified by a target." | |||
| 15954 | (setq ent-file-name (file-relative-name | 16401 | (setq ent-file-name (file-relative-name |
| 15955 | (nth 2 ent-entry) compile-directory) | 16402 | (nth 2 ent-entry) compile-directory) |
| 15956 | arch-alist (nth 4 ent-entry) | 16403 | arch-alist (nth 4 ent-entry) |
| 15957 | lib-alist (nth 5 ent-entry) | 16404 | lib-alist (nth 6 ent-entry) |
| 15958 | rule (aget rule-alist ent-file-name) | 16405 | rule (aget rule-alist ent-file-name) |
| 15959 | target-list (nth 0 rule) | 16406 | target-list (nth 0 rule) |
| 15960 | depend-list (nth 1 rule) | 16407 | depend-list (nth 1 rule) |
| @@ -16224,7 +16671,8 @@ specified by a target." | |||
| 16224 | (insert " \\\n\t\t$(UNIT-" work-library "-" (car second-list) ")") | 16671 | (insert " \\\n\t\t$(UNIT-" work-library "-" (car second-list) ")") |
| 16225 | (setq second-list (cdr second-list))) | 16672 | (setq second-list (cdr second-list))) |
| 16226 | (while subcomp-list | 16673 | (while subcomp-list |
| 16227 | (when (assoc (car subcomp-list) unit-list) | 16674 | (when (and (assoc (car subcomp-list) unit-list) |
| 16675 | (not (equal unit-key (car subcomp-list)))) | ||
| 16228 | (insert " \\\n\t\t" (car subcomp-list))) | 16676 | (insert " \\\n\t\t" (car subcomp-list))) |
| 16229 | (setq subcomp-list (cdr subcomp-list))) | 16677 | (setq subcomp-list (cdr subcomp-list))) |
| 16230 | (insert "\n") | 16678 | (insert "\n") |
| @@ -16329,8 +16777,10 @@ specified by a target." | |||
| 16329 | 'vhdl-upper-case-enum-values | 16777 | 'vhdl-upper-case-enum-values |
| 16330 | 'vhdl-upper-case-constants | 16778 | 'vhdl-upper-case-constants |
| 16331 | 'vhdl-use-direct-instantiation | 16779 | 'vhdl-use-direct-instantiation |
| 16780 | 'vhdl-compose-configuration-name | ||
| 16332 | 'vhdl-entity-file-name | 16781 | 'vhdl-entity-file-name |
| 16333 | 'vhdl-architecture-file-name | 16782 | 'vhdl-architecture-file-name |
| 16783 | 'vhdl-configuration-file-name | ||
| 16334 | 'vhdl-package-file-name | 16784 | 'vhdl-package-file-name |
| 16335 | 'vhdl-file-name-case | 16785 | 'vhdl-file-name-case |
| 16336 | 'vhdl-electric-keywords | 16786 | 'vhdl-electric-keywords |
| @@ -16373,7 +16823,12 @@ specified by a target." | |||
| 16373 | 'vhdl-testbench-include-library | 16823 | 'vhdl-testbench-include-library |
| 16374 | 'vhdl-testbench-include-configuration | 16824 | 'vhdl-testbench-include-configuration |
| 16375 | 'vhdl-testbench-create-files | 16825 | 'vhdl-testbench-create-files |
| 16826 | 'vhdl-testbench-entity-file-name | ||
| 16827 | 'vhdl-testbench-architecture-file-name | ||
| 16376 | 'vhdl-compose-create-files | 16828 | 'vhdl-compose-create-files |
| 16829 | 'vhdl-compose-configuration-create-file | ||
| 16830 | 'vhdl-compose-configuration-hierarchical | ||
| 16831 | 'vhdl-compose-configuration-use-subconfiguration | ||
| 16377 | 'vhdl-compose-include-header | 16832 | 'vhdl-compose-include-header |
| 16378 | 'vhdl-compose-architecture-name | 16833 | 'vhdl-compose-architecture-name |
| 16379 | 'vhdl-components-package-name | 16834 | 'vhdl-components-package-name |
| @@ -16436,102 +16891,34 @@ specified by a target." | |||
| 16436 | 16891 | ||
| 16437 | (defconst vhdl-doc-release-notes nil | 16892 | (defconst vhdl-doc-release-notes nil |
| 16438 | "\ | 16893 | "\ |
| 16439 | Release Notes for VHDL Mode 3.32 | 16894 | Release Notes for VHDL Mode 3.33 |
| 16440 | ================================ | 16895 | ================================ |
| 16441 | 16896 | ||
| 16442 | - New Features | 16897 | - New Features |
| 16443 | - Enhanced Features | ||
| 16444 | - User Options | 16898 | - User Options |
| 16445 | - Remarks | ||
| 16446 | 16899 | ||
| 16447 | 16900 | ||
| 16448 | New Features | 16901 | New Features |
| 16449 | ------------ | 16902 | ------------ |
| 16450 | 16903 | ||
| 16451 | STRUCTURAL COMPOSITION: | 16904 | CONFIGURATION DECLARATION GENERATION: |
| 16452 | - Enables simple structural composition similar to graphical editors. | 16905 | - Automatic generation of a configuration declaration for a design. |
| 16453 | Simplifies the creation of higher design levels where subcomponents | 16906 | (See documentation (`C-c C-h') in section on STRUCTURAL COMPOSITION.) |
| 16454 | are simply sticked together: | ||
| 16455 | 1. Create a skeleton for a new component | ||
| 16456 | 2. Place subcomponents in it directly from the hierarchy browser | ||
| 16457 | 3. Automatically connect all subcomponents and create the ports | ||
| 16458 | for the new component (based on names of actual ports) | ||
| 16459 | - Automatic generation of a components package (package containing | ||
| 16460 | component declarations for all entities). | ||
| 16461 | - Find more information in the online documentation (`C-c C-h'). | ||
| 16462 | |||
| 16463 | PORT TRANSLATION: | ||
| 16464 | - Reverse direction of ports (useful for testbenches). | ||
| 16465 | |||
| 16466 | SUBPROGRAM TRANSLATION: | ||
| 16467 | - Copy/paste of subprogram interfaces (similar to port translation). | ||
| 16468 | |||
| 16469 | CODE FILLING: | ||
| 16470 | - Condense code using code-sensitive block filling. | ||
| 16471 | |||
| 16472 | CODE STATISTICS: | ||
| 16473 | - Calculate number of code lines and statements in a buffer. | ||
| 16474 | |||
| 16475 | |||
| 16476 | Enhanced Features | ||
| 16477 | ----------------- | ||
| 16478 | |||
| 16479 | TESTBENCH GENERATION: | ||
| 16480 | - Enhanced templates and user option default values. | ||
| 16481 | |||
| 16482 | Emacs 21 compatibility/enhancements: | ||
| 16483 | - `lazy-lock-mode' is not used anymore (built-in `jit-lock-mode' is faster). | ||
| 16484 | |||
| 16485 | And many other minor fixes and enhancements. | ||
| 16486 | 16907 | ||
| 16487 | 16908 | ||
| 16488 | User Options | 16909 | User Options |
| 16489 | ------------ | 16910 | ------------ |
| 16490 | 16911 | ||
| 16491 | `vhdl-project-file-name': (enhanced) | 16912 | `vhdl-configuration-file-name': (new) |
| 16492 | Include user name in project setup file name. | 16913 | Specify how the configuration file name is obtained. |
| 16493 | `vhdl-speedbar-cache-file-name': (enhanced, changed default) | 16914 | `vhdl-compose-configuration-name': (new) |
| 16494 | Include user name in cache file name. | 16915 | Specify how the configuration name is optained. |
| 16495 | `vhdl-default-library': (new) | 16916 | `vhdl-compose-configuration-create-file': (new) |
| 16496 | Default working library if no project is active. | 16917 | Specify whether a new file should be created for a configuration. |
| 16497 | `vhdl-architecture-file-name': (new) | 16918 | `vhdl-compose-configuration-hierarchical': (new) |
| 16498 | Specify how the architecture file name is obtained. | 16919 | Specify whether hierarchical configurations should be created. |
| 16499 | `vhdl-package-file-name': (new) | 16920 | `vhdl-compose-configuration-use-subconfiguration': (new) |
| 16500 | Specify how the package file name is obtained. | 16921 | Specify whether subconfigurations should be used inside configurations. |
| 16501 | `vhdl-file-name-case': (new) | ||
| 16502 | Allows to change case when deriving file names. | ||
| 16503 | `vhdl-compose-create-files': (new) | ||
| 16504 | Specify whether new files should be created for a new component. | ||
| 16505 | `vhdl-compose-include-header': (new) | ||
| 16506 | Specify whether a header is included in a new component's file. | ||
| 16507 | `vhdl-compose-architecture-name': (new) | ||
| 16508 | Specify how a new component's architecture name is obtained. | ||
| 16509 | `vhdl-components-package-name': (new) | ||
| 16510 | Specify how the name for the components package is obtained. | ||
| 16511 | `vhdl-use-components-package': (new) | ||
| 16512 | Specify whether component declarations go in a components package. | ||
| 16513 | `vhdl-use-direct-instantiation': (new) | ||
| 16514 | Specify whether to use VHDL'93 direct component instantiation. | ||
| 16515 | `vhdl-instance-name': (changed default) | ||
| 16516 | Allows insertion of a running number to generate unique instance names. | ||
| 16517 | `vhdl-testbench-entity-header', `vhdl-testbench-architecture-header':(obsolete) | ||
| 16518 | Headers are now automatically derived from the standard header. | ||
| 16519 | `vhdl-testbench-include-header': (new) | ||
| 16520 | Specify whether a header is included in testbench files. | ||
| 16521 | `vhdl-testbench-declaration', `vhdl-testbench-statements': (changed default) | ||
| 16522 | Non-empty default values for more complete testbench templates. | ||
| 16523 | |||
| 16524 | |||
| 16525 | Remarks | ||
| 16526 | ------- | ||
| 16527 | |||
| 16528 | - Changed key binding for `vhdl-comment-uncomment-region': `C-c c' | ||
| 16529 | (`C-c C-c ...' is now used for structural composition). | ||
| 16530 | |||
| 16531 | - Automatic buffer highlighting (font-lock) is now controlled by option | ||
| 16532 | `global-font-lock-mode' in GNU Emacs (`font-lock-auto-fontify' in XEmacs). | ||
| 16533 | \(Important: You MUST customize this option in order to turn automatic | ||
| 16534 | buffer highlighting on.) | ||
| 16535 | ") | 16922 | ") |
| 16536 | 16923 | ||
| 16537 | 16924 | ||
| @@ -16601,7 +16988,8 @@ to visually support naming conventions.") | |||
| 16601 | (interactive) | 16988 | (interactive) |
| 16602 | (unless vhdl-xemacs | 16989 | (unless vhdl-xemacs |
| 16603 | (help-setup-xref (list #'vhdl-doc-variable variable) (interactive-p))) | 16990 | (help-setup-xref (list #'vhdl-doc-variable variable) (interactive-p))) |
| 16604 | (with-output-to-temp-buffer (if (fboundp 'help-buffer) (help-buffer) "*Help*") | 16991 | (with-output-to-temp-buffer |
| 16992 | (if (fboundp 'help-buffer) (help-buffer) "*Help*") | ||
| 16605 | (princ (documentation-property variable 'variable-documentation)) | 16993 | (princ (documentation-property variable 'variable-documentation)) |
| 16606 | (with-current-buffer standard-output | 16994 | (with-current-buffer standard-output |
| 16607 | (help-mode)) | 16995 | (help-mode)) |
| @@ -16612,7 +17000,8 @@ to visually support naming conventions.") | |||
| 16612 | (interactive) | 17000 | (interactive) |
| 16613 | (unless vhdl-xemacs | 17001 | (unless vhdl-xemacs |
| 16614 | (help-setup-xref (list #'vhdl-doc-mode) (interactive-p))) | 17002 | (help-setup-xref (list #'vhdl-doc-mode) (interactive-p))) |
| 16615 | (with-output-to-temp-buffer (if (fboundp 'help-buffer) (help-buffer) "*Help*") | 17003 | (with-output-to-temp-buffer |
| 17004 | (if (fboundp 'help-buffer) (help-buffer) "*Help*") | ||
| 16616 | (princ mode-name) | 17005 | (princ mode-name) |
| 16617 | (princ " mode:\n") | 17006 | (princ " mode:\n") |
| 16618 | (princ (documentation 'vhdl-mode)) | 17007 | (princ (documentation 'vhdl-mode)) |