2013-08-07 13:41:50 -04:00
|
|
|
"============================================================================
|
|
|
|
"File: verilator.vim
|
|
|
|
"Description: Syntax checking plugin for syntastic.vim
|
|
|
|
"Maintainer: Kocha <kocha dot lsifrontend at gmail dot com>
|
|
|
|
"============================================================================
|
|
|
|
|
|
|
|
if exists("g:loaded_syntastic_verilog_verilator_checker")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let g:loaded_syntastic_verilog_verilator_checker = 1
|
|
|
|
|
2014-02-08 02:45:51 -05:00
|
|
|
if !exists('g:syntastic_verilog_compiler_options')
|
|
|
|
let g:syntastic_verilog_compiler_options = '-Wall'
|
2013-08-07 13:41:50 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
let s:save_cpo = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
2013-10-28 11:30:25 -04:00
|
|
|
function! SyntaxCheckers_verilog_verilator_IsAvailable() dict
|
2014-02-08 02:45:51 -05:00
|
|
|
if !exists('g:syntastic_verilog_compiler')
|
|
|
|
let g:syntastic_verilog_compiler = self.getExec()
|
|
|
|
endif
|
2014-10-06 15:15:44 -04:00
|
|
|
call self.log('g:syntastic_verilog_compiler =', g:syntastic_verilog_compiler)
|
2015-01-04 02:01:55 -05:00
|
|
|
return executable(expand(g:syntastic_verilog_compiler, 1))
|
2013-08-07 13:41:50 -04:00
|
|
|
endfunction
|
|
|
|
|
2013-10-28 07:53:33 -04:00
|
|
|
function! SyntaxCheckers_verilog_verilator_GetLocList() dict
|
2013-08-07 13:41:50 -04:00
|
|
|
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',
|
2014-02-08 02:45:51 -05:00
|
|
|
\ 'name': 'verilator' })
|
2013-08-07 13:41:50 -04:00
|
|
|
|
|
|
|
let &cpo = s:save_cpo
|
|
|
|
unlet s:save_cpo
|
|
|
|
|
2015-01-04 05:46:54 -05:00
|
|
|
" vim: set sw=4 sts=4 et fdm=marker:
|