+ Microarchitecture optimizations + 64-bit support + Xilinx FPGA support + LLVM-16 support + Refactoring and quality control fixes minor update minor update minor update minor update minor update minor update cleanup cleanup cache bindings and memory perf refactory minor update minor update hw unit tests fixes minor update minor update minor update minor update minor update minor udpate minor update minor update minor update minor update minor update minor update minor update minor updates minor updates minor update minor update minor update minor update minor update minor update minor updates minor updates minor updates minor updates minor update minor update
98 lines
3.2 KiB
Makefile
98 lines
3.2 KiB
Makefile
XLEN ?= 32
|
|
DESTDIR ?= .
|
|
RTL_DIR = ../../hw/rtl
|
|
DPI_DIR = ../../hw/dpi
|
|
THIRD_PARTY_DIR = ../../third_party
|
|
|
|
CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors -Wno-array-bounds
|
|
CXXFLAGS += -fPIC -Wno-maybe-uninitialized
|
|
CXXFLAGS += -I../../../hw -I../../common
|
|
CXXFLAGS += -I../$(THIRD_PARTY_DIR)/softfloat/source/include
|
|
CXXFLAGS += -I../$(THIRD_PARTY_DIR)
|
|
CXXFLAGS += -DXLEN_$(XLEN)
|
|
|
|
LDFLAGS += ../$(THIRD_PARTY_DIR)/softfloat/build/Linux-x86_64-GCC/softfloat.a
|
|
LDFLAGS += -L../$(THIRD_PARTY_DIR)/ramulator -lramulator
|
|
|
|
# control RTL debug tracing states
|
|
DBG_TRACE_FLAGS += -DDBG_TRACE_CORE_PIPELINE
|
|
DBG_TRACE_FLAGS += -DDBG_TRACE_CORE_ICACHE
|
|
DBG_TRACE_FLAGS += -DDBG_TRACE_CORE_DCACHE
|
|
DBG_TRACE_FLAGS += -DDBG_TRACE_CORE_MEM
|
|
DBG_TRACE_FLAGS += -DDBG_TRACE_CACHE_BANK
|
|
DBG_TRACE_FLAGS += -DDBG_TRACE_CACHE_MSHR
|
|
DBG_TRACE_FLAGS += -DDBG_TRACE_CACHE_TAG
|
|
DBG_TRACE_FLAGS += -DDBG_TRACE_CACHE_DATA
|
|
DBG_TRACE_FLAGS += -DDBG_TRACE_AFU
|
|
DBG_TRACE_FLAGS += -DDBG_TRACE_SCOPE
|
|
DBG_TRACE_FLAGS += -DDBG_TRACE_GBAR
|
|
|
|
DBG_FLAGS += -DDEBUG_LEVEL=$(DEBUG) -DVCD_OUTPUT $(DBG_TRACE_FLAGS)
|
|
|
|
RTL_PKGS = $(RTL_DIR)/VX_gpu_pkg.sv $(RTL_DIR)/fpu/VX_fpu_pkg.sv
|
|
|
|
FPU_INCLUDE = -I$(RTL_DIR)/fpu
|
|
ifneq (,$(findstring FPU_FPNEW,$(CONFIGS)))
|
|
RTL_PKGS += $(THIRD_PARTY_DIR)/fpnew/src/fpnew_pkg.sv $(THIRD_PARTY_DIR)/fpnew/src/common_cells/src/cf_math_pkg $(THIRD_PARTY_DIR)/fpnew/src/fpu_div_sqrt_mvp/hdl/defs_div_sqrt_mvp.sv
|
|
FPU_INCLUDE += -I$(THIRD_PARTY_DIR)/fpnew/src/common_cells/include -I$(THIRD_PARTY_DIR)/fpnew/src/common_cells/src -I$(THIRD_PARTY_DIR)/fpnew/src/fpu_div_sqrt_mvp/hdl -I$(THIRD_PARTY_DIR)/fpnew/src
|
|
endif
|
|
RTL_INCLUDE = -I$(RTL_DIR) -I$(DPI_DIR) -I$(RTL_DIR)/libs -I$(RTL_DIR)/interfaces -I$(RTL_DIR)/core -I$(RTL_DIR)/mem -I$(RTL_DIR)/cache $(FPU_INCLUDE)
|
|
|
|
SRCS = ../common/util.cpp ../common/mem.cpp ../common/rvfloats.cpp
|
|
SRCS += $(DPI_DIR)/util_dpi.cpp $(DPI_DIR)/float_dpi.cpp
|
|
SRCS += processor.cpp
|
|
|
|
ifdef AXI_BUS
|
|
TOP = Vortex_axi
|
|
CXXFLAGS += -DAXI_BUS
|
|
else
|
|
TOP = Vortex
|
|
endif
|
|
|
|
VL_FLAGS = --exe
|
|
VL_FLAGS += --language 1800-2009 --assert -Wall -Wpedantic
|
|
VL_FLAGS += -Wno-DECLFILENAME -Wno-REDEFMACRO
|
|
VL_FLAGS += --x-initial unique --x-assign unique
|
|
VL_FLAGS += verilator.vlt
|
|
VL_FLAGS += -DSIMULATION
|
|
VL_FLAGS += -DXLEN_$(XLEN)
|
|
VL_FLAGS += $(CONFIGS)
|
|
VL_FLAGS += $(RTL_INCLUDE)
|
|
VL_FLAGS += $(RTL_PKGS)
|
|
VL_FLAGS += --cc $(TOP) --top-module $(TOP)
|
|
|
|
CXXFLAGS += $(CONFIGS)
|
|
|
|
# Enable Verilator multithreaded simulation
|
|
THREADS ?= $(shell python -c 'import multiprocessing as mp; print(mp.cpu_count())')
|
|
VL_FLAGS += -j $(THREADS)
|
|
#VL_FLAGS += --threads $(THREADS)
|
|
|
|
# Debugigng
|
|
ifdef DEBUG
|
|
VL_FLAGS += --trace --trace-structs $(DBG_FLAGS)
|
|
CXXFLAGS += -g -O0 $(DBG_FLAGS)
|
|
else
|
|
VL_FLAGS += -DNDEBUG
|
|
CXXFLAGS += -O2 -DNDEBUG
|
|
endif
|
|
|
|
# Enable perf counters
|
|
ifdef PERF
|
|
VL_FLAGS += -DPERF_ENABLE
|
|
CXXFLAGS += -DPERF_ENABLE
|
|
endif
|
|
|
|
PROJECT = rtlsim
|
|
|
|
all: $(DESTDIR)/$(PROJECT)
|
|
|
|
$(DESTDIR)/$(PROJECT): $(SRCS) main.cpp
|
|
verilator --build $(VL_FLAGS) $^ -CFLAGS '$(CXXFLAGS) -DSTARTUP_ADDR=0x80000000' -LDFLAGS '$(LDFLAGS)' -o ../$@
|
|
|
|
$(DESTDIR)/lib$(PROJECT).so: $(SRCS)
|
|
verilator --build $(VL_FLAGS) $^ -CFLAGS '$(CXXFLAGS)' -LDFLAGS '-shared $(LDFLAGS)' -o ../$@
|
|
|
|
clean:
|
|
rm -rf obj_dir $(DESTDIR)/$(PROJECT) $(DESTDIR)/lib$(PROJECT).so
|