Ignore:
Timestamp:
Jan 17, 2014, 11:49:27 PM (11 years ago)
Author:
cfuguet
Message:
  • Bugfix: The ISR_SWITCH index should be NB_PROCS_MAX + local_pid. This is because the first NB_PROCS_MAX indexes on the XICU in each cluster are used for the WAKEUP software interrupts.
  • Relocating the memcpy and memset functions into the giet_libs/stdlib.* files.
  • Modification of the sort application to used 8 threads instead of
    1. Modifying the mapping files to distribute the 8 threads on the available processors. (Ex. When using 4 processors, each one executes 2 threads)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/xcu_driver.c

    r263 r271  
    170170////////////////////////////////////////////////////////////////////////////////
    171171unsigned int _xcu_timer_start( unsigned int cluster_xy,
    172                                unsigned int proc_id,
     172                               unsigned int pti_index,
    173173                               unsigned int period )
    174174{
     
    178178    if (x >= X_SIZE)             return 1;
    179179    if (y >= Y_SIZE)             return 1;
    180     if (proc_id >= NB_PROCS_MAX) return 1;
    181180
    182181#if USE_XICU
    183182    unsigned int* xcu_address = (unsigned int *) ((unsigned int)&seg_xcu_base +
    184183                                (cluster_xy * (unsigned int)&vseg_cluster_increment));
    185     xcu_address[XICU_REG(XICU_PTI_PER, proc_id)] = period;
     184    xcu_address[XICU_REG(XICU_PTI_PER, pti_index)] = period;
    186185    return 0;
    187186#else
     
    200199//////////////////////////////////////////////////////////////////////////////
    201200unsigned int _xcu_timer_stop( unsigned int cluster_xy,
    202                               unsigned int proc_id)
    203 {
    204     // parameters checking
    205     unsigned int x = cluster_xy >> Y_WIDTH;
    206     unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
    207     if (x >= X_SIZE)             return 1;
    208     if (y >= Y_SIZE)             return 1;
    209     if (proc_id >= NB_PROCS_MAX) return 1;
     201                              unsigned int pti_index)
     202{
     203    // parameters checking
     204    unsigned int x = cluster_xy >> Y_WIDTH;
     205    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     206    if (x >= X_SIZE)             return 1;
     207    if (y >= Y_SIZE)             return 1;
    210208
    211209#if USE_XICU
    212210    unsigned int * xcu_address = (unsigned int *) ((unsigned int)&seg_xcu_base +
    213211                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
    214     xcu_address[XICU_REG(XICU_PTI_PER, proc_id)] = 0;
     212    xcu_address[XICU_REG(XICU_PTI_PER, pti_index)] = 0;
    215213    return 0;
    216214#else
     
    231229//////////////////////////////////////////////////////////////////////////////
    232230unsigned int _xcu_timer_reset_irq( unsigned int cluster_xy,
    233                                    unsigned int proc_id )
    234 {
    235     // parameters checking
    236     unsigned int x = cluster_xy >> Y_WIDTH;
    237     unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
    238     if (x >= X_SIZE)             return 1;
    239     if (y >= Y_SIZE)             return 1;
    240     if (proc_id >= NB_PROCS_MAX) return 1;
    241 
    242 #if USE_XICU
    243     unsigned int * xcu_address = (unsigned int *) ((unsigned int)&seg_xcu_base +
    244                                  (cluster_xy * (unsigned int)&vseg_cluster_increment));
    245 
    246     unsigned int bloup = xcu_address[XICU_REG(XICU_PTI_ACK, proc_id)];
    247     bloup++; // to avoid a warning
     231                                   unsigned int pti_index )
     232{
     233    // parameters checking
     234    unsigned int x = cluster_xy >> Y_WIDTH;
     235    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     236    if (x >= X_SIZE)             return 1;
     237    if (y >= Y_SIZE)             return 1;
     238
     239#if USE_XICU
     240    volatile unsigned int * xcu_address =
     241        (unsigned int *) ((unsigned int)&seg_xcu_base +
     242        (cluster_xy * (unsigned int)&vseg_cluster_increment));
     243
     244    xcu_address[XICU_REG(XICU_PTI_ACK, pti_index)];
    248245    return 0;
    249246#else
     
    265262/////////////////////////////////////////////////////////////////////////////
    266263unsigned int _xcu_timer_reset_cpt( unsigned int cluster_xy,
    267                                    unsigned int proc_id )
    268 {
    269     // parameters checking
    270     unsigned int x = cluster_xy >> Y_WIDTH;
    271     unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
    272     if (x >= X_SIZE)             return 1;
    273     if (y >= Y_SIZE)             return 1;
    274     if (proc_id >= NB_PROCS_MAX) return 1;
     264                                   unsigned int pti_index )
     265{
     266    // parameters checking
     267    unsigned int x = cluster_xy >> Y_WIDTH;
     268    unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
     269    if (x >= X_SIZE)             return 1;
     270    if (y >= Y_SIZE)             return 1;
    275271
    276272#if USE_XICU
     
    278274                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
    279275
    280     unsigned int period = xcu_address[XICU_REG(XICU_PTI_PER, proc_id)];
     276    unsigned int period = xcu_address[XICU_REG(XICU_PTI_PER, pti_index)];
    281277
    282278    // we write 0 first because if the timer is currently running,
    283279    // the corresponding timer counter is not reset
    284     xcu_address[XICU_REG(XICU_PTI_PER, proc_id)] = 0;
    285     xcu_address[XICU_REG(XICU_PTI_PER, proc_id)] = period;
     280    xcu_address[XICU_REG(XICU_PTI_PER, pti_index)] = 0;
     281    xcu_address[XICU_REG(XICU_PTI_PER, pti_index)] = period;
    286282    return 0;
    287283#else
Note: See TracChangeset for help on using the changeset viewer.