*.out
*.hex
.*.swp
-autom4te.cache
+/autom4te.cache
+/Makefile
+/config.log
+/config.status
install: all
install -d $(instbasedir)/share/riscv-tests/isa
install -d $(instbasedir)/share/riscv-tests/benchmarks
- install -p -m 644 isa/* $(instbasedir)/share/riscv-tests/isa
- install -p -m 644 benchmarks/* $(instbasedir)/share/riscv-tests/benchmarks
+ install -p -m 644 `find $(isa_src_dir) -maxdepth 1 -type f` $(instbasedir)/share/riscv-tests/isa
+ install -p -m 644 `find $(bmarkdir) -maxdepth 1 -type f` $(instbasedir)/share/riscv-tests/benchmarks
benchmarks:
mkdir -p benchmarks
- $(MAKE) -C benchmarks -f $(bmarkdir)/Makefile bmarkdir=$(bmarkdir)
+ $(MAKE) -C benchmarks -f $(bmarkdir)/Makefile src_dir=$(bmarkdir)
isa:
mkdir -p isa
- $(MAKE) -C isa -f $(isa_src_dir)/Makefile isa_src_dir=$(isa_src_dir)
+ $(MAKE) -C isa -f $(isa_src_dir)/Makefile src_dir=$(isa_src_dir)
clean:
- $(MAKE) -f $(isa_src_dir)/Makefile isa_src_dir=$(isa_src_dir) clean
- $(MAKE) -f $(bmarkdir)/Makefile bmarkdir=$(bmarkdir) clean
+ $(MAKE) -C isa -f $(isa_src_dir)/Makefile src_dir=$(isa_src_dir) clean
+ $(MAKE) -C benchmarks -f $(bmarkdir)/Makefile src_dir=$(bmarkdir) clean
.PHONY: benchmarks isa clean
default: all
-bmarkdir = .
+src_dir = .
instname = riscv-bmarks
instbasedir = $(UCB_VLSI_HOME)/install
RISCV_PREFIX ?= riscv64-unknown-elf-
RISCV_GCC ?= $(RISCV_PREFIX)gcc
RISCV_GCC_OPTS ?= -static -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf
-RISCV_LINK ?= $(RISCV_GCC) -T $(bmarkdir)/common/test.ld $(incs)
-RISCV_LINK_MT ?= $(RISCV_GCC) -T $(bmarkdir)/common/test-mt.ld
+RISCV_LINK ?= $(RISCV_GCC) -T $(src_dir)/common/test.ld $(incs)
+RISCV_LINK_MT ?= $(RISCV_GCC) -T $(src_dir)/common/test-mt.ld
RISCV_LINK_OPTS ?= -nostdlib -nostartfiles -ffast-math -lc -lgcc
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump --disassemble-all --disassemble-zeroes --section=.text --section=.text.startup --section=.data
RISCV_SIM ?= spike
-VPATH += $(addprefix $(bmarkdir)/, $(bmarks))
-VPATH += $(bmarkdir)/common
+VPATH += $(addprefix $(src_dir)/, $(bmarks))
+VPATH += $(src_dir)/common
-incs += -I$(bmarkdir)/../env -I$(bmarkdir)/common $(addprefix -I$(bmarkdir)/, $(bmarks))
+incs += -I$(src_dir)/../env -I$(src_dir)/common $(addprefix -I$(src_dir)/, $(bmarks))
objs :=
-include $(patsubst %, $(bmarkdir)/%/bmark.mk, $(bmarks))
+include $(patsubst %, $(src_dir)/%/bmark.mk, $(bmarks))
#------------------------------------------------------------
# Build and run benchmarks on riscv simulator
# Makefile for riscv-tests/isa
#-----------------------------------------------------------------------
-isa_src_dir := .
+src_dir := .
-include $(isa_src_dir)/rv64ui/Makefrag
-include $(isa_src_dir)/rv64uf/Makefrag
-include $(isa_src_dir)/rv64si/Makefrag
-include $(isa_src_dir)/rv64mi/Makefrag
-include $(isa_src_dir)/rv32ui/Makefrag
-include $(isa_src_dir)/rv32si/Makefrag
-include $(isa_src_dir)/rv32mi/Makefrag
+include $(src_dir)/rv64ui/Makefrag
+include $(src_dir)/rv64uf/Makefrag
+include $(src_dir)/rv64si/Makefrag
+include $(src_dir)/rv64mi/Makefrag
+include $(src_dir)/rv32ui/Makefrag
+include $(src_dir)/rv32si/Makefrag
+include $(src_dir)/rv32mi/Makefrag
default: all
RISCV_SIM ?= spike
XLEN ?= 64
-vpath %.S $(isa_src_dir)
+vpath %.S $(src_dir)
#------------------------------------------------------------
# Build assembly tests
define compile_template
$$($(1)_p_tests): $(1)-p-%: $(1)/%.S
- $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(isa_src_dir)/../env/p -I$(isa_src_dir)/macros/scalar -T$(isa_src_dir)/../env/p/link.ld $$< -o $$@
+ $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(src_dir)/../env/p -I$(src_dir)/macros/scalar -T$(src_dir)/../env/p/link.ld $$< -o $$@
$(1)_tests += $$($(1)_p_tests)
$$($(1)_pt_tests): $(1)-pt-%: $(1)/%.S
- $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(isa_src_dir)/../env/pt -I$(isa_src_dir)/macros/scalar -T$(isa_src_dir)/../env/pt/link.ld $$< -o $$@
+ $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(src_dir)/../env/pt -I$(src_dir)/macros/scalar -T$(src_dir)/../env/pt/link.ld $$< -o $$@
$(1)_tests += $$($(1)_pt_tests)
$$($(1)_pm_tests): $(1)-pm-%: $(1)/%.S
- $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(isa_src_dir)/../env/pm -I$(isa_src_dir)/macros/scalar -T$(isa_src_dir)/../env/pm/link.ld $$< -o $$@
+ $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(src_dir)/../env/pm -I$(src_dir)/macros/scalar -T$(src_dir)/../env/pm/link.ld $$< -o $$@
$(1)_tests += $$($(1)_pm_tests)
$$($(1)_v_tests): $(1)-v-%: $(1)/%.S
- $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -std=gnu99 -O2 -I$(isa_src_dir)/../env/v -I$(isa_src_dir)/macros/scalar -T$(isa_src_dir)/../env/v/link.ld $(isa_src_dir)/../env/v/entry.S $(isa_src_dir)/../env/v/vm.c $$< -lc -o $$@
+ $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -std=gnu99 -O2 -I$(src_dir)/../env/v -I$(src_dir)/macros/scalar -T$(src_dir)/../env/v/link.ld $(src_dir)/../env/v/entry.S $(src_dir)/../env/v/vm.c $$< -lc -o $$@
$(1)_tests += $$($(1)_v_tests)
$(1)_tests_dump = $$(addsuffix .dump, $$($(1)_tests))