Changeset 630 for soft/giet_vm/giet_drivers/mwr_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/mwr_driver.c
r563 r630 41 41 #endif 42 42 43 44 ///////////////////////////////////////////////////////////////////////////// 45 // Global variables (all arrays are indexed by the cluster index) 43 ///////////////////////////////////////////////////////////////////////////// 44 // Extern variables 45 ///////////////////////////////////////////////////////////////////////////// 46 47 // allocated in the boot.c or kernel_init.c files 48 extern static_scheduler_t* _schedulers[X_SIZE][Y_SIZE][NB_PROCS_MAX]; 49 50 ///////////////////////////////////////////////////////////////////////////// 51 // Global variables 52 ///////////////////////////////////////////////////////////////////////////// 53 // All arrays are indexed by the cluster index. 46 54 ///////////////////////////////////////////////////////////////////////////// 47 55 … … 150 158 { 151 159 // get coprocessor coordinates and characteristics 152 // the processor executing the ISR an the coprocessor 153 // are in the same cluster 160 // processor executing ISR and coprocessor are in the same cluster 154 161 unsigned int gpid = _get_procid(); 155 162 unsigned int cluster_xy = gpid >> P_WIDTH; … … 160 167 unsigned int nb_to = info & 0xFF; 161 168 unsigned int nb_from = (info>>8) & 0xFF; 169 162 170 unsigned int channel; 163 171 unsigned int status; 164 172 unsigned int error = 0; 165 173 166 // check status, report errors and reset all channels174 // check status, report errors and reset for all channels 167 175 for ( channel = 0 ; channel < (nb_to + nb_from) ; channel++ ) 168 176 { … … 199 207 // identify task waiting on coprocessor completion 200 208 // this task can run in a remote cluster 201 unsigned int gtid = _coproc_gtid[cluster_id]; 202 unsigned int remote_procid = gtid>>16; 203 unsigned int ltid = gtid & 0xFFFF; 204 unsigned int remote_cluster = remote_procid >> P_WIDTH; 205 unsigned int remote_x = remote_cluster >> Y_WIDTH; 206 unsigned int remote_y = remote_cluster & ((1<<Y_WIDTH)-1); 207 unsigned int remote_p = remote_procid & ((1<<P_WIDTH)-1); 208 209 // re-activates sleeping task 210 _set_task_slot( remote_x, 211 remote_y, 212 remote_p, 213 ltid, 214 CTX_RUN_ID, // CTX_RUN slot 215 1 ); // running value 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); 216 217 // Reset NORUN_MASK_IOC bit 218 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]; 220 _atomic_and( ptr , ~NORUN_MASK_IOC ); 216 221 217 222 // send a WAKUP WTI to processor running the sleeping task 218 _xcu_send_wti( r emote_cluster,219 r emote_p,223 _xcu_send_wti( r_cluster, 224 r_p, 220 225 0 ); // don't force context switch 221 226 … … 224 229 _printf("\n[GIET DEBUG COPROC] P[%d,%d,%d] executes _mwr_isr() at cycle %d\n" 225 230 " for task %d running on P[%d,%d,%d] / error = %d\n", 226 x , y , p , _get_proctime() , ltid , r emote_x , remote_y , remote_p , error );227 #endif 228 } 231 x , y , p , _get_proctime() , ltid , r_x , r_y , r_p , error ); 232 #endif 233 } // end _mwr_isr() 229 234 230 235
Note: See TracChangeset
for help on using the changeset viewer.