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/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
Note: See TracChangeset for help on using the changeset viewer.