-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathriscv64.mak
74 lines (67 loc) · 2.58 KB
/
riscv64.mak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File: util/make/riscv64.mak
# Copied from: util/make/linux64.mak
# Optional specific files for specialized run and results extraction
PLATFORM=riscv64
SHELL=/bin/bash
ifndef TOOLCHAIN
TOOLCHAIN=riscv-gcc64
endif
# Flag: LOAD
# Use LOAD to define command used for loading the image to the target
LOAD =
# Flag: RUN
# Use this flag to define a command needed to run the image
#
# Example: if you need to run the image with a simulator, set this flag to point to the simulator executable
RUN = spike pk
# Flag: RUN
# Use this flag to supply flags before the image name and parameters
#
# Example: if you need want to run the image using gdb, you probably need to set this flag to --args
RUN_FLAGS =
ifeq ($(DO_PROFILE),yes)
RUN_FLAGS =
RUN = function dorun() { \
BENCHNAME=`basename $$1 .riscv` && \
$$@ &&\
gprof $$1 gmon.out > $(DIR_LOG)/$$BENCHNAME.gprof && \
mv gmon.out $(DIR_LOG)/$$BENCHNAME.gmon ;\
} && dorun
endif
ifeq ($(DO_VALGRIND),yes)
RUN_FLAGS =
RUN = valgrind --log-fd=1 --tool=memcheck -v --leak-check=yes --show-reachable=yes
endif
ifeq ($(DO_MICA),yes)
RUN_FLAGS =
RUN = function dorun() { \
BENCHNAME=`basename $$1 .riscv` && echo "will do $$@" && \
pin -t mica -controller-start-int3 1 -controller-stop-int3 2 -- $$@ $$DATA_CMD &&\
mkdir -p $(DIR_LOG)/mica/$$BENCHNAME && mv *pin.out $(DIR_LOG)/mica/$$BENCHNAME ;\
} && dorun
endif
ifeq ($(DO_APROF),yes)
RUN_FLAGS =
RUN = function dorun() { \
BENCHNAME=`basename $$1 .riscv` && \
/opt/valgrind/bin/valgrind --tool=aprof $$@ &&\
mkdir -p $(DIR_LOG)/aprof/$$BENCHNAME && mv *.aprof $(DIR_LOG)/aprof/$$BENCHNAME ;\
} && dorun
endif
#Flag: PLATFORM_DEFINES
# Use PLATFORM_DEFINES to set platform specific compiler flags. E.g. set the timer resolution to millisecs with TIMER_RES_DIVIDER=1000
# Or add HAVE_PTHREAD_SETAFFINITY_NP=1 HAVE_PTHREAD_SELF=1 to enable affinity (must port the relevant functions in <mith/al/src/al_smp.c>.
PLATFORM_DEFINES = EE_SIZEOF_INT=4 EE_SIZEOF_LONG=8
# Flag: CMD_SEP
# Use CMD_SEP if a separator is required before run flags (e.g. --)
CMD_SEP=
# Flag: XCMD
# Define XCMD on command line to pass flag at run time to workloads, or here if you want to override the default in <util/make/common.mak>
#FLAG: COPY_DATA
# How should data be copied so that it is available for the executable?
# Common ways include:
# - scp <target_ip>:<target_dir>(if target allows ssh connection)
# - invoking a special command line tool to transfer the data
# - copy (for file systems that do not support links)
# - link (for file systems where a simple symbolic link will work)
COPY_DATA=cp -Ru --remove-destination