From 5c75519bc841cd4ed737503d333d7b4e86a7a61a Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Wed, 7 Aug 2013 20:41:50 +0300 Subject: [PATCH] Add verilator checker for verilog. --- README.markdown | 4 +-- syntax_checkers/verilog/verilator.vim | 42 +++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 syntax_checkers/verilog/verilator.vim diff --git a/README.markdown b/README.markdown index 7c43d3fc..3227e5b0 100644 --- a/README.markdown +++ b/README.markdown @@ -32,8 +32,8 @@ Fortran, Gentoo metadata, Go, Haml, Haskell, Haxe, HSS, HTML, Java, JavaScript, JSON, LESS, LISP, LLVM intermediate language, Lua, MATLAB, NASM, Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, Puppet, Python, reStructuredText, Ruby, Rust, SASS/SCSS, Scala, Slim, Tcl, TeX, -Twig, TypeScript, Vala, VHDL, xHtml, XML, XSLT, YAML, z80, Zope page -templates, zsh. +Twig, TypeScript, Vala, Verilog, VHDL, xHtml, XML, XSLT, YAML, z80, Zope +page templates, zsh. ## Screenshot diff --git a/syntax_checkers/verilog/verilator.vim b/syntax_checkers/verilog/verilator.vim new file mode 100644 index 00000000..0bad01b3 --- /dev/null +++ b/syntax_checkers/verilog/verilator.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: verilator.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Kocha +"============================================================================ + +if exists("g:loaded_syntastic_verilog_verilator_checker") + finish +endif +let g:loaded_syntastic_verilog_verilator_checker = 1 + +if !exists('g:syntastic_verilog_compiler') + let g:syntastic_verilog_compiler = 'verilator' +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_verilog_verilator_IsAvailable() + return executable(g:syntastic_verilog_compiler) +endfunction + +if !exists('g:syntastic_verilog_compiler_options') + let g:syntastic_verilog_compiler_options = '-Wall' +endif + +function! SyntaxCheckers_verilog_verilator_GetLocList() + return syntastic#c#GetLocList('verilog', 'verilator', { + \ 'errorformat': + \ '%%%trror-%\=%\w%#: %f:%l: %m,' . + \ '%%%tarning-%\=%\w%#: %f:%l: %m', + \ 'main_flags': '--lint-only' }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'verilog', + \ 'name': 'verilator'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: