Changeset 431
- Timestamp:
- Oct 4, 2014, 3:35:35 PM (10 years ago)
- Location:
- soft/giet_vm/giet_libs
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/barrier.c
r382 r431 31 31 void barrier_wait( giet_barrier_t* barrier ) 32 32 { 33 34 #if GIET_DEBUG_BARRIER 35 unsigned int x; 36 unsigned int y; 37 unsigned int p; 38 giet_proc_xyp( &x, &y, &p ); 39 giet_shr_printf("[DEBUG BARRIER] proc[%d,%d,%d] enters barrier_wait()\n", x, y, p ); 40 #endif 41 33 42 // compute expected sense value 34 43 unsigned int expected; … … 75 84 76 85 asm volatile ("sync" ::: "memory"); 86 87 #if GIET_DEBUG_BARRIER 88 giet_shr_printf("[DEBUG BARRIER] proc[%d,%d,%d] exit barrier_wait()\n", x, y, p ); 89 #endif 90 77 91 } 78 92 … … 162 176 barrier->ntasks = ntasks; 163 177 164 #if GIET_DEBUG_ SBT165 giet_shr_printf("\n[DEBUG SBT] SBTnodes allocation / ntasks = %d\n", ntasks );178 #if GIET_DEBUG_BARRIER 179 giet_shr_printf("\n[DEBUG BARRIER] sbt_nodes allocation / ntasks = %d\n", ntasks ); 166 180 #endif 167 181 … … 188 202 barrier->node[x][y][l] = remote_malloc( SBT_NODE_SIZE, x, y ); 189 203 190 #if GIET_DEBUG_ SBT204 #if GIET_DEBUG_BARRIER 191 205 giet_shr_printf("[DEBUG SBT] node[%d][%d][%d] : vaddr = %x\n", 192 206 x, y, l, (unsigned int)barrier->node[x][y][l] ); … … 197 211 } 198 212 199 #if GIET_DEBUG_ SBT213 #if GIET_DEBUG_BARRIER 200 214 giet_shr_printf("\n[DEBUG SBT] SBT nodes initialisation\n"); 201 215 #endif … … 211 225 { 212 226 // 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 ); 217 231 218 232 // recursively decrement count from bottom to root … … 247 261 node->child1 = NULL; 248 262 249 #if GIET_DEBUG_ SBT250 giet_shr_printf("[DEBUG SBT] initializenode[%d][%d][%d] :"263 #if GIET_DEBUG_BARRIER 264 giet_shr_printf("[DEBUG BARRIER] initialize sbt_node[%d][%d][%d] :" 251 265 " arity = %d / child0 = %x / child1 = %x\n", 252 266 x, y, level, … … 288 302 node->child1 = barrier->node[x1][y1][level-1]; 289 303 290 #if GIET_DEBUG_ SBT291 giet_shr_printf("[DEBUG SBT] initializenode[%d][%d][%d] :"304 #if GIET_DEBUG_BARRIER 305 giet_shr_printf("[DEBUG BARRIER] initialize sbt_node[%d][%d][%d] :" 292 306 " arity = %d / child0 = %x / child1 = %x\n", 293 307 x, y, level, -
soft/giet_vm/giet_libs/malloc.c
r397 r431 302 302 void * malloc( unsigned int size ) 303 303 { 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 ); 308 309 309 310 return remote_malloc( size, x, y ); -
soft/giet_vm/giet_libs/remote_malloc.c
r375 r431 41 41 if ( align > 31 ) 42 42 { 43 giet_exit(" in remote_malloc(), align constraint > 31\n");43 giet_exit(" in remote_malloc(), align constraint > 31\n"); 44 44 } 45 45 … … 47 47 if ( length == 0 ) 48 48 { 49 giet_exit(" in remote_malloc(), requested length = 0\n");49 giet_exit(" in remote_malloc(), requested length = 0\n"); 50 50 } 51 51 52 #if GIET_DEBUG_MALLOC 53 unsigned int procid = giet_procid(); 54 unsigned int cluster = procid / NB_PROCS_MAX; 52 unsigned int gpid = giet_procid(); 53 unsigned int cluster = gpid >> P_WIDTH; 55 54 unsigned int proc_x = cluster >> Y_WIDTH; 56 55 unsigned int proc_y = cluster & ((1<<Y_WIDTH)-1); 57 unsigned int lpid = procid % NB_PROCS_MAX; 56 unsigned int lpid = gpid & ((1<<P_WIDTH)-1); 57 58 #if GIET_DEBUG_MALLOC 58 59 giet_shr_printf("\n[DEBUG MALLOC] Processor[%d,%d,%d] enters remote_malloc()" 59 60 " : length = %x / align = %x for heap(%d,%d)\n", … … 78 79 else 79 80 { 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; 83 83 } 84 84 -
soft/giet_vm/giet_libs/stdio.c
r390 r431 15 15 16 16 ///////////////// 17 int giet_procid() 18 { 19 return sys_call( SYSCALL_PROCID, 20 0, 0, 0, 0 ); 17 void 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 ); 21 26 } 22 27 -
soft/giet_vm/giet_libs/stdio.h
r390 r431 116 116 117 117 ////////////////////////////////////////////////////////////////////////// 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 ////////////////////////////////////////////////////////////////////////// 121 extern void giet_proc_xyp( unsigned int* cluster_x, 122 unsigned int* cluster_y, 123 unsigned int* lpid ); 121 124 122 125 //////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.