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
|
|
|
|
|
2016-08-16 07:03:03 +02:00
|
|
|
MODEL ?= TestHarness
|
2017-07-07 19:48:16 +02:00
|
|
|
PROJECT ?= freechips.rocketchip.chip
|
2016-09-15 03:10:21 +02:00
|
|
|
CFG_PROJECT ?= $(PROJECT)
|
2016-09-19 22:23:17 +02:00
|
|
|
CONFIG ?= DefaultConfig
|
|
|
|
# TODO: For now must match rocketchip.Generator
|
|
|
|
long_name = $(PROJECT).$(CONFIG)
|
|
|
|
|
2015-08-25 22:26:14 +02:00
|
|
|
CXX ?= g++
|
2014-01-31 21:25:19 +01:00
|
|
|
CXXFLAGS := -O1
|
2017-05-18 20:06:43 +02:00
|
|
|
JVM_MEMORY ?= 2G
|
2012-10-02 04:30:11 +02:00
|
|
|
|
2017-05-18 20:06:43 +02:00
|
|
|
SBT ?= java -Xmx$(JVM_MEMORY) -Xss8M -XX:MaxPermSize=256M -jar $(base_dir)/sbt-launch.jar
|
2015-06-26 08:17:35 +02:00
|
|
|
SHELL := /bin/bash
|
2012-10-02 04:30:11 +02:00
|
|
|
|
2016-06-20 20:18:47 +02:00
|
|
|
FIRRTL_JAR ?= $(base_dir)/firrtl/utils/bin/firrtl.jar
|
2017-05-18 20:06:43 +02:00
|
|
|
FIRRTL ?= java -Xmx$(JVM_MEMORY) -Xss8M -XX:MaxPermSize=256M -cp $(FIRRTL_JAR) firrtl.Driver
|
2016-06-20 20:18:47 +02:00
|
|
|
|
2016-10-28 08:45:01 +02:00
|
|
|
# Build firrtl.jar and put it where chisel3 can find it.
|
2016-08-05 23:45:00 +02:00
|
|
|
$(FIRRTL_JAR): $(shell find $(base_dir)/firrtl/src/main/scala -iname "*.scala")
|
2016-06-20 20:18:47 +02:00
|
|
|
$(MAKE) -C $(base_dir)/firrtl SBT="$(SBT)" root_dir=$(base_dir)/firrtl build-scala
|
2016-08-19 20:06:01 +02:00
|
|
|
touch $(FIRRTL_JAR)
|
2017-01-26 20:11:14 +01:00
|
|
|
mkdir -p $(base_dir)/lib
|
|
|
|
cp -p $(FIRRTL_JAR) $(base_dir)/lib
|
|
|
|
# When chisel3 pr 448 is merged, the following extraneous copy may be removed.
|
2016-10-28 08:45:01 +02:00
|
|
|
mkdir -p $(base_dir)/chisel3/lib
|
|
|
|
cp -p $(FIRRTL_JAR) $(base_dir)/chisel3/lib
|
2016-06-20 20:18:47 +02:00
|
|
|
|
2016-10-28 20:56:13 +02:00
|
|
|
src_path := src/main/scala
|
2016-11-22 10:53:35 +01:00
|
|
|
default_submodules := . hardfloat chisel3
|
2016-10-28 20:56:13 +02:00
|
|
|
chisel_srcs := $(foreach submodule,$(default_submodules) $(ROCKETCHIP_ADDONS),$(shell find $(base_dir)/$(submodule)/$(src_path) -name "*.scala"))
|
2014-09-01 05:26:55 +02:00
|
|
|
|
|
|
|
disasm := 2>
|
2015-09-04 00:36:11 +02:00
|
|
|
which_disasm := $(shell which spike-dasm 2> /dev/null)
|
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
|
|
|
|
|
2016-08-05 20:07:42 +02:00
|
|
|
bootrom_img = $(base_dir)/bootrom/bootrom.img
|
|
|
|
|
2014-09-01 05:26:55 +02:00
|
|
|
#--------------------------------------------------------------------
|
|
|
|
# Build Tests
|
|
|
|
#--------------------------------------------------------------------
|
|
|
|
|
|
|
|
%.hex:
|
|
|
|
$(MAKE) -C $(dir $@) $(notdir $@)
|
|
|
|
|
2016-01-28 21:15:14 +01:00
|
|
|
%.riscv.hex: %.riscv
|
2014-09-01 05:26:55 +02:00
|
|
|
$(MAKE) -C $(dir $@) $(notdir $@)
|
2015-11-05 19:15:02 +01:00
|
|
|
|
2016-08-10 20:40:58 +02:00
|
|
|
clean-run-output:
|
|
|
|
rm -f $(output_dir)/{*.out,*.run,*.vpd}
|