X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=mt%2FMakefile;h=e4a8bfd0fdb253a3370bf80c4d27a90fdfbc1689;hb=64f63c17cbe7abdabb7a4ae73d8bd924d811d712;hp=21f75f9cd08a101030399610c6d351b3016603b4;hpb=5fe2ce69dcd1d0ddb42c4edffac7ab11d939ca45;p=riscv-tests.git diff --git a/mt/Makefile b/mt/Makefile old mode 100755 new mode 100644 index 21f75f9..e4a8bfd --- a/mt/Makefile +++ b/mt/Makefile @@ -1,4 +1,4 @@ -#======================================================================= +#/======================================================================= # UCB VLSI FLOW: Makefile for riscv-bmarks/mt #----------------------------------------------------------------------- # Henry Cook (hcook@cs.berkeley.edu) @@ -16,91 +16,76 @@ instbasedir = $(UCB_VLSI_HOME)/install # Sources #-------------------------------------------------------------------- -bmarks = \ -ab_matmul\ -ab_vvadd\ +bmarks_matmul = \ ad_matmul\ -ad_vvadd\ ae_matmul\ -ae_vvadd\ af_matmul\ -af_vvadd\ ag_matmul\ -ag_vvadd\ ai_matmul\ -ai_vvadd\ -aj_vvadd\ ak_matmul\ -ak_vvadd\ al_matmul\ -al_vvadd\ am_matmul\ -am_vvadd\ an_matmul\ ap_matmul\ -ap_vvadd\ aq_matmul\ -aq_vvadd\ ar_matmul\ -ar_vvadd\ -as_matmul\ -as_vvadd\ at_matmul\ -at_vvadd\ av_matmul\ -av_vvadd\ ay_matmul\ -ay_vvadd\ az_matmul\ -az_vvadd\ -ba_matmul\ -ba_vvadd\ bb_matmul\ -bb_vvadd\ bc_matmul\ -bc_vvadd\ -be_matmul\ -be_vvadd\ bf_matmul\ -bf_vvadd\ bh_matmul\ -bh_vvadd\ bj_matmul\ -bj_vvadd\ bk_matmul\ -bk_vvadd\ bm_matmul\ -bm_vvadd\ -bn_matmul\ -bn_vvadd\ bo_matmul\ -bo_vvadd\ -bp_matmul\ -bp_vvadd\ br_matmul\ -br_vvadd\ bs_matmul\ -bs_vvadd\ -bt_matmul\ -bt_vvadd\ +ce_matmul\ +cf_matmul\ +cg_matmul\ +ci_matmul\ +ck_matmul\ +cl_matmul\ +cm_matmul\ +cs_matmul\ +cv_matmul\ +cy_matmul\ +dc_matmul\ +df_matmul\ +dm_matmul\ +do_matmul\ +dr_matmul\ +ds_matmul\ +du_matmul\ +dv_matmul\ + +bmarks_vvadd = \ +vvadd0\ +vvadd1\ +vvadd2\ +vvadd3\ +vvadd4\ + +bmarks = $(bmarks_vvadd) $(bmarks_matmul) #-------------------------------------------------------------------- # Build rules #-------------------------------------------------------------------- -RISCV_GCC = riscv-gcc -RISCV_GCC_OPTS = -std=gnu99 -T common/test.ld -O3 -nostdlib -nostartfiles -funroll-all-loops -RISCV_LINK = riscv-gcc -T $(common)/test.ld -RISCV_LINK_MT = riscv-gcc -T $(common)/test-mt.ld -RISCV_LINK_OPTS = -lc -RISCV_LINK_SYSCALL = $(common)/syscalls.c -lc -RISCV_OBJDUMP = riscv-objdump --disassemble-all --disassemble-zeroes --section=.text --section=.text.startup --section=.data +RISCV_PREFIX=riscv64-unknown-elf- +RISCV_GCC = $(RISCV_PREFIX)gcc +RISCV_GCC_OPTS = -std=gnu99 -O2 -ffast-math +RISCV_LINK = $(RISCV_GCC) -T $(common)/test.ld $(incs) +RISCV_LINK_OPTS = -nostdlib -nostartfiles -ffast-math -lc +RISCV_OBJDUMP = $(RISCV_PREFIX)objdump --disassemble-all --disassemble-zeroes --section=.text --section=.text.startup --section=.data RISCV_SIM = spike -p2 -VPATH += $(addprefix $(bmarkdir)/, $(bmarks)) -VPATH += $(common) +VPATH += $(common) $(common)/../mt-matmul $(common)/../mt-vvadd -incs += -I. -I$(common) $(addprefix -I$(bmarkdir)/, $(bmarks)) +incs += -I. -I$(bmarkdir)/../env -I$(common) -I$(common)/../mt-matmul -I$(common)/../mt-vvadd objs := #include $(patsubst %, $(bmarkdir)/%/bmark.mk, $(bmarks)) @@ -110,10 +95,12 @@ objs := #------------------------------------------------------------ bmarks_riscv_obj = $(addsuffix .o, $(bmarks)) -bmarks_riscv_bin = $(addsuffix .riscv, $(bmarks)) +bmarks_riscv_matmul_bin = $(addsuffix .riscv, $(bmarks_matmul)) +bmarks_riscv_vvadd_bin = $(addsuffix .riscv, $(bmarks_vvadd)) bmarks_riscv_dump = $(addsuffix .riscv.dump, $(bmarks)) bmarks_riscv_hex = $(addsuffix .riscv.hex, $(bmarks)) bmarks_riscv_out = $(addsuffix .riscv.out, $(bmarks)) +bmarks_riscv_bin = $(bmarks_riscv_matmul_bin) $(bmarks_riscv_vvadd_bin) bmarks_defs = -DPREALLOCATE=1 -DHOST_DEBUG=0 bmarks_cycles = 80000 @@ -121,8 +108,11 @@ bmarks_cycles = 80000 %.hex: % elf2hex 16 32768 $< > $@ -$(bmarks_riscv_bin): %.riscv: %.o crt-mt.o - $(RISCV_LINK_MT) crt-mt.o $< $(RISCV_LINK_SYSCALL) -o $@ +$(bmarks_riscv_vvadd_bin): %.riscv: %.o mt-vvadd.o syscalls.o crt.o + $(RISCV_LINK) $< mt-vvadd.o syscalls.o crt.o $(RISCV_LINK_OPTS) -o $@ + +$(bmarks_riscv_matmul_bin): %.riscv: %.o mt-matmul.o syscalls.o crt.o + $(RISCV_LINK) $< mt-matmul.o syscalls.o crt.o $(RISCV_LINK_OPTS) -o $@ $(bmarks_riscv_dump): %.riscv.dump: %.riscv $(RISCV_OBJDUMP) $< > $@ @@ -131,7 +121,7 @@ $(bmarks_riscv_out): %.riscv.out: %.riscv $(RISCV_SIM) $< > $@ %.o: %.c - $(RISCV_GCC) $(RISCV_GCC_OPTS) $(bmarks_defs) \ + $(RISCV_GCC) $(RISCV_GCC_OPTS) $(bmarks_defs) -D__ASSEMBLY__=1 \ -c $(incs) $< -o $@ %.o: %.S @@ -142,7 +132,7 @@ riscv: $(bmarks_riscv_dump) $(bmarks_riscv_hex) run-riscv: $(bmarks_riscv_out) echo; perl -ne 'print " [$$1] $$ARGV \t$$2\n" if /\*{3}(.{8})\*{3}(.*)/' \ -junk += $(bmarks_riscv_bin) $(bmarks_riscv_dump) $(bmarks_riscv_hex) $(bmarks_riscv_out) +junk += $(bmarks_riscv_bin) $(bmarks_riscv_dump) $(bmarks_riscv_hex) $(bmarks_riscv_out) $(bmarks_riscv_obj) #------------------------------------------------------------ @@ -169,4 +159,4 @@ install-link: # Clean up clean: - rm -rf $(objs) $(junk) + rm -rf $(objs) $(junk) syscall.o crt.o mt-matmul.o mt-vvadd.o