Skip to content

Commit 699c0db

Browse files
authored
iverilog current file search path (#4907)
In the vein of commit ea72d66 "Verilator current file search path (#3500)" This includes the directory of the current file in the library search path. From `man iverilog`: -ylibdir Append the directory to the library module search path. When the compiler finds an undefined module, it looks in these directories for files with the right name.
1 parent ce2b002 commit 699c0db

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ale_linters/verilog/iverilog.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ call ale#Set('verilog_iverilog_options', '')
55

66
function! ale_linters#verilog#iverilog#GetCommand(buffer) abort
77
return 'iverilog -t null -Wall '
8+
\ . '-y%s:h '
89
\ . ale#Var(a:buffer, 'verilog_iverilog_options')
910
\ . ' %t'
1011
endfunction

test/linter/test_iverilog.vader

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ After:
55
call ale#assert#TearDownLinterTest()
66

77
Execute(The default iverilog command should be correct):
8-
AssertLinter 'iverilog', 'iverilog -t null -Wall %t'
8+
AssertLinter 'iverilog', 'iverilog -t null -Wall -y%s:h %t'
99

1010
Execute(iverilog options should be configurable):
1111
" Additional args for the linter
1212
let g:ale_verilog_iverilog_options = '-y.'
1313

14-
AssertLinter 'iverilog', 'iverilog -t null -Wall -y. %t'
14+
AssertLinter 'iverilog', 'iverilog -t null -Wall -y%s:h -y. %t'

0 commit comments

Comments
 (0)