Ignore:
Timestamp:
Oct 4, 2014, 3:19:32 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_kernel/ctx_handler.c

    r391 r428  
    3333{
    3434    unsigned int gpid       = _get_procid();
    35     unsigned int cluster_xy = gpid / NB_PROCS_MAX;
    36     unsigned int lpid       = gpid % NB_PROCS_MAX;
     35    unsigned int cluster_xy = gpid >> P_WIDTH;
     36    unsigned int lpid       = gpid & ((1<<P_WIDTH)-1);
    3737
    3838    // get scheduler address
     
    104104{
    105105    unsigned int gpid       = _get_procid();
    106     unsigned int cluster_xy = gpid / NB_PROCS_MAX;
    107     unsigned int lpid       = gpid % NB_PROCS_MAX;
     106    unsigned int cluster_xy = gpid >> P_WIDTH;
    108107    unsigned int x          = cluster_xy >> Y_WIDTH;
    109108    unsigned int y          = cluster_xy & ((1<<Y_WIDTH)-1);
     109    unsigned int lpid       = gpid & ((1<<P_WIDTH)-1);
    110110
    111111    while(1)
Note: See TracChangeset for help on using the changeset viewer.