Changeset 709 for soft/giet_vm/giet_drivers/mwr_driver.c
- Timestamp:
- Oct 1, 2015, 4:20:46 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/mwr_driver.c
r668 r709 74 74 unsigned int _coproc_error[X_SIZE*Y_SIZE]; 75 75 76 // descheduled t ask gtid (for MODE_DMA_IRQ)77 __attribute__((section(".kdata"))) 78 unsigned int _coproc_ gtid[X_SIZE*Y_SIZE];76 // descheduled thread trdid (for MODE_DMA_IRQ) 77 __attribute__((section(".kdata"))) 78 unsigned int _coproc_trdid[X_SIZE*Y_SIZE]; 79 79 80 80 ///////////////////////////////////////////////////////////////////////////// … … 205 205 _coproc_error[cluster_id] = error; 206 206 207 // identify task waiting on coprocessor completion 208 // this task can run in a remote cluster 209 unsigned int r_gtid = _coproc_gtid[cluster_id]; 210 unsigned int r_procid = r_gtid>>16; 211 unsigned int r_ltid = r_gtid & 0xFFFF; 212 unsigned int r_cluster = r_procid >> P_WIDTH; 213 unsigned int r_x = r_cluster >> Y_WIDTH; 214 unsigned int r_y = r_cluster & ((1<<Y_WIDTH)-1); 215 unsigned int r_p = r_procid & ((1<<P_WIDTH)-1); 207 // identify thread waiting on coprocessor completion (can run in a remote cluster) 208 unsigned int r_x = (_coproc_trdid[cluster_id]>>24) & 0xFF; 209 unsigned int r_y = (_coproc_trdid[cluster_id]>>16) & 0xFF; 210 unsigned int r_p = (_coproc_trdid[cluster_id]>> 8) & 0xFF; 211 unsigned int r_ltid = (_coproc_trdid[cluster_id] ) & 0xFF; 216 212 217 213 // Reset NORUN_MASK_IOC bit 218 214 static_scheduler_t* psched = (static_scheduler_t*)_schedulers[r_x][r_y][r_p]; 219 unsigned int* ptr = &psched->context[r_ltid] [CTX_NORUN_ID];215 unsigned int* ptr = &psched->context[r_ltid].slot[CTX_NORUN_ID]; 220 216 _atomic_and( ptr , ~NORUN_MASK_COPROC ); 221 217 222 // send a WAKUP WTI to processor running the sleeping t ask223 _xcu_send_wti( r_cluster,218 // send a WAKUP WTI to processor running the sleeping thread 219 _xcu_send_wti( (r_x<<Y_WIDTH) + r_y, 224 220 r_p, 225 221 0 ); // don't force context switch … … 228 224 unsigned int p = gpid & ((1<<P_WIDTH)-1); 229 225 _printf("\n[GIET DEBUG COPROC] P[%d,%d,%d] executes _mwr_isr() at cycle %d\n" 230 " for t ask%d running on P[%d,%d,%d] / error = %d\n",226 " for thread %d running on P[%d,%d,%d] / error = %d\n", 231 227 x , y , p , _get_proctime() , r_ltid , r_x , r_y , r_p , error ); 232 228 #endif
Note: See TracChangeset
for help on using the changeset viewer.