7
|
1 " Vim syn file
|
|
2 " Language: Altera AHDL
|
|
3 " Maintainer: John Cook <john.cook@kla-tencor.com>
|
|
4 " Last Change: 2001 Apr 25
|
|
5
|
|
6 " For version 5.x: Clear all syntax items
|
|
7 " For version 6.x: Quit when a syntax file was already loaded
|
|
8 if version < 600
|
|
9 syntax clear
|
|
10 elseif exists("b:current_syntax")
|
|
11 finish
|
|
12 endif
|
|
13
|
|
14 "this language is oblivious to case.
|
|
15 syn case ignore
|
|
16
|
|
17 " a bunch of keywords
|
|
18 syn keyword ahdlKeyword assert begin bidir bits buried case clique
|
|
19 syn keyword ahdlKeyword connected_pins constant defaults define design
|
|
20 syn keyword ahdlKeyword device else elsif end for function generate
|
|
21 syn keyword ahdlKeyword gnd help_id if in include input is machine
|
|
22 syn keyword ahdlKeyword node of options others output parameters
|
|
23 syn keyword ahdlKeyword returns states subdesign table then title to
|
|
24 syn keyword ahdlKeyword tri_state_node variable vcc when with
|
|
25
|
|
26 " a bunch of types
|
|
27 syn keyword ahdlIdentifier carry cascade dffe dff exp global
|
|
28 syn keyword ahdlIdentifier jkffe jkff latch lcell mcell memory opendrn
|
|
29 syn keyword ahdlIdentifier soft srffe srff tffe tff tri wire x
|
|
30
|
|
31 syn keyword ahdlMegafunction lpm_and lpm_bustri lpm_clshift lpm_constant
|
|
32 syn keyword ahdlMegafunction lpm_decode lpm_inv lpm_mux lpm_or lpm_xor
|
|
33 syn keyword ahdlMegafunction busmux mux
|
|
34
|
|
35 syn keyword ahdlMegafunction divide lpm_abs lpm_add_sub lpm_compare
|
|
36 syn keyword ahdlMegafunction lpm_counter lpm_mult
|
|
37
|
|
38 syn keyword ahdlMegafunction altdpram csfifo dcfifo scfifo csdpram lpm_ff
|
|
39 syn keyword ahdlMegafunction lpm_latch lpm_shiftreg lpm_ram_dq lpm_ram_io
|
|
40 syn keyword ahdlMegafunction lpm_rom lpm_dff lpm_tff clklock pll ntsc
|
|
41
|
|
42 syn keyword ahdlTodo contained TODO
|
|
43
|
|
44 " String contstants
|
|
45 syn region ahdlString start=+"+ skip=+\\"+ end=+"+
|
|
46
|
|
47 " valid integer number formats (decimal, binary, octal, hex)
|
|
48 syn match ahdlNumber '\<\d\+\>'
|
|
49 syn match ahdlNumber '\<b"\(0\|1\|x\)\+"'
|
|
50 syn match ahdlNumber '\<\(o\|q\)"\o\+"'
|
|
51 syn match ahdlNumber '\<\(h\|x\)"\x\+"'
|
|
52
|
|
53 " operators
|
|
54 syn match ahdlOperator "[!&#$+\-<>=?:\^]"
|
|
55 syn keyword ahdlOperator not and nand or nor xor xnor
|
|
56 syn keyword ahdlOperator mod div log2 used ceil floor
|
|
57
|
|
58 " one line and multi-line comments
|
|
59 " (define these after ahdlOperator so -- overrides -)
|
|
60 syn match ahdlComment "--.*" contains=ahdlNumber,ahdlTodo
|
|
61 syn region ahdlComment start="%" end="%" contains=ahdlNumber,ahdlTodo
|
|
62
|
|
63 " other special characters
|
|
64 syn match ahdlSpecialChar "[\[\]().,;]"
|
|
65
|
|
66 syn sync minlines=1
|
|
67
|
|
68 " Define the default highlighting.
|
|
69 " For version 5.7 and earlier: only when not done already
|
|
70 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
71 if version >= 508 || !exists("did_ahdl_syn_inits")
|
|
72 if version < 508
|
|
73 let did_ahdl_syn_inits = 1
|
|
74 command -nargs=+ HiLink hi link <args>
|
|
75 else
|
|
76 command -nargs=+ HiLink hi def link <args>
|
|
77 endif
|
|
78
|
|
79 " The default highlighting.
|
|
80 HiLink ahdlNumber ahdlString
|
|
81 HiLink ahdlMegafunction ahdlIdentifier
|
|
82 HiLink ahdlSpecialChar SpecialChar
|
|
83 HiLink ahdlKeyword Statement
|
|
84 HiLink ahdlString String
|
|
85 HiLink ahdlComment Comment
|
|
86 HiLink ahdlIdentifier Identifier
|
|
87 HiLink ahdlOperator Operator
|
|
88 HiLink ahdlTodo Todo
|
|
89
|
|
90 delcommand HiLink
|
|
91 endif
|
|
92
|
|
93 let b:current_syntax = "ahdl"
|
|
94 " vim:ts=8
|