GHDL ?= ghdl
GHDLFLAGS=--std=08 -frelaxed
CFLAGS=-O3 -Wall
+
+ifeq ($(shell uname -m),ppc64le)
+CFLAG_ARCH_OPT=-mcpu=native
+else
+CFLAG_ARCH_OPT=-march=native
+endif
+
+CFLAGS=-O3 -Wall $(CFLAG_ARCH_OPT) -mtune=native
CXXFLAGS=-g -g
GHDLSYNTH ?= ghdl.so
$(YOSYS) -m $(GHDLSYNTH) -p "ghdl --std=08 --no-formal $(GHDL_IMAGE_GENERICS) $(GHDL_TARGET_GENERICS) $(synth_files) -e toplevel; write_verilog $@"
THREADS=1 # How many threads should be used for verilator binary
+THREADS=3 # How many threads should be used for verilator binary, 3 is optimal
# Need to investigate why yosys is hitting verilator warnings, and eventually turn on -Wall
# --top-module toplevel
microwatt-verilator: microwatt.v verilator/microwatt-verilator.cpp verilator/uart-verilator.c
-Wno-WIDTH \
--savable \
--trace \
+ --threads-dpi all --x-initial fast \
+ -CFLAGS $(CFLAG_ARCH_OPT) \
+ -CFLAGS -mtune=native \
+ -CFLAGS -O3 \
+ # -CFLAGS -flto #disabled for now, no measured performance benefit \
# --unroll-count 256 \
# --output-split 5000 \
# --output-split-cfuncs 500 \