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