diff --git a/edalize/tools/verilator.py b/edalize/tools/verilator.py index 91c579048..7ea8cc4e6 100644 --- a/edalize/tools/verilator.py +++ b/edalize/tools/verilator.py @@ -20,6 +20,7 @@ class Verilator(Edatool): "make_options": { "type": "str", "desc": "Additional arguments passed to make when compiling the simulation. This is commonly used to set OPT/OPT_FAST/OPT_SLOW.", + "list": True, }, "mode": { "type": "str", diff --git a/tests/test_tool_verilator.py b/tests/test_tool_verilator.py index 01ea6d776..8e67075e7 100644 --- a/tests/test_tool_verilator.py +++ b/tests/test_tool_verilator.py @@ -2,7 +2,26 @@ def test_tool_verilator(tool_fixture): - tf = tool_fixture("verilator") + + tool_options = { + "make_options": ["a", "few", "make", "options"], + "verilator_options": ["some", "verilator", "options"], + } + + tf = tool_fixture("verilator", tool_options=tool_options) + + name = "design" + + tf.tool.configure() + tf.compare_config_files( + [ + name + ".vc", + ] + ) + + +def test_tool_verilator_minimal(tool_fixture): + tf = tool_fixture("verilator", ref_subdir="minimal") name = "design" diff --git a/tests/tools/verilator/Makefile b/tests/tools/verilator/Makefile index c85b33918..0a2b7dcd5 100644 --- a/tests/tools/verilator/Makefile +++ b/tests/tools/verilator/Makefile @@ -6,4 +6,4 @@ Vtop_module.mk: design.vc sv_file.sv vlog_file.v vlog05_file.v vlog_incfile anot $(EDALIZE_LAUNCHER) verilator -f design.vc Vtop_module: Vtop_module.mk c_file.c cpp_file.cpp - $(EDALIZE_LAUNCHER) make -f Vtop_module.mk + $(EDALIZE_LAUNCHER) make -f Vtop_module.mk a few make options diff --git a/tests/tools/verilator/design.vc b/tests/tools/verilator/design.vc index 4841b4a88..1396204d2 100644 --- a/tests/tools/verilator/design.vc +++ b/tests/tools/verilator/design.vc @@ -1,5 +1,8 @@ --Mdir . --cc +some +verilator +options +incdir+. -CFLAGS -I. sv_file.sv diff --git a/tests/tools/verilator/minimal/Makefile b/tests/tools/verilator/minimal/Makefile new file mode 100644 index 000000000..c85b33918 --- /dev/null +++ b/tests/tools/verilator/minimal/Makefile @@ -0,0 +1,9 @@ +#Auto generated by Edalize + +all: Vtop_module + +Vtop_module.mk: design.vc sv_file.sv vlog_file.v vlog05_file.v vlog_incfile another_sv_file.sv + $(EDALIZE_LAUNCHER) verilator -f design.vc + +Vtop_module: Vtop_module.mk c_file.c cpp_file.cpp + $(EDALIZE_LAUNCHER) make -f Vtop_module.mk diff --git a/tests/tools/verilator/minimal/design.vc b/tests/tools/verilator/minimal/design.vc new file mode 100644 index 000000000..4841b4a88 --- /dev/null +++ b/tests/tools/verilator/minimal/design.vc @@ -0,0 +1,19 @@ +--Mdir . +--cc ++incdir+. +-CFLAGS -I. +sv_file.sv +vlog_file.v +vlog05_file.v +another_sv_file.sv +--top-module top_module + +--exe +c_file.c +cpp_file.cpp +-Gvlogparam_bool=1 +-Gvlogparam_int=42 +-Gvlogparam_str=\"hello\" +-Dvlogdefine_bool=1 +-Dvlogdefine_int=42 +-Dvlogdefine_str=hello