| 1 |
filetype: verilog |
| 2 |
|
| 3 |
detect: |
| 4 |
filename: "\\.(v|vh|sv|svh)$" |
| 5 |
|
| 6 |
rules: |
| 7 |
- preproc: "\\b(module|package|program|endmodule|endpackage|endprogram)\\b" |
| 8 |
- type.keyword: "\\b(task|interface|class|endtask|endinterface|endclass)\\b" |
| 9 |
# builtin functions like $display |
| 10 |
- special: "\\$[0-9A-Za-z_]+" |
| 11 |
|
| 12 |
# Verilog keywords |
| 13 |
- statement: "\\b(always|and|assign|automatic|begin|buf|bufif0|bufif1|case|casex|casez|cell|cmos|config)\\b" |
| 14 |
- statement: "\\b(deassign|default|defparam|design|disable|edge|else|end|endcase|endconfig|endfunction|endgenerate)\\b" |
| 15 |
- statement: "\\b(endprimitive|endspecify|endtable|event|for|force|forever|fork|function|generate)\\b" |
| 16 |
- statement: "\\b(genvar|highz0|highz1|if|iff|ifnone|incdir|include|initial|input|instance|join)\\b" |
| 17 |
- statement: "\\b(large|liblist|library|localparam|macromodule|medium|nand|negedge|nmos|nor|noshowcancelled)\\b" |
| 18 |
- statement: "\\b(not|notif0|notif1|null|or|output|parameter|pmos|posedge|primitive|pull0|pull1|pulldown|pullup)\\b" |
| 19 |
- statement: "\\b(pulsestyle_onevent|pulsestyle_ondetect|rcmos|realtime|reg|release|repeat|rnmos|rpmos|rtran)\\b" |
| 20 |
- statement: "\\b(rtranif0|rtranif1|scalared|showcancelled|small|specify|specparam|strong0|strong1|supply0)\\b" |
| 21 |
- statement: "\\b(supply1|table|time|tran|tranif0|tranif1|tri0|tri1|triand|trior|trireg|use|uwire)\\b" |
| 22 |
- statement: "\\b(vectored|wait|wand|weak0|weak1|while|wor|xnor|xor)\\b" |
| 23 |
|
| 24 |
# SystemVerilog keywords |
| 25 |
- statement: "\\b(alias|always_comb|always_ff|always_latch|assert|assume|before|bind|bins|binsof|break)\\b" |
| 26 |
- statement: "\\b(chandle|clocking|const|constraint|context|continue|cover|covergroup|coverpoint|cross|dist|do)\\b" |
| 27 |
- statement: "\\b(endclocking|endgroup|endproperty|endsequence|enum)\\b" |
| 28 |
- statement: "\\b(expect|export|extends|extern|final|first_match|foreach|forkjoin|ignore_bins|illegal_bins|import)\\b" |
| 29 |
- statement: "\\b(inside|intersect|join_any|join_none|local|longint|matches|modport|new)\\b" |
| 30 |
- statement: "\\b(packed|priority|property|protected|pure|rand|randc|randcase|randsequence|ref|return)\\b" |
| 31 |
- statement: "\\b(sequence|solve|static|struct|super|tagged|this|throughout|timeprecision)\\b" |
| 32 |
- statement: "\\b(timeunit|type|typedef|union|unique|virtual|wait_order|wildcard|with|within)\\b" |
| 33 |
|
| 34 |
# types |
| 35 |
- type.keyword: "\\b(int|integer|logic|wire|tri|unsigned|signed|inout|var|shortint|shortreal|real|void|string|bit|byte)\\b" |
| 36 |
|
| 37 |
# constants |
| 38 |
- constant.number: "\\b[0-9]+\\b" |
| 39 |
- constant.number: "\\b'[su]?[dboh][0-9xzXZa-fA-F]+\\b" |
| 40 |
# .asdf(...) argument syntax |
| 41 |
- special: "\\.((\\*)|([A-Za-z][A-Za-z0-9_]*))" |
| 42 |
|
| 43 |
- constant.string: |
| 44 |
start: "\"" |
| 45 |
end: "\"" |
| 46 |
skip: "\\\\." |
| 47 |
rules: |
| 48 |
- constant.specialChar: "\\\\." |
| 49 |
|
| 50 |
- comment: |
| 51 |
start: "//" |
| 52 |
end: "$" |
| 53 |
rules: |
| 54 |
- todo: "(TODO|XXX|FIXME):?" |
| 55 |
|
| 56 |
- comment: |
| 57 |
start: "/\\*" |
| 58 |
end: "\\*/" |
| 59 |
rules: |
| 60 |
- todo: "(TODO|XXX|FIXME):?" |