Skip to content

Commit

Permalink
icarus: Fix missing vvp_options
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Apr 18, 2023
1 parent 19736c9 commit 246fb3e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
8 changes: 7 additions & 1 deletion edalize/tools/icarus.py
Expand Up @@ -22,6 +22,10 @@ class Icarus(Edatool):
"type": "str",
"desc": "Additional options for iverilog",
},
"vvp_options": {
"type": "str",
"desc": "Additional options for vvp",
},
}

def setup(self, edam):
Expand Down Expand Up @@ -100,7 +104,9 @@ def setup(self, edam):
# How should the run target be handled?
# Add VPI support
commands.add(
["vvp", "-n", "-M.", self.name, "-fst", "$(EXTRA_OPTIONS)"],
["vvp", "-n", "-M."]
+ self.tool_options.get("vvp_options", [])
+ [self.name, "-fst", "$(EXTRA_OPTIONS)"],
["run"],
[self.name],
)
Expand Down
7 changes: 6 additions & 1 deletion tests/test_tool_icarus.py
Expand Up @@ -4,7 +4,12 @@
def test_tool_icarus(tool_fixture):
tool_name = "icarus"

tf = tool_fixture(tool_name)
tool_options = {
"timescale": "1ns/1ps",
"iverilog_options": ["a", "few", "iverilog", "options"],
"vvp_options": ["some", "vvp", "options"],
}
tf = tool_fixture(tool_name, tool_options=tool_options)

tf.tool.configure()
tf.compare_config_files(["design.scr"])
Expand Down
4 changes: 2 additions & 2 deletions tests/tools/icarus/Makefile
Expand Up @@ -3,7 +3,7 @@
all: design

design: sv_file.sv vlog_file.v vlog05_file.v vlog_incfile another_sv_file.sv design.scr
$(EDALIZE_LAUNCHER) iverilog -stop_module -c design.scr -o design
$(EDALIZE_LAUNCHER) iverilog -stop_module -c design.scr -o design a few iverilog options

run: design
$(EDALIZE_LAUNCHER) vvp -n -M. design -fst $(EXTRA_OPTIONS)
$(EDALIZE_LAUNCHER) vvp -n -M. some vvp options design -fst $(EXTRA_OPTIONS)
1 change: 1 addition & 0 deletions tests/tools/icarus/design.scr
Expand Up @@ -4,6 +4,7 @@
+parameter+top_module.vlogparam_bool=1
+parameter+top_module.vlogparam_int=42
+parameter+top_module.vlogparam_str="hello"
timescale.v
+incdir+.
sv_file.sv
vlog_file.v
Expand Down

0 comments on commit 246fb3e

Please sign in to comment.