Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match filename in xvlog linter and add tip #4764

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions ale_linters/verilog/xvlog.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ 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:pattern = '^\(WARNING\|ERROR\|INFO\):\s\+\(\[.*\)\[\(.*\):\([0-9]\+\)\]'
let l:output = []
let l:dir = expand('#' . a:buffer . ':p:h')

" NOTE: `xvlog` only prints 'INFO' and 'ERROR' messages
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:fname = ale#path#GetAbsPath(l:dir, l:match[3])
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'type': 'E',
\ 'text': l:match[1],
\ 'filename': l:fname,
\ 'lnum': l:match[4] + 0,
\ 'type': l:match[1][0],
\ 'text': l:match[2],
\})
endfor

Expand Down
3 changes: 3 additions & 0 deletions doc/ale-verilog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ g:ale_verilog_xvlog_options *g:ale_verilog_xvlog_options*
Default: `''`

This variable can be changed to modify the flags/options passed to 'xvlog'.
Vivado generates a 'compile.sh' file in the xsim directory with the flags you
are probably looking for. Note, however, that you may need to change the
relative paths in the Project File '.prj'.


===============================================================================
Expand Down