Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: Hercules |
| 3 | " Maintainer: Dana Edwards <Dana_Edwards@avanticorp.com> |
| 4 | " Extensions: *.vc,*.ev,*.rs |
| 5 | " Last change: Nov. 9, 2001 |
| 6 | " Comment: Hercules physical IC design verification software ensures |
| 7 | " that an IC's physical design matches its logical design and |
| 8 | " satisfies manufacturing rules. |
| 9 | |
| 10 | " For version 5.x: Clear all syntax items |
| 11 | " For version 6.x: Quit when a syntax file was already loaded |
| 12 | if version < 600 |
| 13 | syntax clear |
| 14 | elseif exists("b:current_syntax") |
| 15 | finish |
| 16 | endif |
| 17 | |
| 18 | " Ignore case |
| 19 | syn case ignore |
| 20 | |
| 21 | " Hercules runset sections |
| 22 | syn keyword herculesType header assign_property alias assign |
| 23 | syn keyword herculesType options preprocess_options |
| 24 | syn keyword herculesType explode_options technology_options |
| 25 | syn keyword herculesType drc_options database_options |
| 26 | syn keyword herculesType text_options lpe_options evaccess_options |
| 27 | syn keyword herculesType check_point compare_group environment |
| 28 | syn keyword herculesType grid_check include layer_stats load_group |
| 29 | syn keyword herculesType restart run_only self_intersect set snap |
| 30 | syn keyword herculesType system variable waiver |
| 31 | |
| 32 | " Hercules commands |
| 33 | syn keyword herculesStatement attach_property boolean cell_extent |
| 34 | syn keyword herculesStatement common_hierarchy connection_points |
| 35 | syn keyword herculesStatement copy data_filter alternate delete |
| 36 | syn keyword herculesStatement explode explode_all fill_pattern find_net |
| 37 | syn keyword herculesStatement flatten |
| 38 | syn keyword herculesStatement level negate polygon_features push |
| 39 | syn keyword herculesStatement rectangles relocate remove_overlap reverse select |
| 40 | syn keyword herculesStatement select_cell select_contains select_edge select_net size |
| 41 | syn keyword herculesStatement text_polygon text_property vertex area cut |
| 42 | syn keyword herculesStatement density enclose external inside_edge |
| 43 | syn keyword herculesStatement internal notch vectorize center_to_center |
| 44 | syn keyword herculesStatement length mask_align moscheck rescheck |
| 45 | syn keyword herculesStatement analysis buildsub init_lpe_db capacitor |
| 46 | syn keyword herculesStatement device gendev nmos pmos diode npn pnp |
| 47 | syn keyword herculesStatement resistor set_param save_property |
| 48 | syn keyword herculesStatement connect disconnect text text_boolean |
| 49 | syn keyword herculesStatement replace_text create_ports label graphics |
| 50 | syn keyword herculesStatement save_netlist_database lpe_stats netlist |
| 51 | syn keyword herculesStatement spice graphics_property graphics_netlist |
| 52 | syn keyword herculesStatement write_milkyway multi_rule_enclose |
| 53 | syn keyword herculesStatement if error_property equate compare |
| 54 | syn keyword herculesStatement antenna_fix c_thru dev_connect_check |
| 55 | syn keyword herculesStatement dev_net_count device_count net_filter |
| 56 | syn keyword herculesStatement net_path_check ratio process_text_opens |
| 57 | |
| 58 | " Hercules keywords |
| 59 | syn keyword herculesStatement black_box_file block compare_dir equivalence |
| 60 | syn keyword herculesStatement format gdsin_dir group_dir group_dir_usage |
| 61 | syn keyword herculesStatement inlib layout_path outlib output_format |
| 62 | syn keyword herculesStatement output_layout_path schematic schematic_format |
| 63 | syn keyword herculesStatement scheme_file output_block else |
| 64 | syn keyword herculesStatement and or not xor andoverlap inside outside by to |
| 65 | syn keyword herculesStatement with connected connected_all texted_with texted |
| 66 | syn keyword herculesStatement by_property cutting edge_touch enclosing inside |
| 67 | syn keyword herculesStatement inside_hole interact touching vertex |
| 68 | |
| 69 | " Hercules comments |
| 70 | syn region herculesComment start="/\*" skip="/\*" end="\*/" contains=herculesTodo |
| 71 | syn match herculesComment "//.*" contains=herculesTodo |
| 72 | |
| 73 | " Preprocessor directives |
| 74 | syn match herculesPreProc "^#.*" |
| 75 | syn match herculesPreProc "^@.*" |
| 76 | syn match herculesPreProc "macros" |
| 77 | |
| 78 | " Hercules COMMENT option |
| 79 | syn match herculesCmdCmnt "comment.*=.*" |
| 80 | |
| 81 | " Spacings, Resolutions, Ranges, Ratios, etc. |
| 82 | syn match herculesNumber "-\=\<[0-9]\+L\=\>\|0[xX][0-9]\+\>" |
| 83 | |
| 84 | " Parenthesis sanity checker |
| 85 | syn region herculesZone matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" transparent contains=ALLBUT,herculesError,herculesBraceError,herculesCurlyError |
| 86 | syn region herculesZone matchgroup=Delimiter start="{" matchgroup=Delimiter end="}" transparent contains=ALLBUT,herculesError,herculesBraceError,herculesParenError |
| 87 | syn region herculesZone matchgroup=Delimiter start="\[" matchgroup=Delimiter end="]" transparent contains=ALLBUT,herculesError,herculesCurlyError,herculesParenError |
| 88 | syn match herculesError "[)\]}]" |
| 89 | syn match herculesBraceError "[)}]" contained |
| 90 | syn match herculesCurlyError "[)\]]" contained |
| 91 | syn match herculesParenError "[\]}]" contained |
| 92 | |
| 93 | " Hercules output format |
| 94 | "syn match herculesOutput "([0-9].*)" |
| 95 | "syn match herculesOutput "([0-9].*\;.*)" |
| 96 | syn match herculesOutput "perm\s*=.*(.*)" |
| 97 | syn match herculesOutput "temp\s*=\s*" |
| 98 | syn match herculesOutput "error\s*=\s*(.*)" |
| 99 | |
| 100 | "Modify the following as needed. The trade-off is performance versus functionality. |
| 101 | syn sync lines=100 |
| 102 | |
| 103 | " Define the default highlighting. |
| 104 | " For version 5.7 and earlier: only when not done already |
| 105 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 106 | if version >= 508 || !exists("did_hercules_syntax_inits") |
| 107 | if version < 508 |
| 108 | let did_hercules_syntax_inits = 1 |
| 109 | " Default methods for highlighting. |
| 110 | command -nargs=+ HiLink hi link <args> |
| 111 | else |
| 112 | command -nargs=+ HiLink hi def link <args> |
| 113 | endif |
| 114 | |
| 115 | HiLink herculesStatement Statement |
| 116 | HiLink herculesType Type |
| 117 | HiLink herculesComment Comment |
| 118 | HiLink herculesPreProc PreProc |
| 119 | HiLink herculesTodo Todo |
| 120 | HiLink herculesOutput Include |
| 121 | HiLink herculesCmdCmnt Identifier |
| 122 | HiLink herculesNumber Number |
| 123 | HiLink herculesBraceError herculesError |
| 124 | HiLink herculesCurlyError herculesError |
| 125 | HiLink herculesParenError herculesError |
| 126 | HiLink herculesError Error |
| 127 | |
| 128 | delcommand HiLink |
| 129 | endif |
| 130 | |
| 131 | let b:current_syntax = "hercules" |
| 132 | |
| 133 | " vim: ts=8 |