Skip to content

Commit

Permalink
makefile: replace error with fwrite (#152)
Browse files Browse the repository at this point in the history
Verilator will abort the simulation if $error is triggered.
  • Loading branch information
poemonsense authored Dec 9, 2023
1 parent 4cfa831 commit 4bb506b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ SPLIT_VERILOG = 0

ifneq (,$(filter 3%,$(CHISEL_VERSION)))
MILL_ARGS += --output-file $(@F)
FPGA_ARGS += --infer-rw $(FPGATOP) --repl-seq-mem -c:$(FPGATOP):-o:$(@D)/$(@F).conf
else
FPGA_ARGS += --infer-rw $(FPGATOP) --repl-seq-mem -c:$(FPGATOP):-o:$(@D)/$(@F).conf
else
SPLIT_VERILOG = 1
endif

Expand Down Expand Up @@ -74,6 +74,9 @@ $(SIM_TOP_V): $(SCALA_FILE) $(TEST_FILE)
mkdir -p $(@D)
mill -i generator[$(CHISEL_VERSION)].test.runMain $(SIMTOP) $(MILL_ARGS)
@sed -i 's/$$fatal/xs_assert(`__LINE__)/g' $(SIM_TOP_V)
ifeq ($(MFC), 1)
@sed -i -e "s/\$$error(/\$$fwrite(32\'h80000002, /g" $(SIM_TOP_V)
endif
ifeq ($(SPLIT_VERILOG), 1)
@cd $(BUILD_DIR) && bash ../scripts/extract_files.sh $(SIM_TOP_V)
endif
Expand Down

0 comments on commit 4bb506b

Please sign in to comment.