1
0
rocket-chip/Makefrag
Andrew Waterman ed827678ac Write test harness in Chisel
This is an unavoidably invasive commit, because it affects the unit tests
(which formerly exited using stop()), the test harness Verilog generator
(since it is no longer necessary), and the DRAM model (since it is no
longer connected).  However, this should substantially reduce the effort
of building test harnesses in the future, since manual or semi-automatic
Verilog writing should no longer be necessary.  Furthermore, there is now
very little duplication of effort between the Verilator and VCS test
harnesses.

This commit removes support for DRAMsim, which is a bit of an unfortunate
consequence.  The main blocker is the lack of Verilog parameterization for
BlackBox.  It would be straightforward to revive DRAMsim once support for
that feature is added to Chisel and FIRRTL.  But that might not even be
necessary, as we move towards synthesizable DRAM models and FAME-1
transformations.
2016-08-15 23:27:27 -07:00

69 lines
2.4 KiB
Plaintext

# check RISCV environment variable
ifndef RISCV
$(error Please set environment variable RISCV. Please take a look at README)
endif
MODEL ?= TestHarness
PROJECT := rocketchip
CXX ?= g++
CXXFLAGS := -O1
SBT ?= java -Xmx2G -Xss8M -XX:MaxPermSize=256M -jar $(base_dir)/sbt-launch.jar
SHELL := /bin/bash
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
CHISEL_ARGS := --targetDir $(generated_dir)
src_path = src/main/scala
default_submodules = . junctions uncore hardfloat rocket groundtest coreplex context-dependent-environments
chisel_srcs = $(foreach submodule,$(default_submodules) $(ROCKETCHIP_ADDONS),$(wildcard $(base_dir)/$(submodule)/$(src_path)/*.scala))
chisel_srcs += $(foreach submodule,$(default_submodules) $(ROCKETCHIP_ADDONS),$(wildcard $(base_dir)/$(submodule)/$(src_path)/*/*.scala))
disasm := 2>
which_disasm := $(shell which spike-dasm 2> /dev/null)
ifneq ($(which_disasm),)
disasm := 3>&1 1>&2 2>&3 | $(which_disasm) $(DISASM_EXTENSION) >
endif
timeout_cycles = 100000000
bootrom_img = $(base_dir)/bootrom/bootrom.img
#--------------------------------------------------------------------
# Build Tests
#--------------------------------------------------------------------
%.hex:
$(MAKE) -C $(dir $@) $(notdir $@)
%.riscv.hex: %.riscv
$(MAKE) -C $(dir $@) $(notdir $@)
#---------------------------------------------------------------------
# Constants Header Files
#---------------------------------------------------------------------
params_file = $(generated_dir)/$(MODEL).$(CONFIG).prm
consts_header = $(generated_dir)/consts.$(CONFIG).h
$(consts_header): $(params_file)
echo "#ifndef __CONST_H__" > $@
echo "#define __CONST_H__" >> $@
sed -r 's/\(([A-Za-z0-9_]+),([A-Za-z0-9_]+)\)/#define \1 \2/' $< >> $@
echo "#endif // __CONST_H__" >> $@
params_file_debug = $(generated_dir_debug)/$(MODEL).$(CONFIG).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 -r 's/\(([A-Za-z0-9_]+),([A-Za-z0-9_]+)\)/#define \1 \2/' $< >> $@
echo "#endif // __CONST_H__" >> $@
clean-run-output:
rm -f $(output_dir)/{*.out,*.run,*.vpd}