Changeset 544 for soft/giet_vm
- Timestamp:
- Apr 4, 2015, 11:34:33 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/display/main.c
r480 r544 15 15 #define NPIXELS 128 16 16 #define NLINES 128 17 #define NIMAGES 1017 #define NIMAGES 20 18 18 #define NBLOCKS (NPIXELS*NLINES/512) // number of blocks per image 19 19 20 #define INTERACTIVE 1 20 21 21 22 unsigned char buf0[NPIXELS*NLINES] __attribute__((aligned(512))); … … 35 36 unsigned int image = 0; 36 37 38 char byte; 39 37 40 // parameters checking 38 41 if ( (NPIXELS != FBUF_X_SIZE) || (NLINES != FBUF_Y_SIZE) ) … … 41 44 } 42 45 43 giet_shr_printf("\n[DISPLAY] Processor[%d,%d,%d] starts at cycle %d\n", 46 // get a private TTY 47 giet_tty_alloc(); 48 49 giet_tty_printf("\n[DISPLAY] Processor[%d,%d,%d] starts at cycle %d\n", 44 50 x, y, lpid, giet_proctime() ); 45 51 46 52 // open file 47 53 fd = giet_fat_open( FILENAME , 0 ); 48 if ( fd < 0 ) 49 { 50 giet_exit("echec giet_fat_open for misc/images.raw"); 51 } 52 else 53 { 54 giet_shr_printf("\n[DISPLAY] Proc[%d,%d,%d] open file %s at cycle %d\n", 54 55 giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] open file %s at cycle %d\n", 55 56 x, y, lpid, FILENAME, giet_proctime() ); 56 }57 57 58 58 // get a Chained Buffer DMA channel … … 62 62 giet_fbf_cma_start( buf0, buf1, NPIXELS*NLINES ); 63 63 64 giet_ shr_printf("\n[DISPLAY] Proc[%d,%d,%d] starts CMA at cycle %d\n",64 giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] starts CMA at cycle %d\n", 65 65 x, y, lpid, giet_proctime() ); 66 66 67 67 // Main loop (on images) 68 while ( image < NIMAGES)68 while ( 1 ) 69 69 { 70 70 // load buf0 71 71 giet_fat_read( fd, buf0, NBLOCKS, image*NBLOCKS ); 72 72 73 giet_ shr_printf("\n[DISPLAY] Proc[%d,%d,%d] load image %d to buf0at cycle %d\n",73 giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] load image %d at cycle %d\n", 74 74 x, y, lpid, image, giet_proctime() ); 75 75 … … 77 77 giet_fbf_cma_display( 0 ); 78 78 79 giet_ shr_printf("\n[DISPLAY] Proc[%d,%d,%d] display image %d from buf0at cycle %d\n",79 giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] display image %d at cycle %d\n", 80 80 x, y, lpid, image, giet_proctime() ); 81 81 82 image++; 82 image = (image + 1) % NIMAGES; 83 84 if ( INTERACTIVE ) giet_tty_getc( &byte ); 83 85 84 86 // load buf1 85 87 giet_fat_read( fd, buf1, NBLOCKS, image*NBLOCKS ); 86 88 87 giet_ shr_printf("\n[DISPLAY] Proc[%d,%d,%d] load image %d to buf1at cycle %d\n",89 giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] load image %d at cycle %d\n", 88 90 x, y, lpid, image, giet_proctime() ); 89 91 … … 91 93 giet_fbf_cma_display( 1 ); 92 94 93 giet_ shr_printf("\n[DISPLAY] Proc[%d,%d,%d] display image %d from buf1at cycle %d\n",95 giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] display image %d at cycle %d\n", 94 96 x, y, lpid, image, giet_proctime() ); 95 97 96 image++; 98 image = (image + 1) % NIMAGES; 99 100 if ( INTERACTIVE ) giet_tty_getc( &byte ); 97 101 } 98 102
Note: See TracChangeset
for help on using the changeset viewer.