1
0
rocket-chip/Makefrag

75 lines
2.4 KiB
Plaintext
Raw Normal View History

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
MODEL ?= TestHarness
PROJECT ?= rocketchip
CFG_PROJECT ?= $(PROJECT)
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
2012-10-02 04:30:11 +02:00
SBT ?= java -Xmx2G -Xss8M -XX:MaxPermSize=256M -jar $(base_dir)/sbt-launch.jar
SHELL := /bin/bash
2012-10-02 04:30:11 +02:00
FIRRTL_JAR ?= $(base_dir)/firrtl/utils/bin/firrtl.jar
FIRRTL ?= java -Xmx2G -Xss8M -XX:MaxPermSize=256M -cp $(FIRRTL_JAR) firrtl.Driver
$(FIRRTL_JAR): $(shell find $(base_dir)/firrtl/src/main/scala -iname "*.scala")
$(MAKE) -C $(base_dir)/firrtl SBT="$(SBT)" root_dir=$(base_dir)/firrtl build-scala
touch $(FIRRTL_JAR)
CHISEL_ARGS := --targetDir $(generated_dir)
2014-09-01 05:26:55 +02:00
src_path = src/main/scala
default_submodules = . hardfloat context-dependent-environments chisel3
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>
which_disasm := $(shell which spike-dasm 2> /dev/null)
2014-09-01 05:26:55 +02:00
ifneq ($(which_disasm),)
disasm := 3>&1 1>&2 2>&3 | $(which_disasm) $(DISASM_EXTENSION) >
2014-09-01 05:26:55 +02:00
endif
timeout_cycles = 100000000
bootrom_img = $(base_dir)/bootrom/bootrom.img
2014-09-01 05:26:55 +02:00
#--------------------------------------------------------------------
# Build Tests
#--------------------------------------------------------------------
%.hex:
$(MAKE) -C $(dir $@) $(notdir $@)
%.riscv.hex: %.riscv
2014-09-01 05:26:55 +02:00
$(MAKE) -C $(dir $@) $(notdir $@)
#---------------------------------------------------------------------
# Constants Header Files
#---------------------------------------------------------------------
# sed uses -E (instead of -r) for BSD support
params_file = $(generated_dir)/$(long_name).prm
consts_header = $(generated_dir)/consts.$(CONFIG).h
$(consts_header): $(params_file)
echo "#ifndef __CONST_H__" > $@
echo "#define __CONST_H__" >> $@
sed -E 's/\(([A-Za-z0-9_]+),([A-Za-z0-9_]+)\)/#define \1 \2/' $< >> $@
echo "#endif // __CONST_H__" >> $@
params_file_debug = $(generated_dir_debug)/$(long_name).prm
consts_header_debug = $(generated_dir_debug)/consts.$(CONFIG).h
$(consts_header_debug): $(params_file_debug)
echo "#ifndef __CONST_H__" > $@
echo "#define __CONST_H__" >> $@
sed -E 's/\(([A-Za-z0-9_]+),([A-Za-z0-9_]+)\)/#define \1 \2/' $< >> $@
echo "#endif // __CONST_H__" >> $@
2016-08-10 20:40:58 +02:00
clean-run-output:
rm -f $(output_dir)/{*.out,*.run,*.vpd}