OpenCores
URL https://opencores.org/ocsvn/steelcore/steelcore/trunk

Subversion Repositories steelcore

[/] [coremark/] [Makefile] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 rafaelcalc
# Copyright 2018 Embedded Microprocessor Benchmark Consortium (EEMBC)
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
6
#
7
#    http://www.apache.org/licenses/LICENSE-2.0
8
#
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14
#
15
# Original Author: Shay Gal-on
16
 
17
# Make sure the default target is to simply build and run the benchmark.
18
RSTAMP = v1.0
19
 
20
.PHONY: run score
21
run: $(OUTFILE) rerun score
22
 
23
score:
24
        @echo "Check run1.log and run2.log for results."
25
        @echo "See README.md for run and reporting rules."
26
 
27
ifndef PORT_DIR
28
# Ports for a couple of common self hosted platforms
29
UNAME=$(shell if command -v uname 2> /dev/null; then uname ; fi)
30
ifneq (,$(findstring CYGWIN,$(UNAME)))
31
PORT_DIR=cygwin
32
endif
33
ifneq (,$(findstring Linux,$(UNAME)))
34
MACHINE=$(shell uname -m)
35
ifneq (,$(findstring 64,$(MACHINE)))
36
PORT_DIR=linux64
37
else
38
PORT_DIR=linux
39
endif
40
endif
41
endif
42
ifndef PORT_DIR
43
$(error PLEASE define PORT_DIR! (e.g. make PORT_DIR=simple))
44
endif
45
vpath %.c $(PORT_DIR)
46
vpath %.h $(PORT_DIR)
47
vpath %.mak $(PORT_DIR)
48
include $(PORT_DIR)/core_portme.mak
49
 
50
ifndef ITERATIONS
51
ITERATIONS=0
52
endif
53
ifdef REBUILD
54
FORCE_REBUILD=force_rebuild
55
endif
56
 
57
CFLAGS += -DITERATIONS=$(ITERATIONS)
58
 
59
CORE_FILES = core_list_join core_main core_matrix core_state core_util
60
ORIG_SRCS = $(addsuffix .c,$(CORE_FILES))
61
SRCS = $(ORIG_SRCS) $(PORT_SRCS)
62
OBJS = $(addprefix $(OPATH),$(addsuffix $(OEXT),$(CORE_FILES)) $(PORT_OBJS))
63
OUTNAME = coremark$(EXE)
64
OUTFILE = $(OPATH)$(OUTNAME)
65
LOUTCMD = $(OFLAG) $(OUTFILE) $(LFLAGS_END)
66
OUTCMD = $(OUTFLAG) $(OUTFILE) $(LFLAGS_END)
67
 
68
HEADERS = coremark.h
69
CHECK_FILES = $(ORIG_SRCS) $(HEADERS)
70
 
71
$(OPATH):
72
        $(MKDIR) $(OPATH)
73
 
74
.PHONY: compile link
75
ifdef SEPARATE_COMPILE
76
$(OPATH)$(PORT_DIR):
77
        $(MKDIR) $(OPATH)$(PORT_DIR)
78
 
79
compile: $(OPATH) $(OPATH)$(PORT_DIR) $(OBJS) $(HEADERS)
80
link: compile
81
        $(LD) $(LFLAGS) $(XLFLAGS) $(OBJS) $(LOUTCMD)
82
 
83
else
84
 
85
compile: $(OPATH) $(SRCS) $(HEADERS)
86
        $(CC) $(CFLAGS) $(XCFLAGS) $(SRCS) $(OUTCMD)
87
link: compile
88
        @echo "Link performed along with compile"
89
 
90
endif
91
 
92
$(OUTFILE): $(SRCS) $(HEADERS) Makefile core_portme.mak $(FORCE_REBUILD)
93
        $(MAKE) port_prebuild
94
        $(MAKE) link
95
        $(MAKE) port_postbuild
96
 
97
.PHONY: rerun
98
rerun:
99
        $(MAKE) XCFLAGS="$(XCFLAGS) -DPERFORMANCE_RUN=1" load run1.log
100
        $(MAKE) XCFLAGS="$(XCFLAGS) -DVALIDATION_RUN=1" load run2.log
101
 
102
PARAM1=$(PORT_PARAMS) 0x0 0x0 0x66 $(ITERATIONS)
103
PARAM2=$(PORT_PARAMS) 0x3415 0x3415 0x66 $(ITERATIONS)
104
PARAM3=$(PORT_PARAMS) 8 8 8 $(ITERATIONS)
105
 
106
run1.log-PARAM=$(PARAM1) 7 1 2000
107
run2.log-PARAM=$(PARAM2) 7 1 2000
108
run3.log-PARAM=$(PARAM3) 7 1 1200
109
 
110
run1.log run2.log run3.log: load
111
        $(MAKE) port_prerun
112
        $(RUN) $(OUTFILE) $($(@)-PARAM) > $(OPATH)$@
113
        $(MAKE) port_postrun
114
 
115
.PHONY: gen_pgo_data
116
gen_pgo_data: run3.log
117
 
118
.PHONY: load
119
load: $(OUTFILE)
120
        $(MAKE) port_preload
121
        $(LOAD) $(OUTFILE)
122
        $(MAKE) port_postload
123
 
124
.PHONY: clean
125
clean:
126
        rm -f $(OUTFILE) $(OPATH)*.log *.info $(OPATH)index.html $(PORT_CLEAN)
127
 
128
.PHONY: force_rebuild
129
force_rebuild:
130
        echo "Forcing Rebuild"
131
 
132
.PHONY: check
133
check:
134
        md5sum -c coremark.md5
135
 
136
ifdef ETC
137
# Targets related to testing and releasing CoreMark. Not part of the general release!
138
include Makefile.internal
139
endif

powered by: WebSVN 2.1.0

© copyright 1999-2022 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.