Skip to content

Commit 20f43f8

Browse files
committed
Fix verilator lint mode in flow API
1 parent 25f375e commit 20f43f8

File tree

4 files changed

+49
-1
lines changed

4 files changed

+49
-1
lines changed

edalize/tools/verilator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def setup(self, edam):
140140
"preprocess-only",
141141
"xml-only",
142142
]:
143-
commands.set_default_target(mode)
143+
commands.set_default_target(mk_file)
144144
else:
145145
commands.add(
146146
["make", "-f", mk_file] + self.tool_options.get("make_options", []),

tests/flows/lint/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#Auto generated by Edalize
2+
3+
all: post_build
4+
5+
pre_build:
6+
7+
Vtop_module.mk: design.vc sv_file.sv vlog_file.v vlog05_file.v vlog_incfile another_sv_file.sv | pre_build
8+
$(EDALIZE_LAUNCHER) verilator -f design.vc
9+
10+
post_build: Vtop_module.mk
11+
12+
pre_run:
13+
14+
run: pre_run
15+
16+
post_run: run

tests/flows/lint/design.vc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--Mdir .
2+
--lint-only
3+
+incdir+.
4+
-CFLAGS -I.
5+
sv_file.sv
6+
vlog_file.v
7+
vlog05_file.v
8+
another_sv_file.sv
9+
--top-module top_module
10+
11+
c_file.c
12+
cpp_file.cpp
13+
-Gvlogparam_bool=1
14+
-Gvlogparam_int=42
15+
-Gvlogparam_str=\"hello\"
16+
-Dvlogdefine_bool=1
17+
-Dvlogdefine_int=42
18+
-Dvlogdefine_str=hello

tests/test_flow_lint.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from .edalize_flow_common import flow_fixture
2+
3+
4+
def test_lint(flow_fixture):
5+
flow_options = {"tool": "verilator"}
6+
ff = flow_fixture("lint", flow_options=flow_options)
7+
8+
ff.flow.configure()
9+
ff.compare_config_files(
10+
[
11+
"design.vc",
12+
"Makefile",
13+
]
14+
)

0 commit comments

Comments
 (0)