Changeset 295 for soft/giet_vm/display/main_cma.c
- Timestamp:
- Mar 26, 2014, 6:44:44 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/display/main_cma.c
r258 r295 1 #include <stdio.h> 1 #include "stdio.h" 2 #include "hard_config.h" 2 3 3 4 #define NBLOCKS 32 … … 8 9 __attribute__((constructor)) void main(void) 9 10 { 10 unsigned int ko; 11 int blocks; 12 int fd; 13 unsigned int blocks_to_skip = 0; 11 int fd; 12 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); 14 18 15 giet_tty_printf( "\nStarting task DISPLAY on processor %d at cycle %d\n",16 giet_procid(), giet_proctime() );19 giet_tty_printf( "*** Starting task display on processor[%d,%d,%d] at cycle %d\n\n", 20 x, y, lpid, giet_proctime() ); 17 21 18 22 ////////////////////////////////////////// … … 30 34 } 31 35 32 //////////////////////////////////////////// 33 ko = giet_fb_cma_init( buf0, buf1, 128*128 ); 34 if ( ko ) 35 { 36 giet_tty_printf("\n*** echec giet_cma_init at cycle %d\n", 36 //////////////////////////////////////// 37 giet_fb_cma_init( buf0, buf1, 128*128 ); 38 39 giet_tty_printf("\ngiet_cma_init completed at cycle %d\n", 37 40 giet_proctime() ); 38 giet_exit();39 }40 else41 {42 giet_tty_printf("\ngiet_cma_init completed at cycle %d\n",43 giet_proctime() );44 }45 46 41 47 42 while ( blocks_to_skip < 10 * NBLOCKS ) 48 43 { 49 //////////////////////////////////////////////////////////// 50 blocks = giet_fat_read( fd, buf0, NBLOCKS, blocks_to_skip ); 51 if ( blocks != NBLOCKS ) 52 { 53 giet_tty_printf("\nechec giet_fat_read to buf0 at cycle %d\n", 44 /////////////////////////////////////////////////// 45 giet_fat_read( fd, buf0, NBLOCKS, blocks_to_skip ); 46 47 giet_tty_printf("\ngiet_fat_read to buf0 completed at cycle = %d\n", 54 48 giet_proctime() ); 55 giet_exit(); 56 }57 else58 { 59 giet_tty_printf("\ngiet_fat_read tobuf0 completed at cycle = %d\n",49 50 /////////////////////// 51 giet_fb_cma_write( 0 ); 52 53 giet_tty_printf("giet_cma_write for buf0 completed at cycle = %d\n", 60 54 giet_proctime() ); 61 }62 63 ///////////////////////////64 ko = giet_fb_cma_write( 0 );65 if ( ko )66 {67 giet_tty_printf("echec giet_cma_write for buf0 at cycle %d\n",68 giet_proctime() );69 giet_exit();70 }71 else72 {73 giet_tty_printf("giet_cma_write for buf0 completed at cycle = %d\n",74 giet_proctime() );75 }76 55 77 56 blocks_to_skip = blocks_to_skip + NBLOCKS; 78 57 79 /////////////////////////////////////////////////////// 80 blocks = giet_fat_read( fd, buf1, NBLOCKS, blocks_to_skip ); 81 if ( blocks != NBLOCKS ) 82 { 83 giet_tty_printf("echec giet_fat_read to buf1 at cycle %d\n", 58 /////////////////////////////////////////////////// 59 giet_fat_read( fd, buf1, NBLOCKS, blocks_to_skip ); 60 61 giet_tty_printf("giet_fat_read to buf1 completed at cycle = %d\n", 84 62 giet_proctime() ); 85 giet_exit(); 86 }87 else88 {89 giet_tty_printf("giet_fat_read tobuf1 completed at cycle = %d\n",63 64 /////////////////////// 65 giet_fb_cma_write( 1 ); 66 67 giet_tty_printf("giet_cma_write for buf1 completed at cycle = %d\n", 90 68 giet_proctime() ); 91 }92 69 93 ////////////////////////////94 ko = giet_fb_cma_write( 1 );95 if ( ko )96 {97 giet_tty_printf("echec giet_cma_write for buf1 at cycle %d\n",98 giet_proctime() );99 giet_exit();100 }101 else102 {103 giet_tty_printf("giet_cma_write for buf1 completed at cycle = %d\n",104 giet_proctime() );105 }106 70 blocks_to_skip = blocks_to_skip + NBLOCKS; 107 71 }
Note: See TracChangeset
for help on using the changeset viewer.