Changeset 631 for trunk/softs
- Timestamp:
- Feb 12, 2014, 1:42:52 PM (11 years ago)
- Location:
- trunk/softs
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/giet_tsar/stdio.c
r629 r631 87 87 extern struct plouf seg_ioc_base; 88 88 extern struct plouf seg_mmc_base; 89 extern struct plouf seg_ramdisk_base; 89 90 90 91 //////////////////////////////////////////////////////////////////////////////////////// … … 915 916 // BLOCK_DEVICE (IOC) 916 917 ////////////////////////////////////////////////////////////////////////////////////////// 918 // The block size is 512 bytes. 917 919 // The functions below use the three variables _ioc_lock _ioc_done, 918 920 // and _ioc_status for synchronisation. … … 933 935 // (x = X_SIZE-1 / y = Y_SIZE), which requires and extended address access. 934 936 // If USE_EXT_IO not set, we use the IOC contrÃŽler in cluster (0,0). 937 // 938 // If USE_RAMDISK is set, we access a "virtual" block device controler implemented 939 // as a memory-mapped segment in cluster [0,0] at address seg_ramdisk_base. 940 // The tranfer being fully synchronous, the IOC interrupt is not activated. 935 941 /////////////////////////////////////////////////////////////////////////////////////// 936 942 … … 967 973 _ioc_get_lock(); 968 974 969 if ( USE_EXT_IO ) // extended addressing to cluster_io 975 if ( USE_RAMDISK ) // we use an extended_memcpy 976 { 977 unsigned int src_address = (unsigned int)buffer; 978 unsigned int src_cluster = ext; 979 unsigned int dst_address = (unsigned int)&seg_ramdisk_base + lba*512; 980 unsigned int dst_cluster = 0; 981 982 _extended_memcpy( dst_cluster, 983 dst_address, 984 src_cluster, 985 src_address, 986 count*512 ); 987 988 _ioc_status = BLOCK_DEVICE_WRITE_SUCCESS; 989 _ioc_done = 1; 990 } 991 else if ( USE_EXT_IO ) // extended addressing to cluster_io 970 992 { 971 993 unsigned int cluster = ((X_SIZE-1)<<Y_WIDTH) + Y_SIZE; … … 1007 1029 _ioc_get_lock(); 1008 1030 1009 if ( USE_EXT_IO ) // extended addressing to cluster_io 1031 if ( USE_RAMDISK ) // we use an extended_memcpy 1032 { 1033 unsigned int dst_address = (unsigned int)buffer; 1034 unsigned int dst_cluster = ext; 1035 unsigned int src_address = (unsigned int)&seg_ramdisk_base + lba*512; 1036 unsigned int src_cluster = 0; 1037 1038 _extended_memcpy( dst_cluster, 1039 dst_address, 1040 src_cluster, 1041 src_address, 1042 count*512 ); 1043 1044 _ioc_status = BLOCK_DEVICE_READ_SUCCESS; 1045 _ioc_done = 1; 1046 } 1047 else if ( USE_EXT_IO ) // extended addressing to cluster_io 1010 1048 { 1011 1049 unsigned int cluster = ((X_SIZE-1)<<Y_WIDTH) + Y_SIZE; … … 1081 1119 1082 1120 ////////////////////////////////////////////////////////////////////////////////////// 1083 // This ISR must be executed when an IRQ is activated by MEMC to signal1084 // an error detected by the TSAR memory cache after a write transaction.1085 // It displays an error message on the TTY terminal allocated to the processor1086 // executing the ISR.1087 //////////////////////////////////////////////////////////////////////////////////////1088 in_drivers void _mmc_isr()1089 {1090 int* mmc_address = (int*)&seg_mmc_base;1091 unsigned int cluster_xy = _procid() / NB_PROCS_MAX;1092 1093 _tty_printf( "WRITE ERROR signaled by Memory Cache in cluster %x\n", cluster_xy );1094 }1095 1096 //////////////////////////////////////////////////////////////////////////////////////1097 1121 // FRAME_BUFFER 1098 1122 ////////////////////////////////////////////////////////////////////////////////////// … … 1150 1174 src_address, 1151 1175 length ); 1176 } 1177 1178 ////////////////////////////////////////////////////////////////////////////////////// 1179 // This ISR must be executed when an IRQ is activated by MEMC to signal 1180 // an error detected by the TSAR memory cache after a write transaction. 1181 // It displays an error message on the TTY terminal allocated to the processor 1182 // executing the ISR. 1183 ////////////////////////////////////////////////////////////////////////////////////// 1184 in_drivers void _mmc_isr() 1185 { 1186 int* mmc_address = (int*)&seg_mmc_base; 1187 unsigned int cluster_xy = _procid() / NB_PROCS_MAX; 1188 1189 _tty_printf( "WRITE ERROR signaled by Memory Cache in cluster %x\n", cluster_xy ); 1152 1190 } 1153 1191 -
trunk/softs/soft_hello_giet/hard_config.h
r629 r631 12 12 #define Y_WIDTH 4 13 13 14 #define NB_PROCS_MAX 414 #define NB_PROCS_MAX 1 15 15 16 #define USE_EXT_IO 1 16 #define USE_RAMDISK 1 17 #define USE_EXT_IO 0 17 18 18 19 #define NB_DMA_CHANNELS 0 … … 21 22 #define NB_CMA_CHANNELS 0 22 23 23 #define NB_TTY_CHANNELS 424 #define NB_TTY_CHANNELS 1 24 25 25 26 #endif //_HARD_CONFIG_H -
trunk/softs/soft_hello_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_sort_giet/hard_config.h
r629 r631 12 12 #define Y_WIDTH 4 13 13 14 #define NB_PROCS_MAX 414 #define NB_PROCS_MAX 1 15 15 16 #define USE_EXT_IO 1 16 #define USE_RAMDISK 1 17 #define USE_EXT_IO 0 17 18 18 19 #define NB_DMA_CHANNELS 0 … … 21 22 #define NB_CMA_CHANNELS 0 22 23 23 #define NB_TTY_CHANNELS 424 #define NB_TTY_CHANNELS 1 24 25 25 26 #endif //_HARD_CONFIG_H -
trunk/softs/soft_sort_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/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.