Add explicit module search path to the verilator linter (#5000)

Adds the origin file directory as a module search path.
This is the default behaviour, this commit makes it explicit.

Note from the doc:

'-I' -> include search path
'-y' -> module search path

The space after '-y' seems mandatory, at least when I tested it with
vresion 5.032-46-g447ab12ce
This commit is contained in:
Tarik Graba
2025-07-20 12:15:15 +02:00
committed by GitHub
parent c8890af8d4
commit 0d1d0a9f81
2 changed files with 3 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ 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 '
\ . '-y %s:h '
\ . ale#Var(a:buffer, 'verilog_verilator_options') .' '
\ . '%t'
endfunction

View File

@@ -5,10 +5,10 @@ After:
call ale#assert#TearDownLinterTest()
Execute(The default verilator command should be correct):
AssertLinter 'verilator', 'verilator --lint-only -Wall -Wno-DECLFILENAME -I%s:h %t'
AssertLinter 'verilator', 'verilator --lint-only -Wall -Wno-DECLFILENAME -I%s:h -y %s:h %t'
Execute(verilator options should be configurable):
" Additional args for the linter
let g:ale_verilog_verilator_options = '-sv --default-language "1800-2012"'
AssertLinter 'verilator', 'verilator --lint-only -Wall -Wno-DECLFILENAME -I%s:h -sv --default-language "1800-2012" %t'
AssertLinter 'verilator', 'verilator --lint-only -Wall -Wno-DECLFILENAME -I%s:h -y %s:h -sv --default-language "1800-2012" %t'