mirror of
https://github.com/amix/vimrc
synced 2025-07-09 02:25:00 +08:00
Use sources_non_forked folder for pathogen path, with sources_non_forked_fallback folder as fallback.
This commit is contained in:
@ -1,5 +0,0 @@
|
||||
" Author: suoto <andre820@gmail.com>
|
||||
" Description: Adds support for HDL Code Checker, which wraps vcom/vlog, ghdl
|
||||
" or xvhdl. More info on https://github.com/suoto/hdl_checker
|
||||
|
||||
call ale#handlers#hdl_checker#DefineLinter('verilog')
|
@ -1,43 +0,0 @@
|
||||
" Author: Masahiro H https://github.com/mshr-h
|
||||
" Description: iverilog for verilog files
|
||||
|
||||
call ale#Set('verilog_iverilog_options', '')
|
||||
|
||||
function! ale_linters#verilog#iverilog#GetCommand(buffer) abort
|
||||
return 'iverilog -t null -Wall '
|
||||
\ . ale#Var(a:buffer, 'verilog_iverilog_options')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#verilog#iverilog#Handle(buffer, lines) abort
|
||||
" Look for lines like the following.
|
||||
"
|
||||
" tb_me_top.v:37: warning: Instantiating module me_top with dangling input port 1 (rst_n) floating.
|
||||
" tb_me_top.v:17: syntax error
|
||||
" memory_single_port.v:2: syntax error
|
||||
" tb_me_top.v:17: error: Invalid module instantiation
|
||||
let l:pattern = '^[^:]\+:\(\d\+\): \(warning\|error\|syntax error\)\(: \(.\+\)\)\?'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:line = l:match[1] + 0
|
||||
let l:type = l:match[2] =~# 'error' ? 'E' : 'W'
|
||||
let l:text = l:match[2] is# 'syntax error' ? 'syntax error' : l:match[4]
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:line,
|
||||
\ 'text': l:text,
|
||||
\ 'type': l:type,
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('verilog', {
|
||||
\ 'name': 'iverilog',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'iverilog',
|
||||
\ 'command': function('ale_linters#verilog#iverilog#GetCommand'),
|
||||
\ 'callback': 'ale_linters#verilog#iverilog#Handle',
|
||||
\})
|
@ -1,60 +0,0 @@
|
||||
" Author: Masahiro H https://github.com/mshr-h
|
||||
" Description: verilator for verilog files
|
||||
|
||||
" Set this option to change Verilator lint options
|
||||
if !exists('g:ale_verilog_verilator_options')
|
||||
let g:ale_verilog_verilator_options = ''
|
||||
endif
|
||||
|
||||
function! ale_linters#verilog#verilator#GetCommand(buffer) abort
|
||||
" the path to the current file is systematically added to the search path
|
||||
return 'verilator --lint-only -Wall -Wno-DECLFILENAME '
|
||||
\ . '-I%s:h '
|
||||
\ . ale#Var(a:buffer, 'verilog_verilator_options') .' '
|
||||
\ . '%t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#verilog#verilator#Handle(buffer, lines) abort
|
||||
" Look for lines like the following.
|
||||
"
|
||||
" %Error: addr_gen.v:3: syntax error, unexpected IDENTIFIER
|
||||
" %Warning-WIDTH: addr_gen.v:26: Operator ASSIGNDLY expects 12 bits on the Assign RHS, but Assign RHS's CONST '20'h0' generates 20 bits.
|
||||
" %Warning-UNUSED: test.v:3: Signal is not used: a
|
||||
" %Warning-UNDRIVEN: test.v:3: Signal is not driven: clk
|
||||
" %Warning-UNUSED: test.v:4: Signal is not used: dout
|
||||
" %Warning-BLKSEQ: test.v:10: Blocking assignments (=) in sequential (flop or latch) block; suggest delayed assignments (<=).
|
||||
" Since version 4.032 (04/2020) verilator linter messages also contain the column number,
|
||||
" and look like:
|
||||
" %Error: /tmp/test.sv:3:1: syntax error, unexpected endmodule, expecting ';'
|
||||
"
|
||||
" to stay compatible with old versions of the tool, the column number is
|
||||
" optional in the researched pattern
|
||||
let l:pattern = '^%\(Warning\|Error\)[^:]*:\s*\([^:]\+\):\(\d\+\):\(\d\+\)\?:\? \(.\+\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:item = {
|
||||
\ 'lnum': str2nr(l:match[3]),
|
||||
\ 'text': l:match[5],
|
||||
\ 'type': l:match[1] is# 'Error' ? 'E' : 'W',
|
||||
\ 'filename': l:match[2],
|
||||
\}
|
||||
|
||||
if !empty(l:match[4])
|
||||
let l:item.col = str2nr(l:match[4])
|
||||
endif
|
||||
|
||||
call add(l:output, l:item)
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('verilog', {
|
||||
\ 'name': 'verilator',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'verilator',
|
||||
\ 'command': function('ale_linters#verilog#verilator#GetCommand'),
|
||||
\ 'callback': 'ale_linters#verilog#verilator#Handle',
|
||||
\ 'read_buffer': 0,
|
||||
\})
|
@ -1,52 +0,0 @@
|
||||
" Author: John Gentile <johncgentile17@gmail.com>
|
||||
" Description: Adds support for Mentor Graphics Questa/ModelSim `vlog` Verilog compiler/checker
|
||||
|
||||
call ale#Set('verilog_vlog_executable', 'vlog')
|
||||
" See `$ vlog -h` for more options
|
||||
call ale#Set('verilog_vlog_options', '-quiet -lint')
|
||||
|
||||
function! ale_linters#verilog#vlog#GetCommand(buffer) abort
|
||||
return '%e ' . ale#Pad(ale#Var(a:buffer, 'verilog_vlog_options')) . ' %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#verilog#vlog#Handle(buffer, lines) abort
|
||||
"Matches patterns like the following:
|
||||
"** Warning: add.v(7): (vlog-2623) Undefined variable: C.
|
||||
"** Error: file.v(1): (vlog-13294) Identifier must be declared with a port mode: C.
|
||||
let l:pattern = '^**\s\(\w*\): \([a-zA-Z0-9\-\.\_\/ ]\+\)(\(\d\+\)):\s\+\(.*\)'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[3] + 0,
|
||||
\ 'type': l:match[1] is? 'Error' ? 'E' : 'W',
|
||||
\ 'text': l:match[4],
|
||||
\ 'filename': l:match[2],
|
||||
\})
|
||||
endfor
|
||||
|
||||
"Matches patterns like the following:
|
||||
"** Warning: (vlog-2623) add.v(7): Undefined variable: C.
|
||||
"** Error: (vlog-13294) file.v(1): Identifier must be declared with a port mode: C.
|
||||
" let l:pattern = '^**\s\(\w*\):[a-zA-Z0-9\-\.\_\/ ]\+(\(\d\+\)):\s\+\(.*\)'
|
||||
let l:pattern = '^**\s\(\w*\):\s\([^)]*)\) \([a-zA-Z0-9\-\.\_\/ ]\+\)(\(\d\+\)):\s\+\(.*\)'
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[4] + 0,
|
||||
\ 'type': l:match[1] is? 'Error' ? 'E' : 'W',
|
||||
\ 'text': l:match[2] . ' ' . l:match[5],
|
||||
\ 'filename': l:match[3],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('verilog', {
|
||||
\ 'name': 'vlog',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': {b -> ale#Var(b, 'verilog_vlog_executable')},
|
||||
\ 'command': function('ale_linters#verilog#vlog#GetCommand'),
|
||||
\ 'callback': 'ale_linters#verilog#vlog#Handle',
|
||||
\})
|
@ -1,35 +0,0 @@
|
||||
" Author: John Gentile <johncgentile17@gmail.com>
|
||||
" Description: Adds support for Xilinx Vivado `xvlog` Verilog compiler/checker
|
||||
|
||||
call ale#Set('verilog_xvlog_executable', 'xvlog')
|
||||
call ale#Set('verilog_xvlog_options', '')
|
||||
|
||||
function! ale_linters#verilog#xvlog#GetCommand(buffer) abort
|
||||
return '%e ' . ale#Pad(ale#Var(a:buffer, 'verilog_xvlog_options')) . ' %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#verilog#xvlog#Handle(buffer, lines) abort
|
||||
"Matches patterns like the following:
|
||||
" ERROR: [VRFC 10-1412] syntax error near output [/path/to/file.v:5]
|
||||
let l:pattern = '^ERROR:\s\+\(\[.*\)\[.*:\([0-9]\+\)\]'
|
||||
let l:output = []
|
||||
|
||||
" NOTE: `xvlog` only prints 'INFO' and 'ERROR' messages
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'type': 'E',
|
||||
\ 'text': l:match[1],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('verilog', {
|
||||
\ 'name': 'xvlog',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': {b -> ale#Var(b, 'verilog_xvlog_executable')},
|
||||
\ 'command': function('ale_linters#verilog#xvlog#GetCommand'),
|
||||
\ 'callback': 'ale_linters#verilog#xvlog#Handle',
|
||||
\})
|
@ -1,42 +0,0 @@
|
||||
" Author: Nathan Sharp <nwsharp+eda@live.com>
|
||||
" Description: Yosys for Verilog files
|
||||
|
||||
call ale#Set('verilog_yosys_executable', 'yosys')
|
||||
call ale#Set('verilog_yosys_options', '-Q -T -p ''read_verilog %s''')
|
||||
|
||||
function! ale_linters#verilog#yosys#GetCommand(buffer) abort
|
||||
return '%e ' . ale#Var(a:buffer, 'verilog_yosys_options') . ' 2>&1'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#verilog#yosys#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
let l:path = fnamemodify(bufname(a:buffer), ':p')
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, '^\([^:]\+\):\(\d\+\): \(WARNING\|ERROR\): \(.\+\)$')
|
||||
call add(l:output, {
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'text': l:match[4],
|
||||
\ 'type': l:match[3][0],
|
||||
\ 'filename': l:match[1],
|
||||
\})
|
||||
endfor
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, '^\(Warning\|ERROR\): \(.\+\)$')
|
||||
call add(l:output, {
|
||||
\ 'lnum': 1,
|
||||
\ 'text': l:match[2],
|
||||
\ 'type': l:match[1][0],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('verilog', {
|
||||
\ 'name': 'yosys',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': {b -> ale#Var(b, 'verilog_yosys_executable')},
|
||||
\ 'command': function('ale_linters#verilog#yosys#GetCommand'),
|
||||
\ 'callback': 'ale_linters#verilog#yosys#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
Reference in New Issue
Block a user