( ESNUG 326 Item 13 ) --------------------------------------------- [8/25/99]

From: Beth Leonard <beth@cdc.hp.com>
Subject: Links To The VIM Homepages And Hewlett-Packard's VERA VIM Syntax

Hi, John,

For those who don't know what VIM is, it's a vi-like editor with color
syntax highlighting.  More information about vim is available from:

         <http://www.vim.org/>

More information about maintaining/tweaking  syntax files is located at:

         <http://www.vim.org/howto/synmain.html>


I've modified a vim syntax file to cover the Vera.

Several groups within HP are using this file, and I'd like to make it
generally available to the ESNUG community.

    - Beth Leonard
      Hewlett-Packard


" Vim syntax file
" Language:     Vera
" Maintainer:   Beth Leonard <beth@cdc.hp.com>
" Last Update:  Tuesday June 29, 1999 
"
" Vera is a Hardware Verification Language sold by Synopsys.
"
" History:
"               Mark Madsen leveraged this from Verilog syntax file 
"               Beth Leonard added some enhancements

syn clear

" A bunch of useful Vera keywords
syn keyword veraStatement      all any async begin bind bind_var
syn keyword veraStatement      bit break breakpoint case class continue
syn keyword veraStatement      coverage_block default depth else end enum event
syn keyword veraStatement      extern extends for fork function if illegal_state
syn keyword veraStatement      illegal_transation illegal_self_transition inout 
syn keyword veraStatement      input integer interface
syn keyword veraStatement      join local negedge new
syn keyword veraStatement      none null output port posedge program reg
syn keyword veraStatement      repeat return shadow soft state static string
syn keyword veraStatement      super task terminate this trans typedef
syn keyword veraStatement      var vector verilog_node verilog_task
syn keyword veraStatement      vhdl_node vhdl_task virtual
syn keyword veraStatement      void while with CLOCK

syn keyword veraLabel          begin end fork join
syn keyword veraConditional    if else case default 
syn keyword veraRepeat        forever repeat while for

" predefined vera tasks
syn keyword veraTask            alloc call_func call_task cast_assign 
syn keyword veraTask            close_conn delay error error_mode exit 
syn keyword veraTask            fclose fflush flag fopen fprintf freadb 
syn keyword veraTask            freadh freadstr get_bind get_bind_id 
syn keyword veraTask            get_conn_err get_cycle get_plus_arg 
syn keyword veraTask            get_systime get_time mailbox_get 
syn keyword veraTask            mailbox_put make_client make_server 
syn keyword veraTask            printf rand48 random region_enter 
syn keyword veraTask            region_exit rewind semaphore_get 
syn keyword veraTask            semaphore_put sprintf sscanf stop 
syn keyword veraTask            sync timeout trace trigger unit_delay 
syn keyword veraTask            up_connections urand48 urandom vsv_call_func 
syn keyword veraTask            vsv_call_task vsv_close_conn vsv_get_conn_err 
syn keyword veraTask            vsv_make_client vsv_make_server 
syn keyword veraTask            vsv_up_connections vsv_wait_for_done 
syn keyword veraTask            vsv_wait_for_input wait_child wait_var

syn keyword veraTodo contained TODO

syn match   veraOperator "[&|~><!)(*#%@+/=?:;}{,.\^\-\[\]]"

syn region  veraComment start="/\*" end="\*/"
syn match   veraComment "//.*"

syn match   veraGlobal "`[a-zA-Z0-9_]\+\>"
syn match   veraGlobal "$[a-zA-Z0-9_]\+\>"

syn match   veraConstant "\<[A-Z][A-Z0-9_]\+\>"

syn match   veraNumber "\(\<[0-9]\+\|\)'[bdh][0-9a-fxzA-F]\+\>"
syn match   veraNumber "\<[+-]\=[0-9]\+\>"

syn region  veraString start=+"+  end=+"+

" predefined vera constants
syn keyword veraConst           stderr stdin stdout ALL ANY BAD_STATE 
syn keyword veraConst           BAD_TRANS CHECK CHGEDGE CLEAR CROSS 
syn keyword veraConst           CROSS_TRANS DEBUG DELETE EC_ARRAYX 
syn keyword veraConst           EC_NEXPECT EC_RETURN EC_RHNTMOUT 
syn keyword veraConst           EC_SCONFLICT EC_SEMTMOUT EC_SEXPECT 
syn keyword veraConst           EC_SFULLEXPECT EC_SNEXTPECT EC_USERET 
syn keyword veraConst           EQ EVENT FIRST GE GOAL GT LIC_EXIT 
syn keyword veraConst           LIC_PRERR LIC_PRWARN LIC_WAIT LO LOAD 
syn keyword veraConst           LOW LT MAILBOX NAME NEGEDGE NEXT 
syn keyword veraConst           NO_OVERLAP NO_WAIT NUM ORDER POSEDGE 
syn keyword veraConst           PROGRAM RAWIN REGION REPORT SAVE 
syn keyword veraConst           SEMAPHORE SET SILENT STATE STR 
syn keyword veraConst           STR_ERR_OUT_OF_RANGE 
syn keyword veraConst           STR_ERR_REGEXP_SYNTAX SUM 
syn keyword veraConst           EC_CODE_END EC_CONFLICT EC_EXPECT 
syn keyword veraConst           EC_FULLEXPECT EC_MBXTMOUT HAND_SHAKE HI 
syn keyword veraConst           HIGH HNUM LE NUM_BIN OFF ON ONE_BLAST 
syn keyword veraConst           ONE_SHOT TRANS VERBOSE WAIT

"copied these from the c.vim file and modified
syn region veraPreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=veraComment,veraString,veraCharacter,veraNumber
syn region veraIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
syn match veraIncluded contained "<[^>]*>"
syn match veraInclude           "^\s*#\s*include\>\s*["<]" contains=veraIncluded
"syn match veraLineSkip "\\$"
syn region veraDefine           start="^\s*#\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,veraPreCondit,veraIncluded,veraInclude,veraDefine
syn region veraPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,veraPreCondit,veraIncluded,veraInclude,veraDefine

"Modify the following as needed.  The trade-off is performance versus
"functionality.
syn sync lines=50

if !exists("did_vera_syntax_inits")
  let did_vera_syntax_inits = 1
 " The default methods for highlighting.  Can be overridden later

  hi link veraCharacter       Character
  hi link veraConditional     Conditional
  hi link veraRepeat          Repeat
  hi link veraString          String
  hi link veraTodo            Todo

  hi link veraDefine    Macro
  hi link veraInclude   Include
  hi link veraIncluded  cString
  hi link veraComment   Comment
  hi link veraConstant  Todo
  hi link veraLabel     PreCondit
  hi link veraPreCondit PreCondit
  hi link veraNumber    Special
  hi link veraOperator  Type
  hi link veraStatement Statement
  hi link veraGlobal    String
  hi link veraTask      Statement
  hi link veraConst     Statement
endif

let b:current_syntax = "vera"

" vim: ts=8



 Sign up for the DeepChip newsletter.
Email
 Read what EDA tool users really think.


Feedback About Wiretaps ESNUGs SIGN UP! Downloads Trip Reports Advertise

"Relax. This is a discussion. Anything said here is just one engineer's opinion. Email in your dissenting letter and it'll be published, too."
This Web Site Is Modified Every 2-3 Days
Copyright 1991-2024 John Cooley.  All Rights Reserved.
| Contact John Cooley | Webmaster | Legal | Feedback Form |

   !!!     "It's not a BUG,
  /o o\  /  it's a FEATURE!"
 (  >  )
  \ - / 
  _] [_     (jcooley 1991)