home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / verilog.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  2.8 KB  |  80 lines

  1. " Vim syntax file
  2. " Language:    Verilog
  3. " Maintainer:    Mun Johl <mj@core.rose.hp.com>
  4. " Last Update:  Tue Jun 30 09:25:12 PDT 1998
  5.  
  6. " Remove any old syntax stuff hanging around
  7. syn clear
  8. set iskeyword=@,48-57,_,192-255,+,-,?
  9.  
  10.  
  11. " A bunch of useful Verilog keywords
  12. syn keyword verilogStatement   disable assign deassign force release
  13. syn keyword verilogStatement   parameter function endfunction
  14. syn keyword verilogStatement   always initial module endmodule or
  15. syn keyword verilogStatement   task endtask
  16. syn keyword verilogStatement   input output inout reg wire
  17. syn keyword verilogStatement   posedge negedge wait
  18. syn keyword verilogStatement   buf pullup pull0 pull1 pulldown
  19. syn keyword verilogStatement   tri0 tri1 tri trireg
  20. syn keyword verilogStatement   wand wor triand trior
  21. syn keyword verilogStatement   defparam
  22. syn keyword verilogStatement   integer real
  23. syn keyword verilogStatement   time
  24.  
  25. syn keyword verilogLabel       begin end fork join
  26. syn keyword verilogConditional if else case casex casez default endcase
  27. syn keyword verilogRepeat      forever repeat while for
  28.  
  29. syn keyword verilogTodo contained TODO
  30.  
  31. syn match   verilogOperator "[&|~><!)(*#%@+/=?:;}{,.\^\-\[\]]"
  32.  
  33. syn region  verilogComment start="/\*" end="\*/" contains=verilogTodo
  34. syn match   verilogComment "//.*" oneline
  35.  
  36. syn match   verilogGlobal "`[a-zA-Z0-9_]\+\>"
  37. syn match   verilogGlobal "$[a-zA-Z0-9_]\+\>"
  38.  
  39. syn match   verilogConstant "\<[A-Z][A-Z0-9_]\+\>"
  40.  
  41. syn match   verilogNumber "\(\<\d\+\|\)'[bB]\s*[0-1_xXzZ?]\+\>"
  42. syn match   verilogNumber "\(\<\d\+\|\)'[oO]\s*[0-7_xXzZ?]\+\>"
  43. syn match   verilogNumber "\(\<\d\+\|\)'[dD]\s*[0-9_xXzZ?]\+\>"
  44. syn match   verilogNumber "\(\<\d\+\|\)'[hH]\s*[0-9a-fA-F_xXzZ?]\+\>"
  45. syn match   verilogNumber "\<[+-]\=[0-9_]\+\(\.[0-9_]*\|\)\(e[0-9_]*\|\)\>"
  46.  
  47. syn region  verilogString start=+"+  end=+"+
  48.  
  49. " Directives
  50. syn match   verilogDirective   "//\s*synopsys\>.*$"
  51. syn region  verilogDirective   start="/\*\s*synopsys\>" end="\*/"
  52. syn region  verilogDirective   start="//\s*synopsys dc_script_begin\>" end="//\s*synopsys dc_script_end\>"
  53.  
  54. "Modify the following as needed.  The trade-off is performance versus
  55. "functionality.
  56. syn sync lines=50
  57.  
  58. if !exists("did_verilog_syntax_inits")
  59.   let did_verilog_syntax_inits = 1
  60.  " The default methods for highlighting.  Can be overridden later
  61.  
  62.   hi link verilogCharacter       Character
  63.   hi link verilogConditional     Conditional
  64.   hi link verilogRepeat          Repeat
  65.   hi link verilogString          String
  66.   hi link verilogTodo            Todo
  67.   hi link verilogComment         Comment
  68.   hi link verilogConstant        Constant
  69.   hi link verilogLabel           Label
  70.   hi link verilogNumber          Number
  71.   hi link verilogOperator        Special
  72.   hi link verilogStatement       Statement
  73.   hi link verilogGlobal          Define
  74.   hi link verilogDirective       SpecialComment
  75. endif
  76.  
  77. let b:current_syntax = "verilog"
  78.  
  79. " vim: ts=8
  80.