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

Subversion Repositories steelcore

[/] [coremark/] [steel/] [core_portme.h] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 rafaelcalc
/*
2
Copyright 2018 Embedded Microprocessor Benchmark Consortium (EEMBC)
3
 
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
 
8
    http://www.apache.org/licenses/LICENSE-2.0
9
 
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
 
16
Original Author: Shay Gal-on
17
*/
18
/* Topic : Description
19
        This file contains configuration constants required to execute on
20
   different platforms
21
*/
22
#ifndef CORE_PORTME_H
23
#define CORE_PORTME_H
24
/************************/
25
/* Data types and settings */
26
/************************/
27
/* Configuration : HAS_FLOAT
28
        Define to 1 if the platform supports floating point.
29
*/
30
#ifndef HAS_FLOAT
31
#define HAS_FLOAT 0
32
#endif
33
/* Configuration : HAS_TIME_H
34
        Define to 1 if platform has the time.h header file,
35
        and implementation of functions thereof.
36
*/
37
#ifndef HAS_TIME_H
38
#define HAS_TIME_H 0
39
#endif
40
/* Configuration : USE_CLOCK
41
        Define to 1 if platform has the time.h header file,
42
        and implementation of functions thereof.
43
*/
44
#ifndef USE_CLOCK
45
#define USE_CLOCK 0
46
#endif
47
/* Configuration : HAS_STDIO
48
        Define to 1 if the platform has stdio.h.
49
*/
50
#ifndef HAS_STDIO
51
#define HAS_STDIO 0
52
#endif
53
/* Configuration : HAS_PRINTF
54
        Define to 1 if the platform has stdio.h and implements the printf
55
   function.
56
*/
57
#ifndef HAS_PRINTF
58
#define HAS_PRINTF 0
59
#endif
60
 
61
/* Definitions : COMPILER_VERSION, COMPILER_FLAGS, MEM_LOCATION
62
        Initialize these strings per platform
63
*/
64
#ifndef COMPILER_VERSION
65
#ifdef __GNUC__
66
#define COMPILER_VERSION "GCC"__VERSION__
67
#else
68
#define COMPILER_VERSION "riscv32-unknown-elf-gcc (GCC) 10.1.0"
69
#endif
70
#endif
71
#ifndef COMPILER_FLAGS
72
#define COMPILER_FLAGS \
73
    FLAGS_STR ""
74
#endif
75
#ifndef MEM_LOCATION
76
#define MEM_LOCATION "STACK"
77
#endif
78
 
79
/* Data Types :
80
        To avoid compiler issues, define the data types that need ot be used for
81
   8b, 16b and 32b in <core_portme.h>.
82
 
83
        *Imprtant* :
84
        ee_ptr_int needs to be the data type used to hold pointers, otherwise
85
   coremark may fail!!!
86
*/
87
typedef signed short   ee_s16;
88
typedef unsigned short ee_u16;
89
typedef signed int     ee_s32;
90
typedef double         ee_f32;
91
typedef unsigned char  ee_u8;
92
typedef unsigned int   ee_u32;
93
typedef ee_u32         ee_ptr_int;
94
typedef unsigned int   ee_size_t;
95
#define NULL ((void *)0)
96
/* align_mem :
97
        This macro is used to align an offset to point to a 32b value. It is
98
   used in the Matrix algorithm to initialize the input memory blocks.
99
*/
100
#define align_mem(x) (void *)(4 + (((ee_ptr_int)(x)-1) & ~3))
101
 
102
/* Configuration : CORE_TICKS
103
        Define type of return from the timing functions.
104
 */
105
#define CORETIMETYPE ee_u32
106
typedef ee_u32 CORE_TICKS;
107
 
108
/* Configuration : SEED_METHOD
109
        Defines method to get seed values that cannot be computed at compile
110
   time.
111
 
112
        Valid values :
113
        SEED_ARG - from command line.
114
        SEED_FUNC - from a system function.
115
        SEED_VOLATILE - from volatile variables.
116
*/
117
#ifndef SEED_METHOD
118
#define SEED_METHOD SEED_VOLATILE
119
#endif
120
 
121
/* Configuration : MEM_METHOD
122
        Defines method to get a block of memry.
123
 
124
        Valid values :
125
        MEM_MALLOC - for platforms that implement malloc and have malloc.h.
126
        MEM_STATIC - to use a static memory array.
127
        MEM_STACK - to allocate the data block on the stack (NYI).
128
*/
129
#ifndef MEM_METHOD
130
#define MEM_METHOD MEM_STATIC
131
#endif
132
 
133
/* Configuration : MULTITHREAD
134
        Define for parallel execution
135
 
136
        Valid values :
137
        1 - only one context (default).
138
        N>1 - will execute N copies in parallel.
139
 
140
        Note :
141
        If this flag is defined to more then 1, an implementation for launching
142
   parallel contexts must be defined.
143
 
144
        Two sample implementations are provided. Use <USE_PTHREAD> or <USE_FORK>
145
   to enable them.
146
 
147
        It is valid to have a different implementation of <core_start_parallel>
148
   and <core_end_parallel> in <core_portme.c>, to fit a particular architecture.
149
*/
150
#ifndef MULTITHREAD
151
#define MULTITHREAD 1
152
#define USE_PTHREAD 0
153
#define USE_FORK    0
154
#define USE_SOCKET  0
155
#endif
156
 
157
/* Configuration : MAIN_HAS_NOARGC
158
        Needed if platform does not support getting arguments to main.
159
 
160
        Valid values :
161
 
162
        1 - argc/argv to main is not supported
163
 
164
        Note :
165
        This flag only matters if MULTITHREAD has been defined to a value
166
   greater then 1.
167
*/
168
#ifndef MAIN_HAS_NOARGC
169
#define MAIN_HAS_NOARGC 1
170
#endif
171
 
172
/* Configuration : MAIN_HAS_NORETURN
173
        Needed if platform does not support returning a value from main.
174
 
175
        Valid values :
176
 
177
        1 - platform does not support returning a value from main
178
*/
179
#ifndef MAIN_HAS_NORETURN
180
#define MAIN_HAS_NORETURN 1
181
#endif
182
 
183
/* Variable : default_num_contexts
184
        Not used for this simple port, must cintain the value 1.
185
*/
186
extern ee_u32 default_num_contexts;
187
 
188
typedef struct CORE_PORTABLE_S
189
{
190
    ee_u8 portable_id;
191
} core_portable;
192
 
193
/* target specific init/fini */
194
void portable_init(core_portable *p, int *argc, char *argv[]);
195
void portable_fini(core_portable *p);
196
 
197
#if !defined(PROFILE_RUN) && !defined(PERFORMANCE_RUN) \
198
    && !defined(VALIDATION_RUN)
199
#if (TOTAL_DATA_SIZE == 1200)
200
#define PROFILE_RUN 1
201
#elif (TOTAL_DATA_SIZE == 2000)
202
#define PERFORMANCE_RUN 1
203
#else
204
#define VALIDATION_RUN 1
205
#endif
206
#endif
207
 
208
int ee_printf(const char *fmt, ...);
209
 
210
#endif /* CORE_PORTME_H */

powered by: WebSVN 2.1.0

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