diff --git a/emulator/Makefrag-verilator b/emulator/Makefrag-verilator index cb85c80a433..1dcfa46462f 100644 --- a/emulator/Makefrag-verilator +++ b/emulator/Makefrag-verilator @@ -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 \ @@ -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)