Skip to content

Commit

Permalink
icarus: Add vvp_options
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Oct 13, 2022
1 parent 5f3ec5b commit b02e3eb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
12 changes: 11 additions & 1 deletion edalize/icarus.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
iverilog -s$(TOPLEVEL) -c $(TARGET).scr -o $@ $(IVERILOG_OPTIONS)
run: $(VPI_MODULES) $(TARGET)
vvp -n -M. -l icarus.log $(patsubst %.vpi,-m%,$(VPI_MODULES)) $(TARGET) -fst $(EXTRA_OPTIONS)
vvp -n -M. -l icarus.log $(patsubst %.vpi,-m%,$(VPI_MODULES)) $(VVP_OPTIONS) $(TARGET) -fst $(EXTRA_OPTIONS)
clean:
$(RM) $(VPI_MODULES) $(TARGET)
Expand Down Expand Up @@ -53,6 +53,11 @@ def get_doc(cls, api_ver):
"type": "String",
"desc": "Additional options for iverilog",
},
{
"name": "vvp_options",
"type": "String",
"desc": "Additional options for vvp",
},
],
}

Expand Down Expand Up @@ -110,6 +115,11 @@ def configure_main(self):
" ".join(self.tool_options.get("iverilog_options", []))
)
)
f.write(
"VVP_OPTIONS := {}\n".format(
" ".join(self.tool_options.get("vvp_options", []))
)
)
if self.plusarg:
plusargs = []
for key, value in self.plusarg.items():
Expand Down
3 changes: 2 additions & 1 deletion tests/test_icarus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ TARGET := test_icarus_0
VPI_MODULES := vpi1.vpi vpi2.vpi
TOPLEVEL := top_module
IVERILOG_OPTIONS := some iverilog_options
VVP_OPTIONS :=
EXTRA_OPTIONS ?= +plusarg_bool=1 +plusarg_int=42 +plusarg_str=hello

all: $(VPI_MODULES) $(TARGET)
Expand All @@ -10,7 +11,7 @@ $(TARGET):
iverilog -s$(TOPLEVEL) -c $(TARGET).scr -o $@ $(IVERILOG_OPTIONS)

run: $(VPI_MODULES) $(TARGET)
vvp -n -M. -l icarus.log $(patsubst %.vpi,-m%,$(VPI_MODULES)) $(TARGET) -fst $(EXTRA_OPTIONS)
vvp -n -M. -l icarus.log $(patsubst %.vpi,-m%,$(VPI_MODULES)) $(VVP_OPTIONS) $(TARGET) -fst $(EXTRA_OPTIONS)

clean:
$(RM) $(VPI_MODULES) $(TARGET)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_icarus/minimal/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
TARGET := test_icarus_minimal_0
TOPLEVEL := top
IVERILOG_OPTIONS :=
VVP_OPTIONS :=

all: $(VPI_MODULES) $(TARGET)

$(TARGET):
iverilog -s$(TOPLEVEL) -c $(TARGET).scr -o $@ $(IVERILOG_OPTIONS)

run: $(VPI_MODULES) $(TARGET)
vvp -n -M. -l icarus.log $(patsubst %.vpi,-m%,$(VPI_MODULES)) $(TARGET) -fst $(EXTRA_OPTIONS)
vvp -n -M. -l icarus.log $(patsubst %.vpi,-m%,$(VPI_MODULES)) $(VVP_OPTIONS) $(TARGET) -fst $(EXTRA_OPTIONS)

clean:
$(RM) $(VPI_MODULES) $(TARGET)

0 comments on commit b02e3eb

Please sign in to comment.