Ignore:
Timestamp:
Oct 4, 2014, 3:35:35 PM (10 years ago)
Author:
alain
Message:

Introducing fixed format (X_WIDTH / Y_WIDTH / P_WIDTH) for processor index.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_libs/barrier.c

    r382 r431  
    3131void barrier_wait( giet_barrier_t* barrier )
    3232{
     33
     34#if GIET_DEBUG_BARRIER
     35unsigned int x;
     36unsigned int y;
     37unsigned int p;
     38giet_proc_xyp( &x, &y, &p );
     39giet_shr_printf("[DEBUG BARRIER] proc[%d,%d,%d] enters barrier_wait()\n", x, y, p );
     40#endif
     41
    3342    // compute expected sense value
    3443    unsigned int expected;
     
    7584
    7685    asm volatile ("sync" ::: "memory");
     86
     87#if GIET_DEBUG_BARRIER
     88giet_shr_printf("[DEBUG BARRIER] proc[%d,%d,%d] exit barrier_wait()\n", x, y, p );
     89#endif
     90
    7791}
    7892
     
    162176    barrier->ntasks = ntasks;
    163177   
    164 #if GIET_DEBUG_SBT
    165 giet_shr_printf("\n[DEBUG SBT] SBT nodes allocation / ntasks = %d\n", ntasks );
     178#if GIET_DEBUG_BARRIER
     179giet_shr_printf("\n[DEBUG BARRIER] sbt_nodes allocation / ntasks = %d\n", ntasks );
    166180#endif
    167181
     
    188202                     barrier->node[x][y][l] = remote_malloc( SBT_NODE_SIZE, x, y );
    189203
    190 #if GIET_DEBUG_SBT
     204#if GIET_DEBUG_BARRIER
    191205giet_shr_printf("[DEBUG SBT] node[%d][%d][%d] : vaddr = %x\n",
    192206                x, y, l, (unsigned int)barrier->node[x][y][l] );
     
    197211    }
    198212           
    199 #if GIET_DEBUG_SBT
     213#if GIET_DEBUG_BARRIER
    200214giet_shr_printf("\n[DEBUG SBT] SBT nodes initialisation\n");
    201215#endif
     
    211225{
    212226    // compute cluster coordinates for the calling task
    213     unsigned int procid     = giet_procid();
    214     unsigned int cluster_xy = procid / NB_PROCS_MAX;
    215     unsigned int x          = cluster_xy >> Y_WIDTH;
    216     unsigned int y          = cluster_xy & ((1<<Y_WIDTH)-1);
     227    unsigned int    x;
     228    unsigned int    y;
     229    unsigned int    lpid;
     230    giet_proc_xyp( &x, &y, &lpid );
    217231
    218232    // recursively decrement count from bottom to root
     
    247261        node->child1   = NULL;
    248262
    249 #if GIET_DEBUG_SBT
    250 giet_shr_printf("[DEBUG SBT] initialize node[%d][%d][%d] :"
     263#if GIET_DEBUG_BARRIER
     264giet_shr_printf("[DEBUG BARRIER] initialize sbt_node[%d][%d][%d] :"
    251265                " arity = %d / child0 = %x / child1 = %x\n",
    252266                x, y, level,
     
    288302        node->child1   = barrier->node[x1][y1][level-1];
    289303
    290 #if GIET_DEBUG_SBT
    291 giet_shr_printf("[DEBUG SBT] initialize node[%d][%d][%d] :"
     304#if GIET_DEBUG_BARRIER
     305giet_shr_printf("[DEBUG BARRIER] initialize sbt_node[%d][%d][%d] :"
    292306                " arity = %d / child0 = %x / child1 = %x\n",
    293307                x, y, level,
Note: See TracChangeset for help on using the changeset viewer.