Changeset 631 for trunk/softs/soft_transpose_giet
- Timestamp:
- Feb 12, 2014, 1:42:52 PM (11 years ago)
- Location:
- trunk/softs/soft_transpose_giet
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/soft_transpose_giet/ldscript
r629 r631 10 10 peripherals are not present in the architecture */ 11 11 12 seg_reset_base = 0x00000000; /* boot code*/12 seg_reset_base = 0x00000000; /* boot code */ 13 13 14 seg_kcode_base = 0x00010000; /* kernel code*/15 seg_kdata_base = 0x00020000; /* kernel cacheable data*/16 seg_kunc_base = 0x00030000; /* kernel uncacheable data*/14 seg_kcode_base = 0x00010000; /* kernel code */ 15 seg_kdata_base = 0x00020000; /* kernel cacheable data */ 16 seg_kunc_base = 0x00030000; /* kernel uncacheable data */ 17 17 18 seg_code_base = 0x00040000; /* application code*/19 seg_data_base = 0x00050000; /* application data*/18 seg_code_base = 0x00040000; /* application code */ 19 seg_data_base = 0x00050000; /* application data */ 20 20 21 seg_heap_base = 0x00100000; /* heaps for application tasks*/22 seg_stack_base = 0x00300000; /* stacks*/21 seg_heap_base = 0x00100000; /* heaps for applications */ 22 seg_stack_base = 0x00300000; /* stacks ifor applications */ 23 23 24 seg_xcu_base = 0xF0000000; /* controler XCU */ 25 seg_tty_base = 0xF4000000; /* controler TTY */ 26 seg_fbf_base = 0xF3000000; /* controler FBF */ 27 seg_ioc_base = 0xF2000000; /* controler IOC */ 28 seg_nic_base = 0xF7000000; /* controler NIC */ 29 seg_cma_base = 0xF8000000; /* controler CMA */ 30 seg_pic_base = 0xF9000000; /* controler PIC */ 31 seg_mmc_base = 0xE0000000; /* config MMC */ 24 seg_ramdisk_base = 0x00800000; /* virtual disk */ 25 26 seg_xcu_base = 0xF0000000; /* controler XCU */ 27 seg_tty_base = 0xF4000000; /* controler TTY */ 28 seg_fbf_base = 0xF3000000; /* controler FBF */ 29 seg_ioc_base = 0xF2000000; /* controler IOC */ 30 seg_nic_base = 0xF7000000; /* controler NIC */ 31 seg_cma_base = 0xF8000000; /* controler CMA */ 32 seg_pic_base = 0xF9000000; /* controler PIC */ 33 seg_mmc_base = 0xE0000000; /* config MMC */ 32 34 33 35 -
trunk/softs/soft_transpose_giet/main.c
r629 r631 8 8 #define NP 128 9 9 #define NB_IMAGES 5 10 10 11 // Only processor 0 in each cluster access TTY 11 12 #define PRINTF(...) ({ if (lpid == 0) { _tty_printf(__VA_ARGS__); } }) 12 13 13 #define DISPLAY_OK 14 15 // tricks to read parameters from ldscript 14 #define DISPLAY_OK 1 // enable display on frame buffer when non zero 15 #define CHECK_VERBOSE 1 // display a detailed check on TTY when non zero 16 #define INSTRUMENTATION_OK 0 // display statistcs on TTY when non zero 17 18 // tricks to read some addresses from ldscript 16 19 extern struct plaf seg_ioc_base; 17 20 extern struct plaf seg_heap_base; … … 19 22 // global variables stored in seg_data (cluster 0) 20 23 21 // instrumentation counters for each processor24 // instrumentation counters (for each processor) 22 25 unsigned int LOAD_START[256][4]; 23 26 unsigned int LOAD_END [256][4]; … … 27 30 unsigned int DISP_END [256][4]; 28 31 29 // checksum variables 32 // checksum variables (used by proc(0,0,0) only 30 33 unsigned check_line_before[NL]; 31 34 unsigned check_line_after[NL]; … … 58 61 unsigned int cluster_id = (x * Y_SIZE) + y; 59 62 60 PRINTF("\n *** Proc 0 in cluster [%d,%d] enters main at cycle %d ***\n\n",63 PRINTF("\n *** Proc [%d,%d,0] enters main at cycle %d ***\n\n", 61 64 x, y, _proctime()); 62 65 … … 96 99 _barrier_init(3, ntasks); 97 100 98 PRINTF("*** Proc 0 in cluster [%d,%d] completes barrier init at cycle %d\n",101 PRINTF("*** Proc [%d,%d,0] completes barrier init at cycle %d\n", 99 102 x, y, _proctime()); 100 103 … … 109 112 if (lpid == 0) 110 113 { 114 PRINTF("\n*** Proc [%d,%d,0] starts load for image %d at cycle %d\n", 115 x, y, image, _proctime() ); 116 111 117 _ioc_read( ((image * nblocks) + ((nblocks * cluster_id) / nclusters)), 112 118 buf_in, … … 114 120 cluster_xy ); 115 121 116 PRINTF("\n*** Proc 0 in cluster [%d,%d] starts load for image %d at cycle %d\n",117 x, y, image, _proctime() );118 119 122 _ioc_completed(); 120 123 121 PRINTF("*** Proc 0 in cluster [%d,%d] completes load for image %d at cycle %d\n",124 PRINTF("*** Proc [%d,%d,0] completes load for image %d at cycle %d\n", 122 125 x, y, image, _proctime() ); 123 126 } … … 131 134 // (p,l) are the pixel coordinates in the source image 132 135 133 PRINTF("\n*** proc 0 in cluster [%d,%d] starts transpose for image %d at cycle %d\n",136 PRINTF("\n*** proc [%d,%d,0] starts transpose for image %d at cycle %d\n", 134 137 x, y, image, _proctime()); 135 138 … … 203 206 } 204 207 205 PRINTF("*** proc 0 in cluster [%d,%d] complete transpose for image %d at cycle %d\n",208 PRINTF("*** proc [%d,%d,0] complete transpose for image %d at cycle %d\n", 206 209 x, y, image, _proctime() ); 207 210 … … 212 215 // optional parallel display from local buf_out to frame buffer 213 216 214 #ifdef DISPLAY_OK 215 216 PRINTF("\n*** proc 0 in cluster [%d,%d] starts display for image %d at cycle %d\n",217 x, y, image, _proctime() );218 219 DISP_START[cluster_id][lpid] = _proctime();220 221 unsigned int npxt = npixels / ntasks; // number of pixels per task222 unsigned int buffer = (unsigned int)buf_out + npxt*lpid;223 224 _fb_sync_write( npxt * task_id, buffer, npxt, cluster_xy );225 226 PRINTF("*** Proc 0 in cluster [%d,%d] completes display for image %d at cycle %d\n",227 x, y, image, _proctime() );228 229 DISP_END[cluster_id][lpid] = _proctime();230 231 _barrier_wait(2);232 233 #endif 234 235 // Instrumentation and checksum (done by processor 0 in cluster 0) 236 if ( proc_id == 0)237 { 238 PRINTF("\n*** Proc [ 0,0,0] starts checks for image %d at cycle %d\n\n",239 217 if ( DISPLAY_OK ) 218 { 219 PRINTF("\n*** proc [%d,%d,0] starts display for image %d at cycle %d\n", 220 x, y, image, _proctime() ); 221 222 DISP_START[cluster_id][lpid] = _proctime(); 223 224 unsigned int npxt = npixels / ntasks; // number of pixels per task 225 unsigned int buffer = (unsigned int)buf_out + npxt*lpid; 226 227 _fb_sync_write( npxt * task_id, buffer, npxt, cluster_xy ); 228 229 PRINTF("*** Proc [%d,%d,0] completes display for image %d at cycle %d\n", 230 x, y, image, _proctime() ); 231 232 DISP_END[cluster_id][lpid] = _proctime(); 233 234 _barrier_wait(2); 235 } 236 237 // checksum (done by processor 0 in each cluster) 238 239 if ( lpid == 0 ) 240 { 241 PRINTF("\n*** Proc [%d,%d,0] starts checks for image %d at cycle %d\n\n", 242 x, y, image, _proctime() ); 240 243 241 244 unsigned int success = 1; 242 243 for ( l = 0 ; l < NL ; l++ ) 245 unsigned int start = cluster_id * (NL / nclusters); 246 unsigned int stop = start + (NL / nclusters); 247 248 for ( l = start ; l < stop ; l++ ) 244 249 { 245 250 check_line_after[l] = 0; … … 258 263 } 259 264 260 PRINTF(" - l = %d / before = %d / after = %d \n", 261 l, check_line_before[l], check_line_after[l] ); 265 if( CHECK_VERBOSE ) 266 { 267 PRINTF(" - l = %d / before = %d / after = %d \n", 268 l, check_line_before[l], check_line_after[l] ); 269 } 262 270 263 271 if ( check_line_before[l] != check_line_after[l] ) success = 0; 264 272 } 265 273 266 if ( success ) PRINTF("\n*** proc [0,0,0] : CHECKSUM OK \n\n"); 267 else PRINTF("\n*** proc [0,0,0] : CHECKSUM KO \n\n"); 268 274 if ( success ) PRINTF("\n*** proc [%d,%d,0] : CHECKSUM OK \n\n", x, y); 275 else PRINTF("\n*** proc [%d,%d,0] : CHECKSUM KO \n\n", x, y); 276 } 277 278 // instrumentation ( done by processor [0,0,0] 279 280 if ( (proc_id == 0) && INSTRUMENTATION_OK ) 281 { 269 282 int cc, pp; 270 283 unsigned int min_load_start = INT_MAX;
Note: See TracChangeset
for help on using the changeset viewer.