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
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/coremark/Makefile

    r753 r756  
    11
    22APP_NAME = coremark
     3TARGET   = appli.elf
    34
    45OBJS= core_main.o \
     
    1011
    1112LIBS= -L../../build/libs -luser
     13INCLUDES = -I. -I./mach  -I../..  -I../../giet_libs  -I../../giet_xml
    1214
    13 INCLUDES = -I. -I./mach  -I../..  -I../../giet_libs  -I../../giet_xml 
    14 
    15 DEFS := -DFLAGS_STR="\"${CFLAGS}\"" -DTOTAL_DATA_SIZE=2000
     15LIBS   := $(LIBS) $(XLIBS)
     16CFLAGS := $(CFLAGS) $(XCFLAGS)
    1617
    1718COREMARK ?= RUN1
    18 ifeq (${COREMARK},RUN1)
     19ifeq ($(COREMARK),RUN1)
    1920  $(info Coremark Performance Run)
    20   DEFS := ${DEFS} -DPERFORMANCE_RUN=1
     21  CFLAGS := $(CFLAGS) -DPERFORMANCE_RUN=1
    2122endif
    22 ifeq (${COREMARK},RUN2)
     23ifeq ($(COREMARK),RUN2)
    2324  $(info Coremark Validation Run)
    24   DEFS := ${DEFS} -DVALIDATION_RUN=1
     25  CFLAGS := $(CFLAGS) -DVALIDATION_RUN=1
    2526endif
    26 ifeq (${COREMARK},RUN3)
     27ifeq ($(COREMARK),RUN3)
    2728  $(info Coremark Profile Run)
    28   DEFS := ${DEFS} -DPROFILE_RUN=1
     29  CFLAGS := $(CFLAGS) -DPROFILE_RUN=1
    2930endif
    3031
    31 #DEFS := ${DEFS} -DCORE_DEBUG=1
     32CFLAGS := $(CFLAGS) -DFLAGS_STR="\"$(CFLAGS)\""
     33LDFLAGS := -Wl,-T $(APP_NAME).ld $(CFLAGS)
    3234
    3335LIB_DEPS = ../../build/libs/libuser.a
    3436
    35 appli.elf: $(OBJS) $(APP_NAME).ld $(LIBS_DEPS)
    36         $(LD) -o $@ -T $(APP_NAME).ld $(OBJS) $(LIBS)
     37$(TARGET): $(OBJS) $(APP_NAME).ld $(LIBS_DEPS)
     38        $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
    3739        $(DU) -D $@ > $@.txt
    3840
    3941check_coremark: coremark.md5
    40         md5sum -c $< 
     42        md5sum -c $<
    4143
    42 %.o: %.c 
    43         $(CC)  $(INCLUDES) $(CFLAGS) ${DEFS} -c -o  $@ $<
     44%.o: %.c
     45        $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    4446
    4547clean:
    46         rm -f *.o *.elf appli.elf.txt *.pyc core *~
     48        rm -f $(OBJS) $(TARGET) $(TARGET).txt $(APP_NAME).pyc
  • soft/giet_vm/applications/coremark/coremark.py

    r753 r756  
    9090                       'main_stack',
    9191                       'coremark_heap_0_0',
    92                        1 )                      # index in start_vector
     92                       2 )                      # index in start_vector
    9393
    9494    for x in xrange (x_size):
     
    101101                                       'coremark_stack_%d_%d_%d' % (x,y,p),
    102102                                       'coremark_heap_%d_%d' % (x,y),
    103                                        0 )
     103                                       1 )
    104104
    105105    # extend mapping name
  • 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.