Changeset 376 for soft/giet_vm/giet_libs


Ignore:
Timestamp:
Aug 2, 2014, 1:31:56 PM (10 years ago)
Author:
alain
Message:

Fix a bug in sbt_build() function.

File:
1 edited

Legend:

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

    r375 r376  
    246246        node->child0   = NULL;
    247247        node->child1   = NULL;
     248
     249#if GIET_DEBUG_SBT
     250giet_shr_printf("[DEBUG SBT] initialize node[%d][%d][%d] :"
     251                " arity = %d / child0 = %x / child1 = %x\n",
     252                x, y, level,
     253                node->arity, node->child0, node->child1 );
     254#endif
     255
    248256    }
    249257    else                   // non terminal case
     
    254262        unsigned int y1;   // y coordinate for child1;
    255263
    256         // the child1 coordinates depends on the level value
     264        // the child0 coordinates are equal to the parent coordinates
     265        // the child1 coordinates are incremented depending on the level value
    257266        if ( level & 0x1 ) // odd level => X binary tree
    258267        {
    259268            x0 = x;
    260269            y0 = y;
    261             x1 = x + (1 << ((level-1)>>2));
     270            x1 = x + (1 << ((level-1)>>1));
    262271            y1 = y;
    263272        }   
     
    267276            y0 = y;
    268277            x1 = x;
    269             y1 = y + (1 << ((level-1)>>2));
     278            y1 = y + (1 << ((level-1)>>1));
    270279        }
    271280
     
    279288        node->child1   = barrier->node[x1][y1][level-1];
    280289
    281         // recursive calls for children nodes
    282         sbt_build( barrier , x0 , y0 , level-1 , node );
    283         sbt_build( barrier , x1 , y1 , level-1 , node );
    284     }
    285 
    286290#if GIET_DEBUG_SBT
    287291giet_shr_printf("[DEBUG SBT] initialize node[%d][%d][%d] :"
     
    290294                node->arity, node->child0, node->child1 );
    291295#endif
     296
     297        // recursive calls for children nodes
     298        sbt_build( barrier , x0 , y0 , level-1 , node );
     299        sbt_build( barrier , x1 , y1 , level-1 , node );
     300    }
    292301
    293302}  // end sbt_build()
Note: See TracChangeset for help on using the changeset viewer.