00001
00002
00003
00004
00005
00006
00007
00008 #include "coremark.h"
00009 #include "core_portme.h"
00010
00011 #if VALIDATION_RUN
00012 volatile ee_s32 seed1_volatile=0x3415;
00013 volatile ee_s32 seed2_volatile=0x3415;
00014 volatile ee_s32 seed3_volatile=0x66;
00015 #endif
00016 #if PERFORMANCE_RUN
00017 volatile ee_s32 seed1_volatile=0x0;
00018 volatile ee_s32 seed2_volatile=0x0;
00019 volatile ee_s32 seed3_volatile=0x66;
00020 #endif
00021 #if PROFILE_RUN
00022 volatile ee_s32 seed1_volatile=0x8;
00023 volatile ee_s32 seed2_volatile=0x8;
00024 volatile ee_s32 seed3_volatile=0x8;
00025 #endif
00026 volatile ee_s32 seed4_volatile=ITERATIONS;
00027 volatile ee_s32 seed5_volatile=0;
00028
00029
00030
00031
00032
00033 CORETIMETYPE barebones_clock() {
00034 #error "You must implement a method to measure time in barebones_clock()! This function should return current time.\n"
00035 }
00036
00037
00038
00039
00040
00041
00042 #define GETMYTIME(_t) (*_t=barebones_clock())
00043 #define MYTIMEDIFF(fin,ini) ((fin)-(ini))
00044 #define TIMER_RES_DIVIDER 1
00045 #define SAMPLE_TIME_IMPLEMENTATION 1
00046 #define EE_TICKS_PER_SEC (CLOCKS_PER_SEC / TIMER_RES_DIVIDER)
00047
00048
00049 static CORETIMETYPE start_time_val, stop_time_val;
00050
00051
00052
00053
00054
00055
00056
00057 void start_time(void) {
00058 GETMYTIME(&start_time_val );
00059 }
00060
00061
00062
00063
00064
00065
00066 void stop_time(void) {
00067 GETMYTIME(&stop_time_val );
00068 }
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 CORE_TICKS get_time(void) {
00079 CORE_TICKS elapsed=(CORE_TICKS)(MYTIMEDIFF(stop_time_val, start_time_val));
00080 return elapsed;
00081 }
00082
00083
00084
00085
00086
00087
00088 secs_ret time_in_secs(CORE_TICKS ticks) {
00089 secs_ret retval=((secs_ret)ticks) / (secs_ret)EE_TICKS_PER_SEC;
00090 return retval;
00091 }
00092
00093 ee_u32 default_num_contexts=1;
00094
00095
00096
00097
00098
00099 void portable_init(core_portable *p, int *argc, char *argv[])
00100 {
00101 #error "Call board initialization routines in portable init (if needed), in particular initialize UART!\n"
00102 if (sizeof(ee_ptr_int) != sizeof(ee_u8 *)) {
00103 ee_printf("ERROR! Please define ee_ptr_int to a type that holds a pointer!\n");
00104 }
00105 if (sizeof(ee_u32) != 4) {
00106 ee_printf("ERROR! Please define ee_u32 to a 32b unsigned type!\n");
00107 }
00108 p->portable_id=1;
00109 }
00110
00111
00112
00113 void portable_fini(core_portable *p)
00114 {
00115 p->portable_id=0;
00116 }
00117
00118