@@ -24,7 +24,7 @@ instbasedir = $(UCB_VLSI_HOME)/install
2424# Sources
2525# --------------------------------------------------------------------
2626
27- bmarks = \
27+ base_bmarks = \
2828 median \
2929 qsort \
3030 rsort \
@@ -39,32 +39,39 @@ bmarks = \
3939 mt-matmul \
4040 mt-memcpy \
4141 pmp \
42+
43+ vec_bmarks = \
4244 vec-memcpy \
4345 vec-daxpy \
4446 vec-sgemm \
4547 vec-strcmp \
4648
49+ bmarks = $(base_bmarks ) $(vec_bmarks )
50+
4751# --------------------------------------------------------------------
4852# Build rules
4953# --------------------------------------------------------------------
5054
5155RISCV_PREFIX ?= riscv$(XLEN ) -unknown-elf-
5256RISCV_GCC ?= $(RISCV_PREFIX ) gcc
53- RISCV_GCC_OPTS ?= -DPREALLOCATE=1 -mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf -fno-tree-loop-distribute-patterns -Wno-implicit-int -Wno-implicit-function-declaration -march=rv $( XLEN ) gcv - mabi=$(ABI )
57+ RISCV_GCC_OPTS ?= -DPREALLOCATE=1 -mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf -fno-tree-loop-distribute-patterns -Wno-implicit-int -Wno-implicit-function-declaration -mabi=$(ABI )
5458RISCV_LINK ?= $(RISCV_GCC ) -T $(src_dir ) /common/test.ld $(incs )
5559RISCV_LINK_OPTS ?= -static -nostdlib -nostartfiles -lm -lgcc -T $(src_dir ) /common/test.ld
5660RISCV_OBJDUMP ?= $(RISCV_PREFIX ) objdump --disassemble-all --disassemble-zeroes --section=.text --section=.text.startup --section=.text.init --section=.data
61+ RISCV_MARCH ?= rv$(XLEN ) gc
62+ RISCV_VMARCH ?= rv$(XLEN ) gcv
5763RISCV_SIM ?= spike --isa=rv$(XLEN ) gcv
5864
5965incs += -I$(src_dir ) /../env -I$(src_dir ) /common $(addprefix -I$(src_dir ) /, $(bmarks ) )
6066objs :=
6167
6268define compile_template
6369$(1 ) .riscv: $(wildcard $(src_dir ) /$(1 ) /* ) $(wildcard $(src_dir ) /common/* )
64- $$(RISCV_GCC ) $$(incs ) $$(RISCV_GCC_OPTS ) -o $$@ $(wildcard $(src_dir ) /$(1 ) /* .c) $(wildcard $(src_dir ) /$(1 ) /* .S) $(wildcard $(src_dir ) /common/* .c) $(wildcard $(src_dir ) /common/* .S) $$(RISCV_LINK_OPTS )
70+ $$(RISCV_GCC ) $$(incs ) $$(RISCV_GCC_OPTS ) -march= $( 2 ) - o $$@ $(wildcard $(src_dir ) /$(1 ) /* .c) $(wildcard $(src_dir ) /$(1 ) /* .S) $(wildcard $(src_dir ) /common/* .c) $(wildcard $(src_dir ) /common/* .S) $$(RISCV_LINK_OPTS )
6571endef
6672
67- $(foreach bmark,$(bmarks),$(eval $(call compile_template,$(bmark))))
73+ $(foreach bmark,$(base_bmarks),$(eval $(call compile_template,$(bmark),$(RISCV_MARCH))))
74+ $(foreach bmark,$(vec_bmarks),$(eval $(call compile_template,$(bmark),$(RISCV_VMARCH))))
6875
6976# ------------------------------------------------------------
7077# Build and run benchmarks on riscv simulator
0 commit comments