Ignore:
Timestamp:
Jun 25, 2014, 2:19:37 PM (10 years ago)
Author:
cfuguet
Message:

giet_vm optimizations:

  • Several modifications in GIET_VM in order to support compilation with GCC optimizations (-O2) activated.
  • Adding missing volatile in some global variables.
  • Using ioread and iowrite utility functions in peripheral drivers which prevent GCC to remove writes or reads in hardware memory mapped registers.
  • Code refactoring of stdio printf functions. Now, shr_printf and tty_printf function reuse the same function body. The only difference is that shr_printf wraps printf function call with TTY get lock and release lock.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/router/main.c

    r295 r345  
    33#include "mapping_info.h"
    44#include "hard_config.h"
     5
     6#if NB_TTY_CHANNELS == 1
     7#  define printf(...) giet_shr_printf(__VA_ARGS__)
     8#else
     9#  define printf(...) giet_tty_printf(__VA_ARGS__)
     10#endif
    511
    612#define NMAX 50
     
    2026    unsigned int    y          = cluster_xy & ((1<<Y_WIDTH)-1);
    2127
    22     giet_tty_printf( "*** Starting task producer on processor[%d,%d,%d] at cycle %d\n\n",
    23                       x, y, lpid, giet_proctime() );
     28    printf( "*** Starting task producer on processor[%d,%d,%d] at cycle %d\n\n",
     29             x, y, lpid, giet_proctime() );
    2430
    2531    giet_vobj_get_vbase( "router" ,
     
    3238        buf = n;
    3339        mwmr_write( mwmr, &buf , 1 );
    34         giet_tty_printf( "transmitted value : %d\n", buf);
     40        printf( "transmitted value : %d\n", buf);
    3541    }
    3642
     
    5258    unsigned int    y          = cluster_xy & ((1<<Y_WIDTH)-1);
    5359
    54     giet_tty_printf( "*** Starting task consumer on processor[%d,%d,%d] at cycle %d\n\n",
    55                       x, y, lpid, giet_proctime() );
     60    printf( "*** Starting task consumer on processor[%d,%d,%d] at cycle %d\n\n",
     61             x, y, lpid, giet_proctime() );
    5662
    5763    giet_vobj_get_vbase( "router" ,
     
    6369    {
    6470        mwmr_read( mwmr, &buf , 1 );
    65         giet_tty_printf( "received token %d / value = %d\n", n  , buf);
     71        printf( "received token %d / value = %d\n", n  , buf);
    6672    }
    6773
     
    8591    unsigned int    y          = cluster_xy & ((1<<Y_WIDTH)-1);
    8692
    87     giet_tty_printf( "*** Starting task router on processor[%d,%d,%d] at cycle %d\n\n",
    88                       x, y, lpid, giet_proctime() );
     93    printf( "*** Starting task router on processor[%d,%d,%d] at cycle %d\n\n",
     94             x, y, lpid, giet_proctime() );
    8995
    9096    giet_vobj_get_vbase( "router" ,
     
    101107        tempo = giet_rand() >> 6;
    102108        for ( n = 0 ; n < tempo ; n++ ) asm volatile ("");
    103         giet_tty_printf( "token value : %d / temporisation = %d\n", buf, tempo);
     109        printf( "token value : %d / temporisation = %d\n", buf, tempo);
    104110        mwmr_write( mwmr_out, &buf , 1 );
    105111    }
Note: See TracChangeset for help on using the changeset viewer.