- Timestamp:
- Jan 20, 2016, 10:17:45 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/transpose/transpose.c
r764 r769 1 /////////////////////////////////////////////////////////////////////////////////////// 1 ////////////////////////////////////////////////////////////////////////////////////////// 2 2 // File : transpose.c 3 3 // Date : september 2015 4 4 // author : Alain Greiner 5 /////////////////////////////////////////////////////////////////////////////////////// 5 ////////////////////////////////////////////////////////////////////////////////////////// 6 6 // This multi-threaded aplication read a raw image (one byte per pixel) 7 7 // stored on disk, transpose it, display the result on the frame buffer, … … 27 27 // a part of the transposed image to the frame buffer. 28 28 // 29 // - The image size must fit the frame buffer size. 30 // - The block size in block device must be 512 bytes. 29 // - The image size must fit the frame buffer width and height, that must be power of 2. 31 30 // - The number of clusters must be a power of 2 no larger than 256. 32 31 // - The number of processors per cluster must be a power of 2 no larger than 4. … … 36 35 // The transpose_rw.c file contains a variant that use the giet_fat_read() 37 36 // and giet_fat_write() system calls, to access the files. 38 /////////////////////////////////////////////////////////////////////////////////////// 37 ////////////////////////////////////////////////////////////////////////////////////////// 39 38 40 39 #include "stdio.h" … … 52 51 #define OUTPUT_FILE_PATH "/home/lena_transposed.raw" // default output file pathname 53 52 #define INTERACTIVE 0 // interactive capture of filenames 54 #define VERBOSE 0// print comments on TTY53 #define VERBOSE 1 // print comments on TTY 55 54 56 55 … … 144 143 } 145 144 146 if TRANSPOSE_DEBUG 147 printf("\n@@@ Thread[%d,%d,%d] call mmap : length = %x / offset = %x / buf_in = %x\n", 145 if ( VERBOSE ) 146 printf("\n@@@ Thread[%d,%d,%d] call mmap for input file\n" 147 " length = %x / offset = %x / buf_in = %x\n", 148 148 x_id , y_id , p_id , length , offset , buf_in[cluster_id] ); 149 149 … … 161 161 } 162 162 163 if TRANSPOSE_DEBUG 164 printf("\n@@@ Thread[%d,%d,%d] call mmap : length = %x / offset = %x / buf_out = %x\n", 163 if ( VERBOSE ) 164 printf("\n@@@ Thread[%d,%d,%d] call mmap for output file\n" 165 " length = %x / offset = %x / buf_out = %x\n", 165 166 x_id , y_id , p_id , length , offset , buf_out[cluster_id] ); 166 167 … … 273 274 unsigned int min_disp_ended = 0xFFFFFFFF; 274 275 unsigned int max_disp_ended = 0; 276 277 // open instrumentation file 278 unsigned int fd = giet_fat_open( "/home/transpose.inst" , O_CREATE ); 279 if ( fd < 0 ) 280 { 281 printf("\n[TRANSPOSE ERROR] main cannot open file transpose.inst\n"); 282 giet_pthread_exit( NULL ); 283 } 275 284 276 285 for (x = 0; x < x_size; x++) … … 301 310 min_load_start, max_load_start, (min_load_start+max_load_start)/2, 302 311 max_load_start-min_load_start); 312 giet_fat_fprintf( fd , " - MMAP_START : min = %d / max = %d / med = %d / delta = %d\n", 313 min_load_start, max_load_start, (min_load_start+max_load_start)/2, 314 max_load_start-min_load_start); 303 315 304 316 printf(" - MMAP_END : min = %d / max = %d / med = %d / delta = %d\n", 305 317 min_load_ended, max_load_ended, (min_load_ended+max_load_ended)/2, 306 318 max_load_ended-min_load_ended); 319 giet_fat_fprintf( fd , " - MMAP_END : min = %d / max = %d / med = %d / delta = %d\n", 320 min_load_ended, max_load_ended, (min_load_ended+max_load_ended)/2, 321 max_load_ended-min_load_ended); 307 322 308 323 printf(" - TRSP_START : min = %d / max = %d / med = %d / delta = %d\n", 309 324 min_trsp_start, max_trsp_start, (min_trsp_start+max_trsp_start)/2, 310 325 max_trsp_start-min_trsp_start); 326 giet_fat_fprintf( fd , " - TRSP_START : min = %d / max = %d / med = %d / delta = %d\n", 327 min_trsp_start, max_trsp_start, (min_trsp_start+max_trsp_start)/2, 328 max_trsp_start-min_trsp_start); 311 329 312 330 printf(" - TRSP_END : min = %d / max = %d / med = %d / delta = %d\n", 313 331 min_trsp_ended, max_trsp_ended, (min_trsp_ended+max_trsp_ended)/2, 314 332 max_trsp_ended-min_trsp_ended); 333 giet_fat_fprintf( fd , " - TRSP_END : min = %d / max = %d / med = %d / delta = %d\n", 334 min_trsp_ended, max_trsp_ended, (min_trsp_ended+max_trsp_ended)/2, 335 max_trsp_ended-min_trsp_ended); 315 336 316 337 printf(" - DISP_START : min = %d / max = %d / med = %d / delta = %d\n", 317 338 min_disp_start, max_disp_start, (min_disp_start+max_disp_start)/2, 318 339 max_disp_start-min_disp_start); 340 giet_fat_fprintf( fd , " - DISP_START : min = %d / max = %d / med = %d / delta = %d\n", 341 min_disp_start, max_disp_start, (min_disp_start+max_disp_start)/2, 342 max_disp_start-min_disp_start); 319 343 320 344 printf(" - DISP_END : min = %d / max = %d / med = %d / delta = %d\n", 321 345 min_disp_ended, max_disp_ended, (min_disp_ended+max_disp_ended)/2, 322 346 max_disp_ended-min_disp_ended); 347 giet_fat_fprintf( fd , " - DISP_END : min = %d / max = %d / med = %d / delta = %d\n", 348 min_disp_ended, max_disp_ended, (min_disp_ended+max_disp_ended)/2, 349 max_disp_ended-min_disp_ended); 350 351 giet_fat_close( fd ); 323 352 324 353 } // end instrument()
Note: See TracChangeset
for help on using the changeset viewer.