Changeset 644 for soft/giet_vm/applications
- Timestamp:
- Jul 22, 2015, 1:00:45 PM (9 years ago)
- Location:
- soft/giet_vm/applications/display
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/display/display.py
r610 r644 33 33 34 34 # create vspace 35 vspace = mapping.addVspace( name = 'display', startname = 'disp_data' )35 vspace = mapping.addVspace( name = 'display', startname = 'disp_data', active = False ) 36 36 37 37 # data vseg … … 58 58 59 59 # task 60 mapping.addTask( vspace, 'disp', 0, 0, 0, 0, 'disp_stack', 'disp_heap', 0 )60 mapping.addTask( vspace, 'disp', 0, 0, 0, 1, 'disp_stack', 'disp_heap', 0 ) 61 61 62 62 # extend mapping name -
soft/giet_vm/applications/display/main.c
r589 r644 1 1 /////////////////////////////////////////////////////////////////////////////////////// 2 // file : main.c (fordisplay application)2 // file : main.c (display application) 3 3 // date : may 2014 4 4 // author : Alain Greiner … … 12 12 #include <hard_config.h> // To check Frame Buffer size 13 13 14 #define FILENAME "misc/ lena.raw"15 #define NPIXELS 25616 #define NLINES 25617 #define NIMAGES 1 14 #define FILENAME "misc/images_128.raw" 15 #define NPIXELS 128 16 #define NLINES 128 17 #define NIMAGES 10 18 18 19 19 #define INTERACTIVE 1 20 20 21 unsigned char buf0[NPIXELS*NLINES] __attribute__((aligned(512))); 22 unsigned char buf1[NPIXELS*NLINES] __attribute__((aligned(512))); 21 unsigned char buf0[NPIXELS*NLINES] __attribute__((aligned(64))); 22 unsigned char buf1[NPIXELS*NLINES] __attribute__((aligned(64))); 23 24 unsigned int sts0[16] __attribute__((aligned(64))); 25 unsigned int sts1[16] __attribute__((aligned(64))); 23 26 24 27 //////////////////////////////////////////// … … 29 32 unsigned int x; 30 33 unsigned int y; 31 unsigned int lpid;32 giet_proc_xyp( &x, &y, & lpid);34 unsigned int p; 35 giet_proc_xyp( &x, &y, &p ); 33 36 34 37 int fd; … … 46 49 giet_tty_alloc(); 47 50 48 giet_tty_printf("\n[DISPLAY] Processor[%d,%d,%d] starts at cycle %d\n", 49 x, y, lpid, giet_proctime() ); 51 giet_tty_printf("\n[DISPLAY] P[%d,%d,%d] starts at cycle %d\n" 52 " - buf0_vaddr = %x\n" 53 " - buf1_vaddr = %x\n" 54 " - sts0_vaddr = %x\n" 55 " - sts1_vaddr = %x\n", 56 x, y, p, giet_proctime(), 57 buf0, buf1, sts0, sts1 ); 50 58 51 59 // open file 52 60 fd = giet_fat_open( FILENAME , 0 ); 53 61 54 giet_tty_printf("\n[DISPLAY] P roc[%d,%d,%d] open file %s at cycle %d\n",55 x, y, lpid, FILENAME, giet_proctime() );62 giet_tty_printf("\n[DISPLAY] P[%d,%d,%d] open file %s at cycle %d\n", 63 x, y, p, FILENAME, giet_proctime() ); 56 64 57 65 // get a Chained Buffer DMA channel 58 66 giet_fbf_cma_alloc(); 59 67 68 // initialize the source and destination chbufs 69 giet_fbf_cma_init_buf( buf0 , buf1 , sts0 , sts1 ); 70 60 71 // start Chained Buffer DMA channel 61 giet_fbf_cma_start( buf0, buf1,NPIXELS*NLINES );72 giet_fbf_cma_start( NPIXELS*NLINES ); 62 73 63 74 giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] starts CMA at cycle %d\n", 64 x, y, lpid, giet_proctime() );75 x, y, p, giet_proctime() ); 65 76 66 // Main loop (on images)77 // Main loop on images 67 78 while ( 1 ) 68 79 { … … 71 82 72 83 giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] load image %d at cycle %d\n", 73 x, y, lpid, image, giet_proctime() );84 x, y, p, image, giet_proctime() ); 74 85 75 86 // display buf0 … … 77 88 78 89 giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] display image %d at cycle %d\n", 79 x, y, lpid, image, giet_proctime() );90 x, y, p, image, giet_proctime() ); 80 91 81 image = (image + 1) % NIMAGES; 92 image++; 93 94 if ( image == NIMAGES ) 95 { 96 image = 0; 97 giet_fat_lseek( fd , 0 , 0 ); 98 } 82 99 83 100 if ( INTERACTIVE ) giet_tty_getc( &byte ); … … 87 104 88 105 giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] load image %d at cycle %d\n", 89 x, y, lpid, image, giet_proctime() );106 x, y, p, image, giet_proctime() ); 90 107 91 108 // display buf1 … … 93 110 94 111 giet_tty_printf("\n[DISPLAY] Proc[%d,%d,%d] display image %d at cycle %d\n", 95 x, y, lpid, image, giet_proctime() );112 x, y, p, image, giet_proctime() ); 96 113 97 image = (image + 1) % NIMAGES; 114 image++; 115 116 if ( image == NIMAGES ) 117 { 118 image = 0; 119 giet_fat_lseek( fd , 0 , 0 ); 120 } 98 121 99 122 if ( INTERACTIVE ) giet_tty_getc( &byte );
Note: See TracChangeset
for help on using the changeset viewer.