2014-09-11 11:38:21 +02:00
|
|
|
# check RISCV environment variable
|
|
|
|
ifndef RISCV
|
|
|
|
$(error Please set environment variable RISCV. Please take a look at README)
|
|
|
|
endif
|
|
|
|
|
2012-10-19 02:51:41 +02:00
|
|
|
MODEL := Top
|
2015-07-28 09:23:31 +02:00
|
|
|
PROJECT := rocketchip
|
2012-10-02 04:30:11 +02:00
|
|
|
CXX := g++
|
2014-01-31 21:25:19 +01:00
|
|
|
CXXFLAGS := -O1
|
2012-10-02 04:30:11 +02:00
|
|
|
|
2012-11-20 14:39:48 +01:00
|
|
|
SBT := java -Xmx2048M -Xss8M -XX:MaxPermSize=128M -jar sbt-launch.jar
|
2015-06-26 08:17:35 +02:00
|
|
|
SHELL := /bin/bash
|
2012-10-02 04:30:11 +02:00
|
|
|
|
2015-07-28 09:23:31 +02:00
|
|
|
CHISEL_ARGS := $(MODEL) --W0W --backend $(BACKEND) --configInstance $(PROJECT).$(CONFIG) --compileInitializationUnoptimized --targetDir $(generated_dir)
|
|
|
|
|
2014-09-01 05:26:55 +02:00
|
|
|
src_path = src/main/scala
|
2015-07-23 22:59:45 +02:00
|
|
|
chisel_srcs = $(base_dir)/$(src_path)/*.scala $(base_dir)/rocket/$(src_path)/*.scala $(base_dir)/uncore/$(src_path)/*.scala $(base_dir)/zscale/$(src_path)/*.scala $(SRC_EXTENSION)
|
2014-09-01 05:26:55 +02:00
|
|
|
|
|
|
|
disasm := 2>
|
2015-06-26 08:17:35 +02:00
|
|
|
which_disasm := $(shell which spike-dasm)
|
2014-09-01 05:26:55 +02:00
|
|
|
ifneq ($(which_disasm),)
|
2014-09-10 05:49:28 +02:00
|
|
|
disasm := 3>&1 1>&2 2>&3 | $(which_disasm) $(DISASM_EXTENSION) >
|
2014-09-01 05:26:55 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
timeout_cycles = 100000000
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# DRAMSim2
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
|
2013-05-01 11:58:53 +02:00
|
|
|
DRAMSIM_OBJS := $(patsubst %.cpp,%.o,$(wildcard $(base_dir)/dramsim2/*.cpp))
|
2012-12-04 16:04:26 +01:00
|
|
|
$(DRAMSIM_OBJS): %.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -DNO_STORAGE -DNO_OUTPUT -Dmain=nomain -c -o $@ $<
|
2013-05-01 11:58:53 +02:00
|
|
|
$(sim_dir)/libdramsim.a: $(DRAMSIM_OBJS)
|
2012-12-04 16:04:26 +01:00
|
|
|
ar rcs $@ $^
|
|
|
|
|
2014-09-01 05:26:55 +02:00
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# Build Tests
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
|
|
|
|
%.hex:
|
|
|
|
$(MAKE) -C $(dir $@) $(notdir $@)
|
|
|
|
|
|
|
|
%.riscv.hex: %
|
|
|
|
$(MAKE) -C $(dir $@) $(notdir $@)
|