annotate runtime/syntax/vhdl.vim @ 9:6a13985590e6

*** empty log message ***
author axmo
date Fri, 29 Aug 2008 15:41:29 +0900
parents 76efa0be13f1
children e170173ecb68
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
1 " Vim syntax file
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
2 " Language: VHDL
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
3 " Maintainer: Czo <Olivier.Sirol@lip6.fr>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
4 " Credits: Stephan Hegel <stephan.hegel@snc.siemens.com.cn>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
5 " $Id$
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
6
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
7 " VHSIC Hardware Description Language
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
8 " Very High Scale Integrated Circuit
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
9
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
10 " For version 5.x: Clear all syntax items
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
11 " For version 6.x: Quit when a syntax file was already loaded
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
12 if version < 600
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
13 syntax clear
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
14 elseif exists("b:current_syntax")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
15 finish
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
16 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
17
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
18 " This is not VHDL. I use the C-Preprocessor cpp to generate different binaries
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
19 " from one VHDL source file. Unfortunately there is no preprocessor for VHDL
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
20 " available. If you don't like this, please remove the following lines.
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
21 syn match cDefine "^#ifdef[ ]\+[A-Za-z_]\+"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
22 syn match cDefine "^#endif"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
23
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
24 " case is not significant
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
25 syn case ignore
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
26
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
27 " VHDL keywords
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
28 syn keyword vhdlStatement access after alias all assert
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
29 syn keyword vhdlStatement architecture array attribute
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
30 syn keyword vhdlStatement begin block body buffer bus
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
31 syn keyword vhdlStatement case component configuration constant
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
32 syn keyword vhdlStatement disconnect downto
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
33 syn keyword vhdlStatement elsif end entity exit
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
34 syn keyword vhdlStatement file for function
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
35 syn keyword vhdlStatement generate generic group guarded
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
36 syn keyword vhdlStatement impure in inertial inout is
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
37 syn keyword vhdlStatement label library linkage literal loop
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
38 syn keyword vhdlStatement map
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
39 syn keyword vhdlStatement new next null
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
40 syn keyword vhdlStatement of on open others out
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
41 syn keyword vhdlStatement package port postponed procedure process pure
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
42 syn keyword vhdlStatement range record register reject report return
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
43 syn keyword vhdlStatement select severity signal shared
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
44 syn keyword vhdlStatement subtype
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
45 syn keyword vhdlStatement then to transport type
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
46 syn keyword vhdlStatement unaffected units until use
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
47 syn keyword vhdlStatement variable wait when while with
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
48 syn keyword vhdlStatement note warning error failure
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
49
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
50 " Special match for "if" and "else" since "else if" shouldn't be highlighted.
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
51 " The right keyword is "elsif"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
52 syn match vhdlStatement "\<\(if\|else\)\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
53 syn match vhdlNone "\<else\s\+if\>$"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
54 syn match vhdlNone "\<else\s\+if\>\s"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
55
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
56 " Predifined VHDL types
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
57 syn keyword vhdlType bit bit_vector
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
58 syn keyword vhdlType character boolean integer real time
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
59 syn keyword vhdlType string severity_level
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
60 " Predifined standard ieee VHDL types
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
61 syn keyword vhdlType positive natural signed unsigned
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
62 syn keyword vhdlType line text
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
63 syn keyword vhdlType std_logic std_logic_vector
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
64 syn keyword vhdlType std_ulogic std_ulogic_vector
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
65 " Predefined non standard VHDL types for Mentor Graphics Sys1076/QuickHDL
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
66 syn keyword vhdlType qsim_state qsim_state_vector
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
67 syn keyword vhdlType qsim_12state qsim_12state_vector
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
68 syn keyword vhdlType qsim_strength
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
69 " Predefined non standard VHDL types for Alliance VLSI CAD
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
70 syn keyword vhdlType mux_bit mux_vector reg_bit reg_vector wor_bit wor_vector
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
71
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
72 " array attributes
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
73 syn match vhdlAttribute "\'high"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
74 syn match vhdlAttribute "\'left"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
75 syn match vhdlAttribute "\'length"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
76 syn match vhdlAttribute "\'low"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
77 syn match vhdlAttribute "\'range"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
78 syn match vhdlAttribute "\'reverse_range"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
79 syn match vhdlAttribute "\'right"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
80 syn match vhdlAttribute "\'ascending"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
81 " block attributes
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
82 syn match vhdlAttribute "\'behaviour"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
83 syn match vhdlAttribute "\'structure"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
84 syn match vhdlAttribute "\'simple_name"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
85 syn match vhdlAttribute "\'instance_name"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
86 syn match vhdlAttribute "\'path_name"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
87 syn match vhdlAttribute "\'foreign"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
88 " signal attribute
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
89 syn match vhdlAttribute "\'active"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
90 syn match vhdlAttribute "\'delayed"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
91 syn match vhdlAttribute "\'event"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
92 syn match vhdlAttribute "\'last_active"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
93 syn match vhdlAttribute "\'last_event"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
94 syn match vhdlAttribute "\'last_value"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
95 syn match vhdlAttribute "\'quiet"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
96 syn match vhdlAttribute "\'stable"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
97 syn match vhdlAttribute "\'transaction"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
98 syn match vhdlAttribute "\'driving"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
99 syn match vhdlAttribute "\'driving_value"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
100 " type attributes
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
101 syn match vhdlAttribute "\'base"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
102 syn match vhdlAttribute "\'high"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
103 syn match vhdlAttribute "\'left"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
104 syn match vhdlAttribute "\'leftof"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
105 syn match vhdlAttribute "\'low"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
106 syn match vhdlAttribute "\'pos"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
107 syn match vhdlAttribute "\'pred"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
108 syn match vhdlAttribute "\'rightof"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
109 syn match vhdlAttribute "\'succ"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
110 syn match vhdlAttribute "\'val"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
111 syn match vhdlAttribute "\'image"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
112 syn match vhdlAttribute "\'value"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
113
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
114 syn keyword vhdlBoolean true false
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
115
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
116 " for this vector values case is significant
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
117 syn case match
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
118 " Values for standard VHDL types
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
119 syn match vhdlVector "\'[0L1HXWZU\-\?]\'"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
120 " Values for non standard VHDL types qsim_12state for Mentor Graphics Sys1076/QuickHDL
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
121 syn keyword vhdlVector S0S S1S SXS S0R S1R SXR S0Z S1Z SXZ S0I S1I SXI
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
122 syn case ignore
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
123
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
124 syn match vhdlVector "B\"[01_]\+\""
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
125 syn match vhdlVector "O\"[0-7_]\+\""
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
126 syn match vhdlVector "X\"[0-9a-f_]\+\""
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
127 syn match vhdlCharacter "'.'"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
128 syn region vhdlString start=+"+ end=+"+
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
129
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
130 " floating numbers
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
131 syn match vhdlNumber "-\=\<\d\+\.\d\+\(E[+\-]\=\d\+\)\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
132 syn match vhdlNumber "-\=\<\d\+\.\d\+\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
133 syn match vhdlNumber "0*2#[01_]\+\.[01_]\+#\(E[+\-]\=\d\+\)\="
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
134 syn match vhdlNumber "0*16#[0-9a-f_]\+\.[0-9a-f_]\+#\(E[+\-]\=\d\+\)\="
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
135 " integer numbers
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
136 syn match vhdlNumber "-\=\<\d\+\(E[+\-]\=\d\+\)\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
137 syn match vhdlNumber "-\=\<\d\+\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
138 syn match vhdlNumber "0*2#[01_]\+#\(E[+\-]\=\d\+\)\="
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
139 syn match vhdlNumber "0*16#[0-9a-f_]\+#\(E[+\-]\=\d\+\)\="
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
140 " operators
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
141 syn keyword vhdlOperator and nand or nor xor xnor
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
142 syn keyword vhdlOperator rol ror sla sll sra srl
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
143 syn keyword vhdlOperator mod rem abs not
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
144 syn match vhdlOperator "[&><=:+\-*\/|]"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
145 syn match vhdlSpecial "[().,;]"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
146 " time
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
147 syn match vhdlTime "\<\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
148 syn match vhdlTime "\<\d\+\.\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
149
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
150 syn match vhdlComment "--.*$"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
151 " syn match vhdlGlobal "[\'$#~!%@?\^\[\]{}\\]"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
152
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
153 " Define the default highlighting.
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
154 " For version 5.7 and earlier: only when not done already
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
155 " For version 5.8 and later: only when an item doesn't have highlighting yet
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
156 if version >= 508 || !exists("did_vhdl_syntax_inits")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
157 if version < 508
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
158 let did_vhdl_syntax_inits = 1
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
159 command -nargs=+ HiLink hi link <args>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
160 else
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
161 command -nargs=+ HiLink hi def link <args>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
162 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
163
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
164 HiLink cDefine PreProc
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
165 HiLink vhdlSpecial Special
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
166 HiLink vhdlStatement Statement
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
167 HiLink vhdlCharacter String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
168 HiLink vhdlString String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
169 HiLink vhdlVector String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
170 HiLink vhdlBoolean String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
171 HiLink vhdlComment Comment
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
172 HiLink vhdlNumber String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
173 HiLink vhdlTime String
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
174 HiLink vhdlType Type
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
175 HiLink vhdlOperator Type
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
176 HiLink vhdlGlobal Error
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
177 HiLink vhdlAttribute Type
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
178
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
179 delcommand HiLink
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
180 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
181
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
182 let b:current_syntax = "vhdl"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
183
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
184 " vim: ts=8