verilogams.vim 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. " Vim syntax file
  2. " Language: Verilog-AMS
  3. " Maintainer: S. Myles Prather <smprather@gmail.com>
  4. "
  5. " Version 1.1 S. Myles Prather <smprather@gmail.com>
  6. " Moved some keywords to the type category.
  7. " Added the metrix suffixes to the number matcher.
  8. " Version 1.2 Prasanna Tamhankar <pratam@gmail.com>
  9. " Minor reserved keyword updates.
  10. " Last Update: Thursday September 15 15:36:03 CST 2005
  11. " quit when a syntax file was already loaded
  12. if exists("b:current_syntax")
  13. finish
  14. endif
  15. " Set the local value of the 'iskeyword' option
  16. setlocal iskeyword=@,48-57,_,192-255
  17. " Annex B.1 'All keywords'
  18. syn keyword verilogamsStatement above abs absdelay acos acosh ac_stim
  19. syn keyword verilogamsStatement always analog analysis and asin
  20. syn keyword verilogamsStatement asinh assign atan atan2 atanh
  21. syn keyword verilogamsStatement buf bufif0 bufif1 ceil cmos connectmodule
  22. syn keyword verilogamsStatement connectrules cos cosh cross ddt ddx deassign
  23. syn keyword verilogamsStatement defparam disable discipline
  24. syn keyword verilogamsStatement driver_update edge enddiscipline
  25. syn keyword verilogamsStatement endconnectrules endmodule endfunction endgenerate
  26. syn keyword verilogamsStatement endnature endparamset endprimitive endspecify
  27. syn keyword verilogamsStatement endtable endtask event exp final_step
  28. syn keyword verilogamsStatement flicker_noise floor flow force fork
  29. syn keyword verilogamsStatement function generate highz0
  30. syn keyword verilogamsStatement highz1 hypot idt idtmod if ifnone inf initial
  31. syn keyword verilogamsStatement initial_step inout input join
  32. syn keyword verilogamsStatement laplace_nd laplace_np laplace_zd laplace_zp
  33. syn keyword verilogamsStatement large last_crossing limexp ln localparam log
  34. syn keyword verilogamsStatement macromodule max medium min module nand nature
  35. syn keyword verilogamsStatement negedge net_resolution nmos noise_table nor not
  36. syn keyword verilogamsStatement notif0 notif1 or output paramset pmos
  37. syn keyword verilogamsType parameter real integer electrical input output
  38. syn keyword verilogamsType inout reg tri tri0 tri1 triand trior trireg
  39. syn keyword verilogamsType string from exclude aliasparam ground genvar
  40. syn keyword verilogamsType branch time realtime
  41. syn keyword verilogamsStatement posedge potential pow primitive pull0 pull1
  42. syn keyword verilogamsStatement pullup pulldown rcmos release
  43. syn keyword verilogamsStatement rnmos rpmos rtran rtranif0 rtranif1
  44. syn keyword verilogamsStatement scalared sin sinh slew small specify specparam
  45. syn keyword verilogamsStatement sqrt strong0 strong1 supply0 supply1
  46. syn keyword verilogamsStatement table tan tanh task timer tran tranif0
  47. syn keyword verilogamsStatement tranif1 transition
  48. syn keyword verilogamsStatement vectored wait wand weak0 weak1
  49. syn keyword verilogamsStatement white_noise wire wor wreal xnor xor zi_nd
  50. syn keyword verilogamsStatement zi_np zi_zd zi_zp
  51. syn keyword verilogamsRepeat forever repeat while for
  52. syn keyword verilogamsLabel begin end
  53. syn keyword verilogamsConditional if else case casex casez default endcase
  54. syn match verilogamsConstant ":inf"lc=1
  55. syn match verilogamsConstant "-inf"lc=1
  56. " Annex B.2 Discipline/nature
  57. syn keyword verilogamsStatement abstol access continuous ddt_nature discrete
  58. syn keyword verilogamsStatement domain idt_nature units
  59. " Annex B.3 Connect Rules
  60. syn keyword verilogamsStatement connect merged resolveto split
  61. syn match verilogamsOperator "[&|~><!)(*#%@+/=?:;}{,.\^\-\[\]]"
  62. syn match verilogamsOperator "<+"
  63. syn match verilogamsStatement "[vV]("me=e-1
  64. syn match verilogamsStatement "[iI]("me=e-1
  65. syn keyword verilogamsTodo contained TODO
  66. syn region verilogamsComment start="/\*" end="\*/" contains=verilogamsTodo
  67. syn match verilogamsComment "//.*" contains=verilogamsTodo
  68. syn match verilogamsGlobal "`celldefine"
  69. syn match verilogamsGlobal "`default_nettype"
  70. syn match verilogamsGlobal "`define"
  71. syn match verilogamsGlobal "`else"
  72. syn match verilogamsGlobal "`elsif"
  73. syn match verilogamsGlobal "`endcelldefine"
  74. syn match verilogamsGlobal "`endif"
  75. syn match verilogamsGlobal "`ifdef"
  76. syn match verilogamsGlobal "`ifndef"
  77. syn match verilogamsGlobal "`include"
  78. syn match verilogamsGlobal "`line"
  79. syn match verilogamsGlobal "`nounconnected_drive"
  80. syn match verilogamsGlobal "`resetall"
  81. syn match verilogamsGlobal "`timescale"
  82. syn match verilogamsGlobal "`unconnected_drive"
  83. syn match verilogamsGlobal "`undef"
  84. syn match verilogamsSystask "$[a-zA-Z0-9_]\+\>"
  85. syn match verilogamsConstant "\<[A-Z][A-Z0-9_]\+\>"
  86. syn match verilogamsNumber "\(\<\d\+\|\)'[bB]\s*[0-1_xXzZ?]\+\>"
  87. syn match verilogamsNumber "\(\<\d\+\|\)'[oO]\s*[0-7_xXzZ?]\+\>"
  88. syn match verilogamsNumber "\(\<\d\+\|\)'[dD]\s*[0-9_xXzZ?]\+\>"
  89. syn match verilogamsNumber "\(\<\d\+\|\)'[hH]\s*[0-9a-fA-F_xXzZ?]\+\>"
  90. syn match verilogamsNumber "\<[+-]\=[0-9_]\+\(\.[0-9_]*\|\)\(e[0-9_]*\|\)[TGMKkmunpfa]\=\>"
  91. syn region verilogamsString start=+"+ skip=+\\"+ end=+"+ contains=verilogamsEscape
  92. syn match verilogamsEscape +\\[nt"\\]+ contained
  93. syn match verilogamsEscape "\\\o\o\=\o\=" contained
  94. "Modify the following as needed. The trade-off is performance versus
  95. "functionality.
  96. syn sync lines=50
  97. " Define the default highlighting.
  98. " Only when an item doesn't have highlighting yet
  99. " The default highlighting.
  100. hi def link verilogamsCharacter Character
  101. hi def link verilogamsConditional Conditional
  102. hi def link verilogamsRepeat Repeat
  103. hi def link verilogamsString String
  104. hi def link verilogamsTodo Todo
  105. hi def link verilogamsComment Comment
  106. hi def link verilogamsConstant Constant
  107. hi def link verilogamsLabel Label
  108. hi def link verilogamsNumber Number
  109. hi def link verilogamsOperator Special
  110. hi def link verilogamsStatement Statement
  111. hi def link verilogamsGlobal Define
  112. hi def link verilogamsDirective SpecialComment
  113. hi def link verilogamsEscape Special
  114. hi def link verilogamsType Type
  115. hi def link verilogamsSystask Function
  116. let b:current_syntax = "verilogams"
  117. " vim: ts=8