Changeset 432
- Timestamp:
- Oct 4, 2014, 4:33:31 PM (10 years ago)
- Location:
- soft/giet_vm
- Files:
-
- 1 added
- 10 edited
- 5 copied
- 9 moved
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/Makefile
r420 r432 165 165 mcopy -o -i $(DISK_IMAGE) build/gameoflife/gameoflife.elf ::/build/gameoflife 166 166 mcopy -o -i $(DISK_IMAGE) build/dhrystone/dhrystone.elf ::/build/dhrystone 167 mcopy -o -i $(DISK_IMAGE) transpose/images.raw ::/misc168 mcopy -o -i $(DISK_IMAGE) convol/philips_image.raw ::/misc167 mcopy -o -i $(DISK_IMAGE) applications/transpose/images.raw ::/misc 168 mcopy -o -i $(DISK_IMAGE) applications/convol/philips_image.raw ::/misc 169 169 mcopy -o -i $(DISK_IMAGE) map.bin ::/ 170 170 ### Copy bootloader into sector 2 of disk image … … 194 194 195 195 ### mapping generation: map.bin / map.xml / hard_config.h / giet_vsegs.ld 196 map.bin hard_config.h giet_vsegs.ld: $(ARCH)/arch.py $(APP)/$(APP).py196 map.bin hard_config.h giet_vsegs.ld: $(ARCH)/arch.py applications/$(APP)/$(APP).py 197 197 giet_python/genmap --arch=$(ARCH) \ 198 198 --x=$(X_SIZE) \ … … 436 436 ######################################## 437 437 ### display application compilation 438 build/display/display.elf: $(DISPLAY_OBJS) display/display.ld hard_config.h439 $(LD) -o $@ -T display/display.ld $(DISPLAY_OBJS)440 $(DU) -D $@ > $@.txt 441 442 build/display/main.o: display/main_cma.c438 build/display/display.elf: $(DISPLAY_OBJS) applications/display/display.ld hard_config.h 439 $(LD) -o $@ -T applications/display/display.ld $(DISPLAY_OBJS) 440 $(DU) -D $@ > $@.txt 441 442 build/display/main.o: applications/display/main_cma.c 443 443 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 444 444 445 445 ######################################## 446 446 ### router compilation 447 build/router/router.elf: $(ROUTER_OBJS) router/router.ld hard_config.h448 $(LD) -o $@ -T router/router.ld $(ROUTER_OBJS)449 $(DU) -D $@ > $@.txt 450 451 build/router/main.o: router/main.c447 build/router/router.elf: $(ROUTER_OBJS) applications/router/router.ld hard_config.h 448 $(LD) -o $@ -T applications/router/router.ld $(ROUTER_OBJS) 449 $(DU) -D $@ > $@.txt 450 451 build/router/main.o: applications/router/main.c 452 452 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 453 453 454 454 ######################################## 455 455 ### hello compilation 456 build/hello/hello.elf: $(HELLO_OBJS) hello/hello.ld hard_config.h457 $(LD) -o $@ -T hello/hello.ld $(HELLO_OBJS)458 $(DU) -D $@ > $@.txt 459 460 build/hello/main.o: hello/main.c456 build/hello/hello.elf: $(HELLO_OBJS) applications/hello/hello.ld hard_config.h 457 $(LD) -o $@ -T applications/hello/hello.ld $(HELLO_OBJS) 458 $(DU) -D $@ > $@.txt 459 460 build/hello/main.o: applications/hello/main.c 461 461 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 462 462 463 463 ######################################## 464 464 ### pgcd compilation 465 build/pgcd/pgcd.elf: $(PGCD_OBJS) pgcd/pgcd.ld hard_config.h466 $(LD) -o $@ -T pgcd/pgcd.ld $(PGCD_OBJS)467 $(DU) -D $@ > $@.txt 468 469 build/pgcd/main.o: pgcd/main.c465 build/pgcd/pgcd.elf: $(PGCD_OBJS) applications/pgcd/pgcd.ld hard_config.h 466 $(LD) -o $@ -T applications/pgcd/pgcd.ld $(PGCD_OBJS) 467 $(DU) -D $@ > $@.txt 468 469 build/pgcd/main.o: applications/pgcd/main.c 470 470 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 471 471 472 472 ######################################## 473 473 ### gameoflife compilation 474 build/gameoflife/gameoflife.elf: $(GAMEOFLIFE_OBJS) gameoflife/gameoflife.ld475 $(LD) -o $@ -T gameoflife/gameoflife.ld $(GAMEOFLIFE_OBJS)476 $(DU) -D $@ > $@.txt 477 478 build/gameoflife/main.o: gameoflife/main.c474 build/gameoflife/gameoflife.elf: $(GAMEOFLIFE_OBJS) applications/gameoflife/gameoflife.ld 475 $(LD) -o $@ -T applications/gameoflife/gameoflife.ld $(GAMEOFLIFE_OBJS) 476 $(DU) -D $@ > $@.txt 477 478 build/gameoflife/main.o: applications/gameoflife/main.c 479 479 $(CC) $(USER_INCLUDE) $(CFLAGS) -O3 -c -o $@ $< 480 480 481 481 ######################################## 482 482 ### dhrystone compilation 483 build/dhrystone/dhrystone.elf: $(DHRYSTONE_OBJS) dhrystone/dhrystone.ld hard_config.h484 $(LD) -o $@ -T dhrystone/dhrystone.ld $(DHRYSTONE_OBJS)485 $(DU) -D $@ > $@.txt 486 487 build/dhrystone/dhry_1.o: dhrystone/dhry_1.c483 build/dhrystone/dhrystone.elf: $(DHRYSTONE_OBJS) applications/dhrystone/dhrystone.ld hard_config.h 484 $(LD) -o $@ -T applications/dhrystone/dhrystone.ld $(DHRYSTONE_OBJS) 485 $(DU) -D $@ > $@.txt 486 487 build/dhrystone/dhry_1.o: applications/dhrystone/dhry_1.c 488 488 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 489 489 490 build/dhrystone/dhry_2.o: dhrystone/dhry_2.c490 build/dhrystone/dhry_2.o: applications/dhrystone/dhry_2.c 491 491 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 492 492 493 493 ######################################## 494 494 ### sort compilation 495 build/sort/sort.elf: $(SORT_OBJS) sort/sort.ld hard_config.h496 $(LD) -o $@ -T sort/sort.ld $(SORT_OBJS)497 $(DU) -D $@ > $@.txt 498 499 build/sort/main.o: sort/main.c495 build/sort/sort.elf: $(SORT_OBJS) applications/sort/sort.ld hard_config.h 496 $(LD) -o $@ -T applications/sort/sort.ld $(SORT_OBJS) 497 $(DU) -D $@ > $@.txt 498 499 build/sort/main.o: applications/sort/main.c 500 500 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 501 501 502 502 ######################################## 503 503 ### transpose compilation 504 build/transpose/transpose.elf: $(TRANSPOSE_OBJS) transpose/transpose.ld hard_config.h505 $(LD) -o $@ -T transpose/transpose.ld $(TRANSPOSE_OBJS)506 $(DU) -D $@ > $@.txt 507 508 build/transpose/main.o: transpose/main.c504 build/transpose/transpose.elf: $(TRANSPOSE_OBJS) applications/transpose/transpose.ld hard_config.h 505 $(LD) -o $@ -T applications/transpose/transpose.ld $(TRANSPOSE_OBJS) 506 $(DU) -D $@ > $@.txt 507 508 build/transpose/main.o: applications/transpose/main.c 509 509 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 510 510 511 511 ######################################## 512 512 ### convol compilation 513 build/convol/convol.elf: $(CONVOL_OBJS) convol/convol.ld hard_config.h514 $(LD) -o $@ -T convol/convol.ld $(CONVOL_OBJS)515 $(DU) -D $@ > $@.txt 516 517 build/convol/main.o: convol/main.c513 build/convol/convol.elf: $(CONVOL_OBJS) applications/convol/convol.ld hard_config.h 514 $(LD) -o $@ -T applications/convol/convol.ld $(CONVOL_OBJS) 515 $(DU) -D $@ > $@.txt 516 517 build/convol/main.o: applications/convol/main.c 518 518 $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< 519 519 -
soft/giet_vm/applications/convol/main.c
r402 r432 94 94 int z; // vertical filter index for loops 95 95 96 // processor identifiers 97 unsigned int x; // x coordinate 98 unsigned int y; // y coordinate 99 unsigned int lpid; // local proc/task id 100 giet_proc_xyp( &x, &y, &lpid ); 101 96 102 int file = 0; // file descriptor 97 unsigned int pid = giet_procid(); // processor id98 103 unsigned int nprocs = NB_PROCS_MAX; // procs per cluster 99 104 unsigned int nclusters = NB_CLUSTERS; // number of clusters 100 unsigned int lpid = pid % nprocs; // local task id101 unsigned int cluster_xy = pid / nprocs; // cluster index102 unsigned int x = cluster_xy >> Y_WIDTH; // x coordinate103 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); // y coordinate104 105 unsigned int cluster_id = (x * Y_SIZE) + y; // continuous cluster index 105 106 unsigned int task_id = (cluster_id * nprocs) + lpid; // continuous task index … … 145 146 /////////////////////////////////////////////////////////////////// 146 147 147 if ( pid == 0)148 if ( (x==0) && (y==0) && (lpid==0) ) 148 149 { 149 150 giet_shr_printf("\n[CONVOL] task[0,0,0] starts barrier init at cycle %d\n" … … 237 238 // Other tasks are waiting on the init_ok condition. 238 239 ////////////////////////////////////////////////////////////////////////// 239 if ( pid == 0)240 if ( (x==0) && (y==0) && (lpid==0) ) 240 241 { 241 242 // open file … … 331 332 x, y, lpid, date ); 332 333 #else 333 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] starts horizontal filter" 334 " at cycle %d\n", date ); 334 if ( (x==0) && (y==0) && (lpid==0) ) 335 giet_shr_printf( "\n[CONVOL] task[0,0,0] starts horizontal filter" 336 " at cycle %d\n", date ); 335 337 #endif 336 338 … … 404 406 x, y, lpid, date ); 405 407 #else 406 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] completes horizontal filter" 407 " at cycle %d\n", date ); 408 if ( (x==0) && (y==0) && (lpid==0) ) 409 giet_shr_printf( "\n[CONVOL] task[0,0,0] completes horizontal filter" 410 " at cycle %d\n", date ); 408 411 #endif 409 412 … … 433 436 x, y, lpid, date ); 434 437 #else 435 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] starts vertical filter" 436 " at cycle %d\n", date ); 438 if ( (x==0) && (y==0) && (lpid==0) ) 439 giet_shr_printf( "\n[CONVOL] task[0,0,0] starts vertical filter" 440 " at cycle %d\n", date ); 437 441 #endif 438 442 … … 522 526 x, y, lpid, date ); 523 527 #else 524 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] completes vertical filter" 525 " at cycle %d\n", date ); 528 if ( (x==0) && (y==0) && (lpid==0) ) 529 giet_shr_printf( "\n[CONVOL] task[0,0,0] completes vertical filter" 530 " at cycle %d\n", date ); 526 531 #endif 527 532 … … 548 553 x, y, lpid, date); 549 554 #else 550 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] starts final display" 551 " at cycle %d\n", date ); 555 if ( (x==0) && (y==0) && (lpid==0) ) 556 giet_shr_printf( "\n[CONVOL] task[0,0,0] starts final display" 557 " at cycle %d\n", date ); 552 558 #endif 553 559 … … 579 585 x, y, lpid, date); 580 586 #else 581 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] completes final display" 582 " at cycle %d\n", date ); 587 if ( (x==0) && (y==0) && (lpid==0) ) 588 giet_shr_printf( "\n[CONVOL] task[0,0,0] completes final display" 589 " at cycle %d\n", date ); 583 590 #endif 584 591 … … 596 603 ///////////////////////////////////////////////////////// 597 604 598 if ( pid == 0)605 if ( (x==0) && (y==0) && (lpid==0) ) 599 606 { 600 607 date = giet_proctime(); -
soft/giet_vm/applications/display/main_cma.c
r297 r432 9 9 __attribute__((constructor)) void main(void) 10 10 { 11 // get processor identifiers 12 unsigned int x; 13 unsigned int y; 14 unsigned int lpid; 15 giet_proc_xyp( &x, &y, &lpid ); 16 11 17 int fd; 12 18 unsigned int blocks_to_skip = 0; 13 unsigned int procid = giet_procid();14 unsigned int cluster_xy = procid/NB_PROCS_MAX;15 unsigned int lpid = procid%NB_PROCS_MAX;16 unsigned int x = cluster_xy >> Y_WIDTH;17 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);18 19 19 20 giet_tty_printf( "*** Starting task display on processor[%d,%d,%d] at cycle %d\n\n", -
soft/giet_vm/applications/gameoflife/main.c
r388 r432 17 17 #define NB_ITERATION 1000000000 18 18 19 #define PRINTF(...) ({ if (giet_procid() ==0) { giet_tty_printf(__VA_ARGS__); } })19 #define PRINTF(...) ({ if ( proc_id==0) { giet_tty_printf(__VA_ARGS__); } }) 20 20 21 21 giet_barrier_t barriers[2]; … … 127 127 __attribute__((constructor)) void main() 128 128 { 129 unsigned int proc_id = giet_procid(); // processor id 129 // get processor identifier 130 unsigned int x; 131 unsigned int y; 132 unsigned int p; 133 giet_proc_xyp( &x, &y, &p ); 134 135 // compute continuous processor index 136 unsigned int proc_id = (((x * Y_SIZE) + y) * NB_PROCS_MAX) + p; 137 130 138 unsigned int nlocal_procs = NB_PROCS_MAX; // processors per cluster 131 139 unsigned int nclusters = X_SIZE*Y_SIZE; // number of clusters 132 unsigned int nglobal_procs = nclusters * nlocal_procs; // number of tasks140 unsigned int nglobal_procs = nclusters * nlocal_procs; // number of processors 133 141 size_t i; 134 142 … … 158 166 for (i = 0; i < NB_ITERATION; i++) 159 167 { 160 //PRINTF("\n*** Starting computation for iteration %d at cycle %d\n", i, giet_proctime());161 168 compute_new_gen(base_line, nb_line); 162 //PRINTF("\n*** Starting display for iteration %d at cycle %d\n", i, giet_proctime());163 169 grow_old_world(base_line, nb_line); 164 170 display_world(base_line, nb_line); -
soft/giet_vm/applications/hello/main.c
r387 r432 5 5 { 6 6 char byte; 7 unsigned int procid = giet_procid(); 8 unsigned int cluster_xy = procid/NB_PROCS_MAX; 9 unsigned int lpid = procid%NB_PROCS_MAX; 10 unsigned int x = cluster_xy >> Y_WIDTH; 11 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 7 8 // get processor identifiers 9 unsigned int x; 10 unsigned int y; 11 unsigned int lpid; 12 giet_proc_xyp( &x, &y, &lpid ); 12 13 13 14 giet_tty_printf( "*** Starting task hello on processor[%d,%d,%d] at cycle %d\n\n", -
soft/giet_vm/applications/pgcd/main.c
r295 r432 8 8 unsigned int opy; 9 9 10 unsigned int procid = giet_procid();11 unsigned int cluster_xy = procid/NB_PROCS_MAX;12 unsigned int lpid = procid%NB_PROCS_MAX;13 unsigned int x = cluster_xy >> Y_WIDTH;14 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);10 // get processor identifiers 11 unsigned int x; 12 unsigned int y; 13 unsigned int lpid; 14 giet_proc_xyp( &x, &y, &lpid ); 15 15 16 16 giet_tty_printf( "*** Starting task pgcd on processor[%d,%d,%d] at cycle %d\n\n", -
soft/giet_vm/applications/router/main.c
r345 r432 20 20 mwmr_channel_t* mwmr; 21 21 22 unsigned int procid = giet_procid();23 unsigned int cluster_xy = procid/NB_PROCS_MAX;24 unsigned int lpid = procid%NB_PROCS_MAX;25 unsigned int x = cluster_xy >> Y_WIDTH;26 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);22 // get processor identifiers 23 unsigned int x; 24 unsigned int y; 25 unsigned int lpid; 26 giet_proc_xyp( &x, &y, &lpid ); 27 27 28 28 printf( "*** Starting task producer on processor[%d,%d,%d] at cycle %d\n\n", … … 52 52 mwmr_channel_t* mwmr; 53 53 54 unsigned int procid = giet_procid();55 unsigned int cluster_xy = procid/NB_PROCS_MAX;56 unsigned int lpid = procid%NB_PROCS_MAX;57 unsigned int x = cluster_xy >> Y_WIDTH;58 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);54 // get processor identifiers 55 unsigned int x; 56 unsigned int y; 57 unsigned int lpid; 58 giet_proc_xyp( &x, &y, &lpid ); 59 59 60 60 printf( "*** Starting task consumer on processor[%d,%d,%d] at cycle %d\n\n", … … 85 85 mwmr_channel_t* mwmr_out ; 86 86 87 unsigned int procid = giet_procid();88 unsigned int cluster_xy = procid/NB_PROCS_MAX;89 unsigned int lpid = procid%NB_PROCS_MAX;90 unsigned int x = cluster_xy >> Y_WIDTH;91 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);87 // get processor identifiers 88 unsigned int x; 89 unsigned int y; 90 unsigned int lpid; 91 giet_proc_xyp( &x, &y, &lpid ); 92 92 93 93 printf( "*** Starting task router on processor[%d,%d,%d] at cycle %d\n\n", -
soft/giet_vm/applications/transpose/main.c
r398 r432 66 66 unsigned int c; // cluster index for loops 67 67 68 unsigned int proc_id = giet_procid(); // global processor id69 unsigned int lpid = proc_id % NB_PROCS_MAX; // local processor id70 unsigned int cluster_xy = proc_id / NB_PROCS_MAX; // 8 bits format71 unsigned int x = cluster_xy >> Y_WIDTH; // x coordinate72 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); // y coordinate68 // get processor identifiers 69 unsigned int x; // x cluster coordinate 70 unsigned int y; // y cluster coordinate 71 unsigned int lpid; // local processor index 72 giet_proc_xyp( &x, &y, &lpid); 73 73 74 74 unsigned int npixels = NN * NN; // pixels per image … … 83 83 // It includes parameters checking, barriers initialization, 84 84 // distributed buffers allocation, and file open 85 if ( proc_id == 0)85 if ( (x==0) && (y==0) && (lpid==0) ) 86 86 { 87 87 // Parameters checking … … 140 140 if (file < 0) 141 141 { 142 giet_shr_printf("\n[TRANSPOSE ERROR] Proc essor[%d,%d,%d]"142 giet_shr_printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d]" 143 143 " cannot open file misc/images.raw", 144 144 x, y, lpid ); … … 147 147 else 148 148 { 149 giet_shr_printf("\n[TRANSPOSE] Proc essor[0,0,0] open file misc/images.raw\n");149 giet_shr_printf("\n[TRANSPOSE] Proc [0,0,0] open file misc/images.raw\n"); 150 150 } 151 151 init_ok = 0; … … 154 154 { 155 155 while ( init_ok == 1 ); 156 giet_shr_printf("\n[TRANSPOSE] Processor[%d,%d,%d] starts at cycle %d\n", x, y, lpid); 156 157 } 157 158 158 159 159 ///////////////////////// 160 160 // Main loop (on images) … … 173 173 ((image*nblocks) + ((nblocks*cluster_id)/NB_CLUSTERS)) ); 174 174 175 giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d, 0] completes load"175 giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes load" 176 176 " for image %d at cycle %d\n", 177 x, y, image, giet_proctime() );177 x, y, lpid, image, giet_proctime() ); 178 178 } 179 179 … … 307 307 barrier_wait( &barrier ); 308 308 309 // instrumentation done by processor [0,0,0] 310 311 if ( (proc_id == 0) && INSTRUMENTATION_OK ) 309 // instrumentation done by processor [0,0,0] 310 if ( (x==0) && (y==0) && (lpid==0) && INSTRUMENTATION_OK ) 312 311 { 313 312 int cc, pp; … … 377 376 378 377 // Processor[0,0,0] releases the Distributed buffers 379 if ( proc_id == 0)378 if ( (x==0) && (y==0) && (lpid==0) ) 380 379 { 381 380 for ( c = 0 ; c < NB_CLUSTERS ; c++ ) -
soft/giet_vm/giet_config.h
r418 r432 32 32 #define GIET_DEBUG_FBF_DRIVER 0 /* trace FBF accesses */ 33 33 #define GIET_DEBUG_MALLOC 0 /* trace remote_malloc library */ 34 #define GIET_DEBUG_ SBT 0 /* trace SBTbarrier library */34 #define GIET_DEBUG_BARRIER 0 /* trace barrier library */ 35 35 36 36 #define CONFIG_SRL_VERBOSITY TRACE -
soft/giet_vm/giet_python/genmap
r425 r432 128 128 map_sort = options.sort # map "sort" application if True 129 129 map_convol = options.convol # map "convol" application if True 130 map_router = options.router # map "convol" application if True 130 131 131 132 ###################################################################################### … … 166 167 print '[genmap] application "convol" loaded' 167 168 169 if ( map_router ): 170 app = __import__( 'router' ) 171 app.router( mapping ) 172 print '[genmap] application "router" loaded' 173 168 174 ###################################################################################### 169 175 # Generate xml file if required.
Note: See TracChangeset
for help on using the changeset viewer.