Changeset 431


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.

Location:
soft/giet_vm/giet_libs
Files:
5 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,
  • soft/giet_vm/giet_libs/malloc.c

    r397 r431  
    302302void * malloc( unsigned int size )
    303303{
    304     unsigned int proc_id    = giet_procid();
    305     unsigned int cluster_xy = proc_id / NB_PROCS_MAX;
    306     unsigned int x          = cluster_xy >> Y_WIDTH;
    307     unsigned int y          = cluster_xy & ((1<<Y_WIDTH)-1);
     304    // get cluster coordinates
     305    unsigned int    x;
     306    unsigned int    y;
     307    unsigned int    lpid;
     308    giet_proc_xyp( &x, &y, &lpid );
    308309
    309310    return remote_malloc( size, x, y );
  • soft/giet_vm/giet_libs/remote_malloc.c

    r375 r431  
    4141    if ( align > 31  )
    4242    {
    43         giet_exit("in remote_malloc(), align constraint > 31\n");
     43        giet_exit(" in remote_malloc(), align constraint > 31\n");
    4444    }
    4545
     
    4747    if ( length == 0 )
    4848    {
    49         giet_exit("in remote_malloc(), requested length = 0\n");
     49        giet_exit(" in remote_malloc(), requested length = 0\n");
    5050    }
    5151
    52 #if GIET_DEBUG_MALLOC
    53 unsigned int procid  = giet_procid();
    54 unsigned int cluster = procid / NB_PROCS_MAX;
     52unsigned int gpid    = giet_procid();
     53unsigned int cluster = gpid >> P_WIDTH;
    5554unsigned int proc_x  = cluster >> Y_WIDTH;
    5655unsigned int proc_y  = cluster & ((1<<Y_WIDTH)-1);
    57 unsigned int lpid    = procid % NB_PROCS_MAX;
     56unsigned int lpid    = gpid & ((1<<P_WIDTH)-1);
     57
     58#if GIET_DEBUG_MALLOC
    5859giet_shr_printf("\n[DEBUG MALLOC] Processor[%d,%d,%d] enters remote_malloc()"
    5960                " : length = %x / align = %x for heap(%d,%d)\n",
     
    7879    else
    7980    {
    80         unsigned int pid = giet_procid();
    81         heap_x = (pid / NB_PROCS_MAX) >> Y_WIDTH;
    82         heap_y = (pid / NB_PROCS_MAX) & ((1<<Y_WIDTH)-1);
     81        heap_x = proc_x;
     82        heap_y = proc_y;
    8383    }
    8484
  • soft/giet_vm/giet_libs/stdio.c

    r390 r431  
    1515
    1616/////////////////
    17 int giet_procid()
    18 {
    19     return sys_call( SYSCALL_PROCID,
    20                      0, 0, 0, 0 );
     17void giet_proc_xyp( unsigned int* cluster_x,
     18                    unsigned int* cluster_y,
     19                    unsigned int* lpid )
     20{
     21    sys_call( SYSCALL_PROCID,
     22              (unsigned int)cluster_x,
     23              (unsigned int)cluster_y,
     24              (unsigned int)lpid,
     25               0 );
    2126}
    2227
  • soft/giet_vm/giet_libs/stdio.h

    r390 r431  
    116116
    117117//////////////////////////////////////////////////////////////////////////
    118 // This function returns the processor identifier.
    119 //////////////////////////////////////////////////////////////////////////
    120 extern int giet_procid();
     118// This function returns the processor (x,y,lpid) identifier:
     119// (x,y) are the cluster coordinates / lpid is the local processor index.
     120//////////////////////////////////////////////////////////////////////////
     121extern void giet_proc_xyp( unsigned int* cluster_x,
     122                           unsigned int* cluster_y,
     123                           unsigned int* lpid );
    121124
    122125//////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.