3 " Maintainer: Mun Johl <mun_johl@agilent.com>
4 " Last Update: Thu May 3 09:47:51 PDT 2001
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
14 " Set the local value of the 'iskeyword' option
16 setlocal iskeyword=@,48-57,_,192-255,+,-,?
18 set iskeyword=@,48-57,_,192-255,+,-,?
21 " A bunch of useful Verilog keywords
22 syn keyword verilogStatement disable assign deassign force release
23 syn keyword verilogStatement parameter function endfunction
24 syn keyword verilogStatement always initial module endmodule or
25 syn keyword verilogStatement task endtask
26 syn keyword verilogStatement input output inout reg wire
27 syn keyword verilogStatement posedge negedge wait
28 syn keyword verilogStatement buf pullup pull0 pull1 pulldown
29 syn keyword verilogStatement tri0 tri1 tri trireg
30 syn keyword verilogStatement wand wor triand trior
31 syn keyword verilogStatement defparam
32 syn keyword verilogStatement integer real
33 syn keyword verilogStatement time
35 syn keyword verilogLabel begin end fork join
36 syn keyword verilogConditional if else case casex casez default endcase
37 syn keyword verilogRepeat forever repeat while for
39 syn keyword verilogTodo contained TODO
41 syn match verilogOperator "[&|~><!)(*#%@+/=?:;}{,.\^\-\[\]]"
43 syn region verilogComment start="/\*" end="\*/" contains=verilogTodo
44 syn match verilogComment "//.*" oneline
46 syn match verilogGlobal "`[a-zA-Z0-9_]\+\>"
47 syn match verilogGlobal "$[a-zA-Z0-9_]\+\>"
49 syn match verilogConstant "\<[A-Z][A-Z0-9_]\+\>"
51 syn match verilogNumber "\(\<\d\+\|\)'[bB]\s*[0-1_xXzZ?]\+\>"
52 syn match verilogNumber "\(\<\d\+\|\)'[oO]\s*[0-7_xXzZ?]\+\>"
53 syn match verilogNumber "\(\<\d\+\|\)'[dD]\s*[0-9_xXzZ?]\+\>"
54 syn match verilogNumber "\(\<\d\+\|\)'[hH]\s*[0-9a-fA-F_xXzZ?]\+\>"
55 syn match verilogNumber "\<[+-]\=[0-9_]\+\(\.[0-9_]*\|\)\(e[0-9_]*\|\)\>"
57 syn region verilogString start=+"+ end=+"+
60 syn match verilogDirective "//\s*synopsys\>.*$"
61 syn region verilogDirective start="/\*\s*synopsys\>" end="\*/"
62 syn region verilogDirective start="//\s*synopsys dc_script_begin\>" end="//\s*synopsys dc_script_end\>"
64 syn match verilogDirective "//\s*\$s\>.*$"
65 syn region verilogDirective start="/\*\s*\$s\>" end="\*/"
66 syn region verilogDirective start="//\s*\$s dc_script_begin\>" end="//\s*\$s dc_script_end\>"
68 "Modify the following as needed. The trade-off is performance versus
72 " Define the default highlighting.
73 " For version 5.7 and earlier: only when not done already
74 " For version 5.8 and later: only when an item doesn't have highlighting yet
75 if version >= 508 || !exists("did_verilog_syn_inits")
77 let did_verilog_syn_inits = 1
78 command -nargs=+ HiLink hi link <args>
80 command -nargs=+ HiLink hi def link <args>
83 " The default highlighting.
84 HiLink verilogCharacter Character
85 HiLink verilogConditional Conditional
86 HiLink verilogRepeat Repeat
87 HiLink verilogString String
88 HiLink verilogTodo Todo
89 HiLink verilogComment Comment
90 HiLink verilogConstant Constant
91 HiLink verilogLabel Label
92 HiLink verilogNumber Number
93 HiLink verilogOperator Special
94 HiLink verilogStatement Statement
95 HiLink verilogGlobal Define
96 HiLink verilogDirective SpecialComment
101 let b:current_syntax = "verilog"