Changeset 549 for soft/giet_vm/applications/classif
- Timestamp:
- Apr 5, 2015, 12:16:18 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/classif/main.c
r542 r549 34 34 // 35 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 tasks37 // 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.40 // Other "load" tasks are waiting on the load_sync synchronisation variable.41 // Task "store" in cluster[0][0] initialises the barrier between all "store" tasks,42 // allocates NIC & CMA TX channels, and starts the NIC_CMA TX transfer.43 // Other "store" tasks are waiting on the store_sync synchronisation variable.44 // -When this global initialisation is completed, the "load" task in all clusters45 // allocates the working containers and the MWMR fifos descriptors from the46 // user local heap. In each cluster, the "analyse" and "store" tasks are waiting47 // the local initialisation completion on the local_sync[x][y] variables.36 // 1) Task "load" in cluster[0][0] initialises the heaps in all clusters. Other tasks 37 // are waiting on the global_sync synchronisation variable. 38 // 2) 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. 40 // Other "load" tasks are waiting on the load_sync synchronisation variable. 41 // Task "store" in cluster[0][0] initialises the barrier between all "store" tasks, 42 // allocates NIC & CMA TX channels, and starts the NIC_CMA TX transfer. 43 // Other "store" tasks are waiting on the store_sync synchronisation variable. 44 // 3) When this global initialisation is completed, the "load" task in all clusters 45 // allocates the working containers and the MWMR fifos descriptors from the 46 // user local heap. In each cluster, the "analyse" and "store" tasks are waiting 47 // the local initialisation completion on the local_sync[x][y] variables. 48 48 // 49 49 // When initialisation is completed, all tasks loop on containers: … … 82 82 // The MWMR channels (descriptors and buffers), as well as the working containers 83 83 // used by the "analysis" tasks are distributed in clusters. 84 // But the pointers on these distributed structures are shared arrays 85 // stored in cluster[0][0]. 84 // But the pointers on these distributed structures are stored in cluster[0][0]. 86 85 /////////////////////////////////////////////////////////////////////////////////////// 87 86 … … 143 142 if ( (x==0) && (y==0) ) 144 143 { 145 giet_shr_printf("\n*** Task load on P[%d][%d][%d] starts at cycle %d\n" 144 giet_tty_alloc(); 145 146 giet_tty_printf("\n*** Task load on P[%d][%d][%d] starts at cycle %d\n" 146 147 " x_size = %d / y_size = %d / nprocs = %d\n", 147 148 x , y , l , giet_proctime() , x_size, y_size, nprocs ); 148 149 149 unsigned int xid; // x cluster coordinate index150 unsigned int yid; // y cluster coordinate index151 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 }150 unsigned int xid; // x cluster coordinate index 151 unsigned int yid; // y cluster coordinate index 152 153 for ( xid = 0 ; xid < x_size ; xid++ ) 154 { 155 for ( yid = 0 ; yid < y_size ; yid++ ) 156 { 157 heap_init( xid, yid ); 158 } 159 } 159 160 160 global_sync = 1;161 global_sync = 1; 161 162 162 163 sqt_barrier_init( &rx_barrier, x_size , y_size , 1 ); … … 213 214 // load task[0][0] displays status 214 215 if ( (x==0) && (y==0) ) 215 giet_ shr_printf("\n*** Task load on P[%d,%d,%d] enters main loop at cycle %d\n"216 giet_tty_printf("\n*** Task load on P[%d,%d,%d] enters main loop at cycle %d\n" 216 217 " nic_rx_channel = %d / nic_tx_channel = %d\n" 217 218 " &mwmr_l2a = %x / &data_l2a = %x\n" … … 248 249 249 250 if ( (x==0) && (y==0) ) 250 giet_ shr_printf("\n*** Task load on P[%d,%d,%d] get container %d at cycle %d"251 giet_tty_printf("\n*** Task load on P[%d,%d,%d] get container %d at cycle %d" 251 252 " : %d packets / %d words\n", 252 253 x, y, l, count, giet_proctime(), npackets, nwords ); … … 298 299 if ( (x==0) && (y==0) ) 299 300 { 300 giet_shr_printf("\n*** Task store on P[%d][%d][%d] starts at cycle %d\n" 301 giet_tty_alloc(); 302 303 giet_tty_printf("\n*** Task store on P[%d][%d][%d] starts at cycle %d\n" 301 304 " x_size = %d / y_size = %d / nprocs = %d\n", 302 305 x , y , l , giet_proctime() , x_size, y_size, nprocs ); … … 332 335 // "store" task[0][0] displays status 333 336 if ( (x==0) && (y==0) ) 334 giet_ shr_printf("\n*** Task store on P[%d,%d,%d] enters main loop at cycle %d\n"337 giet_tty_printf("\n*** Task store on P[%d,%d,%d] enters main loop at cycle %d\n" 335 338 " &mwmr_l2a = %x\n" 336 339 " &mwmr_a2s = %x\n" … … 364 367 365 368 if ( (x==0) && (y==0) ) 366 giet_ shr_printf("\n*** Task store on P[%d,%d,%d] get container %d at cycle %d"369 giet_tty_printf("\n*** Task store on P[%d,%d,%d] get container %d at cycle %d" 367 370 " : %d packets / %d words\n", 368 371 x, y, l, count, giet_proctime(), npackets, nwords ); … … 382 385 giet_nic_tx_stop( nic_tx_channel ); 383 386 384 giet_ shr_printf("\n@@@@ Classification Results @@@\n"387 giet_tty_printf("\n@@@@ Classification Results @@@\n" 385 388 " - TYPE 0 : %d packets\n" 386 389 " - TYPE 1 : %d packets\n" … … 436 439 if ( (x==0) && (y==0) ) 437 440 { 438 giet_shr_printf("\n*** Task analyse on P[%d][%d][%d] starts at cycle %d\n" 441 giet_tty_alloc(); 442 443 giet_tty_printf("\n*** Task analyse on P[%d][%d][%d] starts at cycle %d\n" 439 444 " x_size = %d / y_size = %d / nprocs = %d\n", 440 445 x , y , l , giet_proctime() , x_size, y_size, nprocs ); … … 459 464 // "analyse" task[0][0] display status 460 465 if ( (x==0) && (y==0) ) 461 giet_ shr_printf("\n*** Task analyse on P[%d,%d,%d] enters main loop at cycle %d\n"466 giet_tty_printf("\n*** Task analyse on P[%d,%d,%d] enters main loop at cycle %d\n" 462 467 " &mwmr_l2a = %x\n" 463 468 " &mwmr_a2s = %x\n" … … 505 510 506 511 if ( (x==0) && (y==0) ) 507 giet_ shr_printf("\n*** Task analyse on P[%d,%d,%d] get container at cycle %d"512 giet_tty_printf("\n*** Task analyse on P[%d,%d,%d] get container at cycle %d" 508 513 " : %d packets / %d words\n", 509 514 x, y, l, giet_proctime(), npackets, nwords ); … … 552 557 #if VERBOSE_ANALYSE 553 558 if ( (x==0) && (y==0) ) 554 giet_ shr_printf("\n*** Task analyse on P[%d,%d,%d] completes at cycle %d\n"559 giet_tty_printf("\n*** Task analyse on P[%d,%d,%d] completes at cycle %d\n" 555 560 " - Packet 0 : plen = %d / dst_mac = %l / src_mac = %l\n" 556 561 " - Packet 1 : plen = %d / dst_mac = %l / src_mac = %l\n" … … 577 582 578 583 // pseudo-random delay 579 for( p = 0 ; p < (giet_rand()>>4) ; p++ ) asm volatile ("nop"); 584 unsigned int delay = giet_rand()>>3; 585 for( p = 0 ; p < delay ; p++ ) asm volatile ("nop"); 580 586 581 587 // put the working container index to fifo_a2s
Note: See TracChangeset
for help on using the changeset viewer.