Ignore:
Timestamp:
Jan 14, 2016, 10:13:09 AM (9 years ago)
Author:
cfuguet
Message:

Improving the configuration infrastructure of the coremark application

Location:
soft/giet_vm/applications/coremark/mach
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/coremark/mach/core_portme.c

    r753 r756  
    3535        during the benchmark's execution
    3636*/
    37 volatile ee_s32 seed4_volatile=0;
     37volatile ee_s32 seed4_volatile=ITERATIONS;
    3838
    3939
     
    5656*/
    5757#define TIMER_RES_DIVIDER 1
    58 #define NSECS_PER_SEC 1000000 /* 1 GHz */
     58#define NSECS_PER_SEC 833000000 /* 833 MHz */
    5959#define EE_TICKS_PER_SEC (NSECS_PER_SEC / TIMER_RES_DIVIDER)
    6060#define GETMYTIME(_t) (*_t=giet_proctime())
     
    113113}
    114114
    115 ee_u32 default_num_contexts=1;
     115ee_u32 default_num_contexts=MULTITHREAD;
    116116
    117117
     
    136136        giet_procs_number( &x_size, &y_size, &nprocs );
    137137       
    138         // one context per core when using multiple threads
    139         default_num_contexts = x_size * y_size * nprocs;
    140 
    141138        // initialize distributed heaps
    142139        int x, y;
     
    146143                }
    147144        }
    148        
    149         // FIXME: init a lock to access the TTY, and create a printf wrapper,
    150         // requiring and releasing the lock
    151145#else
    152146        // initialize local heap
     
    165159void portable_fini(core_portable *p)
    166160{
     161        core_results *res = (core_results*)((char*)p -
     162                        (sizeof(core_results) - sizeof(core_portable)));
     163
     164        int i;
     165        for (i=0 ; i<default_num_contexts; i++) {
     166                const CORE_TICKS total_time = res[i].port.stop_time - res[i].port.start_time;
     167                printf("thread %d: total ticks = %d\n", i, total_time);
     168        }
     169
    167170        p->portable_id=0;
    168171}
     
    177180__attribute__ ((constructor)) 
    178181void *__iterate(void *pres) {
     182        core_results *res = (core_results*)pres;
     183        GETMYTIME(&(res->port.start_time));
    179184        iterate(pres);
     185        GETMYTIME(&(res->port.stop_time));
    180186        giet_pthread_exit(NULL);
    181187        return NULL;
  • soft/giet_vm/applications/coremark/mach/core_portme.h

    r753 r756  
    182182
    183183
     184/* Configuration : ITERATIONS
     185        Valid values :
     186        0 - the actual number of iterations is computed by the benchmark.
     187        N > 0 - fixed number of iterations
     188*/
     189#ifndef ITERATIONS
     190#define ITERATIONS 0
     191#endif
     192
     193
     194/* Configuration : TOTAL_DATA_SIZE
     195*/
     196#ifndef TOTAL_DATA_SIZE
     197#define TOTAL_DATA_SIZE 2000
     198#endif
     199
     200
    184201/* Variable : default_num_contexts
    185         Not used for this simple port, must cintain the value 1.
    186202*/
    187203extern ee_u32 default_num_contexts;
     
    190206        ee_u8       portable_id;
    191207        pthread_t   thread;
     208
     209        CORE_TICKS  start_time, stop_time;
    192210} core_portable;
    193211
Note: See TracChangeset for help on using the changeset viewer.