Changeset 542 for soft/giet_vm/applications/classif
- Timestamp:
- Mar 30, 2015, 6:22:52 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/classif/main.c
r536 r542 33 33 // The MWMR fifo descriptors array is defined as a global variable in cluster[0][0]. 34 34 // 35 // Initialisation is done in two steps by the "load" & "store" tasks: 36 // - Task "load" in cluster[0][0] initialises the barrier between all "load" tasks, 37 // allocates NIC & CMA RX channel, and starts the NIC_CMA RX transfer. 35 // Initialisation is done in three steps by the "load" & "store" tasks: 36 // - Task "load" in cluster[0][0] initialises the heaps in all clusters. Other tasks 37 // are waiting on the global_sync synchronisation variable. 38 // - Then task "load" in cluster[0][0] initialises the barrier between all "load" 39 // tasks, allocates NIC & CMA RX channel, and starts the NIC_CMA RX transfer. 38 40 // Other "load" tasks are waiting on the load_sync synchronisation variable. 39 41 // Task "store" in cluster[0][0] initialises the barrier between all "store" tasks, … … 96 98 97 99 // global synchro signaling global initialisation completion 98 volatile unsigned int load_sync = 0; 99 volatile unsigned int store_sync = 0; 100 volatile unsigned int global_sync = 0; 101 volatile unsigned int load_sync = 0; 102 volatile unsigned int store_sync = 0; 100 103 101 104 // instrumentation counters … … 117 120 { 118 121 // each "load" task get platform parameters 119 unsigned int x_size; 122 unsigned int x_size; // number of clusters in a row 120 123 unsigned int y_size; // number of clusters in a column 121 124 unsigned int nprocs; // number of processors per cluster … … 133 136 giet_proc_xyp( &x, &y, &l ); 134 137 135 // "load" task[0][0] initialises barrier between all load tasks, 136 // allocates the NIC & CMA RX channels, and start the NIC_CMA RX transfer. 138 // "load" task[0][0] 139 // - initialises the heap in every cluster 140 // - initialises barrier between all load tasks, 141 // - allocates the NIC & CMA RX channels, and start the NIC_CMA RX transfer. 137 142 // Other "load" tasks wait completion 138 143 if ( (x==0) && (y==0) ) … … 141 146 " x_size = %d / y_size = %d / nprocs = %d\n", 142 147 x , y , l , giet_proctime() , x_size, y_size, nprocs ); 143 148 149 unsigned int xid; // x cluster coordinate index 150 unsigned int yid; // y cluster coordinate index 151 152 for ( xid = 0 ; xid < x_size ; xid++ ) 153 { 154 for ( yid = 0 ; yid < y_size ; yid++ ) 155 { 156 heap_init( xid, yid ); 157 } 158 } 159 160 global_sync = 1; 161 144 162 sqt_barrier_init( &rx_barrier, x_size , y_size , 1 ); 145 163 nic_rx_channel = giet_nic_rx_alloc( x_size , y_size ); … … 271 289 unsigned int l; 272 290 giet_proc_xyp( &x, &y, &l ); 291 292 // "Store" tasks wait completion of heaps initialization 293 while ( global_sync == 0 ) asm volatile ("nop"); 273 294 274 295 // "store" task[0][0] initialises the barrier between all "store" tasks, … … 419 440 x , y , l , giet_proctime() , x_size, y_size, nprocs ); 420 441 } 421 422 // all "analyse" tasks wait mwmr channels initialisation442 443 // all "analyse" tasks wait heaps and mwmr channels initialisation 423 444 while ( local_sync[x][y] == 0 ) asm volatile ("nop"); 424 445
Note: See TracChangeset
for help on using the changeset viewer.