Skip to content

Commit

Permalink
Set Verilator's --max-num-width to 1048576.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardxia committed Mar 30, 2020
1 parent cdcf617 commit aca2ac7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion emulator/Makefrag-verilator
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ verilator: $(INSTALLED_VERILATOR)
# Run Verilator to produce a fast binary to emulate this circuit.
VERILATOR := $(INSTALLED_VERILATOR) --cc --exe
VERILATOR_THREADS ?= 2
# --max-num-width is set to 1024^2 to avoid an error with compiling a Verilated
# circuit with a width greater than the default of 65536, which can easily
# happen with Chisel-generated Verilog code. See
# https://github.com/chipsalliance/rocket-chip/pull/2377#issuecomment-605846516
VERILATOR_FLAGS := --top-module $(MODEL) \
+define+PRINTF_COND=\$$c\(\"verbose\",\"\&\&\"\,\"done_reset\"\) \
+define+RANDOMIZE_GARBAGE_ASSIGN \
Expand All @@ -69,7 +73,8 @@ VERILATOR_FLAGS := --top-module $(MODEL) \
--threads $(VERILATOR_THREADS) -Wno-UNOPTTHREADS \
-Wno-STMTDLY --x-assign unique \
-I$(vsrc) \
-O3 -CFLAGS "$(CXXFLAGS) -DVERILATOR -DTEST_HARNESS=V$(MODEL) -include $(csrc)/verilator.h -include $(generated_dir)/$(PROJECT).$(CONFIG).plusArgs"
-O3 -CFLAGS "$(CXXFLAGS) -DVERILATOR -DTEST_HARNESS=V$(MODEL) -include $(csrc)/verilator.h -include $(generated_dir)/$(PROJECT).$(CONFIG).plusArgs" \
--max-num-width 1048576
cppfiles = $(addprefix $(csrc)/, $(addsuffix .cc, $(CXXSRCS)))
headers = $(wildcard $(csrc)/*.h)

Expand Down

0 comments on commit aca2ac7

Please sign in to comment.