Changeset 630 for soft/giet_vm/giet_drivers/bdv_driver.c
- Timestamp:
- Jul 18, 2015, 3:04:15 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/bdv_driver.c
r593 r630 23 23 24 24 /////////////////////////////////////////////////////////////////////////////// 25 // Extern variables 26 /////////////////////////////////////////////////////////////////////////////// 27 28 // allocated in the boot.c or kernel_init.c files 29 extern static_scheduler_t* _schedulers[X_SIZE][Y_SIZE][NB_PROCS_MAX]; 30 31 /////////////////////////////////////////////////////////////////////////////// 25 32 // Global variables 26 33 /////////////////////////////////////////////////////////////////////////////// … … 162 169 _it_disable( &save_sr ); 163 170 164 // reset runnable 165 _set_task_slot( x, y, p, ltid, CTX_RUN_ID, 0 ); 171 // Set NORUN_MASK_IOC bit 172 static_scheduler_t* psched = (static_scheduler_t*)_schedulers[x][y][p]; 173 unsigned int* ptr = &psched->context[ltid][CTX_NORUN_ID]; 174 _atomic_or( ptr , NORUN_MASK_IOC ); 166 175 167 176 // launch transfer … … 234 243 235 244 // identify task waiting on BDV 236 unsigned int remote_procid = _bdv_gtid>>16; 237 unsigned int ltid = _bdv_gtid & 0xFFFF; 238 unsigned int remote_cluster = remote_procid >> P_WIDTH; 239 unsigned int remote_x = remote_cluster >> Y_WIDTH; 240 unsigned int remote_y = remote_cluster & ((1<<Y_WIDTH)-1); 241 unsigned int remote_p = remote_procid & ((1<<P_WIDTH)-1); 242 243 // re-activates sleeping task 244 _set_task_slot( remote_x, 245 remote_y, 246 remote_p, 247 ltid, 248 CTX_RUN_ID, // CTX_RUN slot 249 1 ); // running value 245 unsigned int procid = _bdv_gtid>>16; 246 unsigned int ltid = _bdv_gtid & 0xFFFF; 247 unsigned int cluster = procid >> P_WIDTH; 248 unsigned int x = cluster >> Y_WIDTH; 249 unsigned int y = cluster & ((1<<Y_WIDTH)-1); 250 unsigned int p = procid & ((1<<P_WIDTH)-1); 251 252 // Reset NORUN_MASK_IOC bit 253 static_scheduler_t* psched = (static_scheduler_t*)_schedulers[x][y][p]; 254 unsigned int* ptr = &psched->context[ltid][CTX_NORUN_ID]; 255 _atomic_and( ptr , ~NORUN_MASK_IOC ); 250 256 251 257 // send a WAKUP WTI to processor running the sleeping task 252 _xcu_send_wti( remote_cluster,253 remote_p,258 _xcu_send_wti( cluster, 259 p, 254 260 0 ); // don't force context switch 255 261 256 262 #if GIET_DEBUG_IOC 257 unsigned int p rocid = _get_procid();258 unsigned int x = procid >> (Y_WIDTH + P_WIDTH);259 unsigned int y = (procid >> P_WIDTH) & ((1<<Y_WIDTH)-1);260 unsigned int p = procid & ((1<<P_WIDTH)-1);263 unsigned int pid = _get_procid(); 264 unsigned int c_x = pid >> (Y_WIDTH + P_WIDTH); 265 unsigned int c_y = (pid >> P_WIDTH) & ((1<<Y_WIDTH)-1); 266 unsigned int c_p = pid & ((1<<P_WIDTH)-1); 261 267 if ( _get_proctime() > GIET_DEBUG_IOC ) 262 268 _printf("\n[BDV DEBUG] Processor[%d,%d,%d] enters _bdv_isr() at cycle %d\n" 263 269 " for task %d running on P[%d,%d,%d] / bdv_status = %x\n", 264 x , y ,p , _get_proctime() ,265 ltid , remote_x , remote_y , remote_p , status );270 c_x , c_y , c_p , _get_proctime() , 271 ltid , x , y , p , status ); 266 272 #endif 267 273
Note: See TracChangeset
for help on using the changeset viewer.