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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src-c/] [coremark_v1.0/] [msp430/] [core_portme.h] - Blame information for rev 145

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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