Changeset 85 for trunk/platforms/caba-ring-ccxcachev1_memcachev1-mipsel
- Timestamp:
- Sep 3, 2010, 3:57:30 PM (14 years ago)
- Location:
- trunk/platforms/caba-ring-ccxcachev1_memcachev1-mipsel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/caba-ring-ccxcachev1_memcachev1-mipsel/platform_desc
r3 r85 5 5 todo = Platform('caba', 'top.cpp', 6 6 uses = [ 7 Uses('caba:vci_cc_xcache_wrapper_ multi', iss_t = 'common:iss2_simhelper', simhelper_iss_t = 'common:mips32el'),7 Uses('caba:vci_cc_xcache_wrapper_v1', iss_t = 'common:iss2_simhelper', simhelper_iss_t = 'common:mips32el'), 8 8 Uses('caba:vci_simple_ram'), 9 9 Uses('caba:vci_logger'), 10 10 Uses('caba:vci_multi_tty'), 11 Uses('caba:vci_simple_ring_network'),12 Uses('caba:vci_vgsb'),13 11 Uses('caba:vci_vgmn'), 14 12 Uses('caba:vci_mem_cache_v1'), -
trunk/platforms/caba-ring-ccxcachev1_memcachev1-mipsel/segmentation.h
r3 r85 22 22 23 23 #define RESET_BASE 0xBFC00000 24 #define RESET_SIZE 0x000 1000024 #define RESET_SIZE 0x00000040 25 25 26 #define EXCEP_BASE 0x800000 8027 #define EXCEP_SIZE 0x000 1000026 #define EXCEP_BASE 0x80000000 27 #define EXCEP_SIZE 0x000002e0 28 28 29 29 #define TEXT_BASE 0x00400000 30 #define TEXT_SIZE 0x000 5000030 #define TEXT_SIZE 0x000011c8 31 31 ///////////////////////////////////////////////////////////////// 32 32 // global data segment (initialised) … … 34 34 35 35 #define MC_M_BASE 0x10000000 36 #define MC_M_SIZE 0x00 10000036 #define MC_M_SIZE 0x0000eb20 37 37 38 38 ///////////////////////////////////////////////////////////////// … … 51 51 52 52 #define TTY_BASE 0xC0200000 53 #define TTY_SIZE 0x000 0010053 #define TTY_SIZE 0x00010000 54 54 55 55 #define TIMER_BASE 0xD0200000 -
trunk/platforms/caba-ring-ccxcachev1_memcachev1-mipsel/soft/main.c
r3 r85 2 2 #include "stdio.h" 3 3 #include "stdlib.h" 4 #include "matrice.h"4 //#include "matrice.h" 5 5 6 6 #include "../segmentation.h" 7 7 8 8 #define NPROCS 4 9 #define SIZE 10009 #define SIZE 50 10 10 #define SORT_TYPE 0 // shellSort 11 11 12 12 volatile int nprocs=NPROCS; 13 13 14 /* 14 15 15 unsigned int gQSortNum0[200] = { 16 16 251, 24, 113, 170, 215, 60, 83, 30, 115, 48, 169, 210, 49, 92, 101, 58, 21, 184, 225, 6, … … 24 24 186, 149, 86, 155, 200, 239, 118, 119, 28, 77, 254, 19, 176, 183, 78, 145, 132, 5, 90, 117, 25 25 152, 127, 218, 153, 20, 67, 178, 3, 128, 185, 254, 95, 172, 139, 246, 123, 104, 15, 42, 169 }; 26 */27 26 28 unsigned int SortArr0[NPROCS*(SIZE+200)];29 27 30 void SORT(unsigned int *base, unsigned int n, int type); 31 void insertion_sort(unsigned int *base, unsigned int n); // type 2 32 void selection_sort(unsigned int *base, unsigned int n); // type 1 33 void bubble_sort(unsigned int *base, unsigned int n); // type 3 28 unsigned int SortArr0[NPROCS*(SIZE+50)]; 29 34 30 void shellSortPhase(unsigned int a[],unsigned int length, int gap); 35 31 void shellSort(unsigned int *base, unsigned int n); // type 0 … … 38 34 { 39 35 register int p; 40 41 int beg_cycle, end_cycle;42 43 beg_cycle = cpu_cycles();44 36 45 37 p=procnum(); … … 57 49 i=1; 58 50 puts("Memory copy \n"); 59 SortArray = SortArr0 + p*(SIZE+ 200);60 memcpy(SortArray, gQSortNum0 + p*SIZE,SIZE*4);61 //memcpy(SortArray, gQSortNum0,SIZE*4);51 SortArray = SortArr0 + p*(SIZE+50); 52 // memcpy(SortArray, gQSortNum0 + p*SIZE,SIZE*4); 53 memcpy(SortArray, gQSortNum0,SIZE*4); 62 54 63 55 puts("Sort... \n"); 64 SORT((unsigned int *) (SortArray), (unsigned int) SIZE, SORT_TYPE);56 shellSort((unsigned int *) (SortArray), (unsigned int) SIZE); 65 57 66 58 for (j = 1; j < SIZE; j++) … … 75 67 76 68 puts("ucbqsort: success\n"); 77 end_cycle = cpu_cycles();78 // printf( "nombre cycles cpu : %i\n", end_cycle-beg_cycle);79 printf( "begin time : %i\n", beg_cycle);80 printf( "end time : %i\n", end_cycle);81 69 } 82 83 84 // puts("Display the sorted array : \n");85 // for(j = 0; j < SIZE; j++)86 // {87 // puti(SortArray[j]);88 // putchar('\n');89 // }90 91 // printf( "------------------------------ \n");92 // printf( "nombre cycles cpu : %i\n", end_cycle-beg_cycle);93 // printf( "------------------------------ \n");94 95 70 96 71 while(1); 97 72 } 98 73 99 100 //---- insertion sort : non adapté pour tableaux de grande taille (> 100) --101 void insertion_sort(unsigned int *base, unsigned int n)102 {103 /* Spécifications externes : Tri du tableau base par insertion séquentielle */104 int i,p,j;105 int x;106 107 puts("Insertion Sort\n");108 109 for (i = 1; i < n; i++)110 {111 112 putchar('-'); // added for debug113 114 /* stockage de la valeur en i */115 x = base[i];116 117 /* recherche du plus petit indice p inférieur à i tel que base[p] >= base[i] */118 for(p = 0; base[p] < x; p++);119 /* p pointe une valeur de base supérieure à celle en i */120 121 /* décalage avant des valeurs de base entre p et i */122 for (j = i-1; j >= p; j--) {123 base[j+1] = base[j];124 }125 126 base[p] = x; /* insertion de la valeur stockée à la place vacante */127 128 putchar('+'); // added for debug129 130 }131 }132 133 //------ simple_sort -------------------------------134 void selection_sort(unsigned int *base, unsigned int n)135 {136 int i, min, j , x;137 puts("Selection Sort\n");138 139 for(i = 0 ; i < n - 1 ; i++)140 {141 142 putchar('-'); // added for debug143 144 min = i;145 146 147 for(j = i+1 ; j < n ; j++)148 {149 150 if(base[j] < base[min])151 min = j;152 153 }154 155 if(min != i)156 {157 x = base[i];158 base[i] = base[min];159 base[min] = x;160 }161 162 putchar('+'); // added for debug163 164 }165 }166 //-------------------------------167 void bubble_sort(unsigned int *base, unsigned int n)168 {169 int i = 0; /* Indice de répétition du tri */170 int j = 0; /* Variable de boucle */171 int tmp = 0; /* Variable de stockage temporaire */172 int en_desordre = 1; /* Booléen marquant l'arrêt du tri si le tableau est ordonné */173 174 puts("Bubble Sort\n");175 176 /* Boucle de répétition du tri et le test qui arrête le tri dès que le tableau est ordonné */177 for(i = 0 ; (i < n) && en_desordre; i++)178 {179 putchar('-'); // added for debug180 181 /* Supposons le tableau ordonné */182 en_desordre = 0;183 /* Vérification des éléments des places j et j-1 */184 for(j = 1 ; j < n - i ; j++)185 {186 /* Si les 2 éléments sont mal triés */187 if(base[j] < base[j-1])188 {189 /* Inversion des 2 éléments */190 tmp = base[j-1];191 base[j-1] = base[j];192 base[j] = tmp;193 194 /* Le tableau n'est toujours pas trié */195 en_desordre = 1;196 }197 }198 199 putchar('+'); // added for debug200 }201 202 }203 74 //------------------------------------------------------ 204 75 /* … … 242 113 } 243 114 244 //-------------------------------------*/245 void SORT(unsigned int *base, unsigned int n, int type)246 {247 switch(type)248 {249 case 0:250 shellSort(base, n);251 break;252 case 1:253 selection_sort(base, n);254 break;255 case 2:256 insertion_sort(base, n);257 break;258 case 3:259 bubble_sort(base, n);260 break;261 default:262 break;263 }264 } -
trunk/platforms/caba-ring-ccxcachev1_memcachev1-mipsel/top.cpp
r3 r85 11 11 #include "vci_simple_ram.h" 12 12 #include "vci_multi_tty.h" 13 //#include "vci_vgsb.h" 14 //#include "vci_vgmn.h" 15 #include "vci_simple_ring_network.h" 13 #include "vci_vgmn.h" 16 14 #include "vci_mem_cache_v1.h" 17 #include "vci_cc_xcache_wrapper_ multi.h"15 #include "vci_cc_xcache_wrapper_v1.h" 18 16 #include "vci_logger.h" 19 17 … … 42 40 maptabp.add(Segment("text" , TEXT_BASE , TEXT_SIZE , IntTab(2), true)); 43 41 maptabp.add(Segment("tty" , TTY_BASE , TTY_SIZE , IntTab(1), false)); 44 maptabp.add(Segment("mc_r" , MC_R_BASE , MC_R_SIZE , IntTab(2), false, true, IntTab(0)));45 42 maptabp.add(Segment("mc_m" , MC_M_BASE , MC_M_SIZE , IntTab(2), true )); 46 maptabp.add(Segment("ptba" , PTD_ADDR , TAB_SIZE , IntTab(2), true));47 43 48 44 std::cout << maptabp << std::endl; … … 53 49 maptabc.add(Segment("c_proc2" , C_PROC2_BASE , C_PROC2_SIZE , IntTab(2), false, true, IntTab(2))); 54 50 maptabc.add(Segment("c_proc3" , C_PROC3_BASE , C_PROC3_SIZE , IntTab(3), false, true, IntTab(3))); 55 maptabc.add(Segment("mc_r" , MC_R_BASE , MC_R_SIZE , IntTab(4), false, false));56 51 maptabc.add(Segment("mc_m" , MC_M_BASE , MC_M_SIZE , IntTab(4), false, false)); 57 52 maptabc.add(Segment("reset", RESET_BASE, RESET_SIZE, IntTab(4), false, false)); 58 53 maptabc.add(Segment("excep", EXCEP_BASE, EXCEP_SIZE, IntTab(4), false, false)); 59 54 maptabc.add(Segment("text" , TEXT_BASE , TEXT_SIZE , IntTab(4), false, false)); 60 maptabc.add(Segment("ptba" , PTD_ADDR , TAB_SIZE , IntTab(4), false, false));61 55 62 56 std::cout << maptabc << std::endl; … … 67 61 maptabx.add(Segment("excep", EXCEP_BASE, EXCEP_SIZE, IntTab(0), false)); 68 62 maptabx.add(Segment("text" , TEXT_BASE , TEXT_SIZE , IntTab(0), false)); 69 maptabx.add(Segment("ptba" , PTD_ADDR , TAB_SIZE , IntTab(0), false));70 63 71 64 std::cout << maptabx << std::endl; … … 103 96 sc_signal<bool> signal_proc3_it5("proc3_it5"); 104 97 105 soclib::caba::VciSignals<vci_param> signal_vci_ini_ d_proc0("vci_ini_d_proc0");98 soclib::caba::VciSignals<vci_param> signal_vci_ini_rw_proc0("vci_ini_rw_proc0"); 106 99 soclib::caba::VciSignals<vci_param> signal_vci_ini_c_proc0("vci_ini_c_proc0"); 107 100 soclib::caba::VciSignals<vci_param> signal_vci_tgt_proc0("vci_tgt_proc0"); 108 101 109 soclib::caba::VciSignals<vci_param> signal_vci_ini_ d_proc1("vci_ini_d_proc1");102 soclib::caba::VciSignals<vci_param> signal_vci_ini_rw_proc1("vci_ini_rw_proc1"); 110 103 soclib::caba::VciSignals<vci_param> signal_vci_ini_c_proc1("vci_ini_c_proc1"); 111 104 soclib::caba::VciSignals<vci_param> signal_vci_tgt_proc1("vci_tgt_proc1"); 112 105 113 soclib::caba::VciSignals<vci_param> signal_vci_ini_ d_proc2("vci_ini_d_proc2");106 soclib::caba::VciSignals<vci_param> signal_vci_ini_rw_proc2("vci_ini_rw_proc2"); 114 107 soclib::caba::VciSignals<vci_param> signal_vci_ini_c_proc2("vci_ini_c_proc2"); 115 108 soclib::caba::VciSignals<vci_param> signal_vci_tgt_proc2("vci_tgt_proc2"); 116 109 117 soclib::caba::VciSignals<vci_param> signal_vci_ini_ d_proc3("vci_ini_d_proc3");110 soclib::caba::VciSignals<vci_param> signal_vci_ini_rw_proc3("vci_ini_rw_proc3"); 118 111 soclib::caba::VciSignals<vci_param> signal_vci_ini_c_proc3("vci_ini_c_proc3"); 119 112 soclib::caba::VciSignals<vci_param> signal_vci_tgt_proc3("vci_tgt_proc3"); … … 140 133 141 134 // Components 142 soclib::caba::VciCcXCacheWrapper Multi<vci_param, proc_iss >143 proc0("proc0", 0, maptabp, maptabc, IntTab(0),IntTab(0),IntTab(0),4,64,16,4,64,16 ,4,8);144 145 soclib::caba::VciCcXCacheWrapper Multi<vci_param, proc_iss >146 proc1("proc1", 1, maptabp, maptabc, IntTab(1),IntTab(1),IntTab(1),4,64,16,4,64,16 ,4,8);147 148 soclib::caba::VciCcXCacheWrapper Multi<vci_param, proc_iss >149 proc2("proc2", 2, maptabp, maptabc, IntTab(2),IntTab(2),IntTab(2),4,64,16,4,64,16 ,4,8);150 151 soclib::caba::VciCcXCacheWrapper Multi<vci_param, proc_iss >152 proc3("proc3", 3, maptabp, maptabc, IntTab(3),IntTab(3),IntTab(3),4,64,16,4,64,16 ,4,8);135 soclib::caba::VciCcXCacheWrapperV1<vci_param, proc_iss > 136 proc0("proc0", 0, maptabp, maptabc, IntTab(0),IntTab(0),IntTab(0),4,64,16,4,64,16); 137 138 soclib::caba::VciCcXCacheWrapperV1<vci_param, proc_iss > 139 proc1("proc1", 1, maptabp, maptabc, IntTab(1),IntTab(1),IntTab(1),4,64,16,4,64,16); 140 141 soclib::caba::VciCcXCacheWrapperV1<vci_param, proc_iss > 142 proc2("proc2", 2, maptabp, maptabc, IntTab(2),IntTab(2),IntTab(2),4,64,16,4,64,16); 143 144 soclib::caba::VciCcXCacheWrapperV1<vci_param, proc_iss > 145 proc3("proc3", 3, maptabp, maptabc, IntTab(3),IntTab(3),IntTab(3),4,64,16,4,64,16); 153 146 154 147 soclib::caba::VciSimpleRam<vci_param> … … 170 163 // soclib::caba::VciLogger<vci_param> vci_logger_memc("vci_logger_memc",maptabp); 171 164 172 soclib::caba::VciSimpleRingNetwork<vci_param> 173 ringd("ringd",maptabp, IntTab(), 2, 4, 3); 174 // soclib::caba::VciVgsb<vci_param> 175 // ringd("ringd",maptabp, 4, 3); 176 // soclib::caba::VciVgmn<vci_param> 177 // ringd("ringd",maptabp, 4, 3, 2, 2); 178 179 soclib::caba::VciSimpleRingNetwork<vci_param> 180 ringc("ringc",maptabc, IntTab(), 2, 5, 5); 181 // soclib::caba::VciVgsb<vci_param> 182 // ringc("ringc",maptabc, 5, 5); 183 // soclib::caba::VciVgmn<vci_param> 184 // ringc("ringd",maptabc, 5, 5, 2, 2); 185 186 soclib::caba::VciSimpleRingNetwork<vci_param> 187 ringx("ringx",maptabx, IntTab(), 2, 1, 1); 188 // soclib::caba::VciVgsb<vci_param> 189 // ringx("ringx",maptabx, 1, 1); 190 // soclib::caba::VciVgmn<vci_param> 191 // ringx("ringd",maptabx, 1, 1, 2, 2); 165 // soclib::caba::VciSimpleRingNetwork<vci_param> 166 // ringd("ringd",maptabp, IntTab(), 2, 4, 3); 167 soclib::caba::VciVgmn<vci_param> 168 ringd("ringd",maptabp, 4, 3, 2, 2); 169 170 // soclib::caba::VciSimpleRingNetwork<vci_param> 171 // ringc("ringc",maptabc, IntTab(), 2, 5, 5); 172 soclib::caba::VciVgmn<vci_param> 173 ringc("ringc",maptabc, 5, 5, 2, 2); 174 175 // soclib::caba::VciSimpleRingNetwork<vci_param> 176 // ringx("ringx",maptabx, IntTab(), 2, 1, 1); 177 soclib::caba::VciVgmn<vci_param> 178 ringx("ringx",maptabx, 1, 1, 2, 2); 192 179 193 180 // Net-List … … 201 188 proc0.p_irq[4](signal_proc0_it4); 202 189 proc0.p_irq[5](signal_proc0_it5); 203 proc0.p_vci_ini_ d(signal_vci_ini_d_proc0);190 proc0.p_vci_ini_rw(signal_vci_ini_rw_proc0); 204 191 proc0.p_vci_ini_c(signal_vci_ini_c_proc0); 205 proc0.p_vci_tgt _c(signal_vci_tgt_proc0);192 proc0.p_vci_tgt(signal_vci_tgt_proc0); 206 193 207 194 proc1.p_clk(signal_clk); … … 213 200 proc1.p_irq[4](signal_proc1_it4); 214 201 proc1.p_irq[5](signal_proc1_it5); 215 proc1.p_vci_ini_ d(signal_vci_ini_d_proc1);202 proc1.p_vci_ini_rw(signal_vci_ini_rw_proc1); 216 203 proc1.p_vci_ini_c(signal_vci_ini_c_proc1); 217 proc1.p_vci_tgt _c(signal_vci_tgt_proc1);204 proc1.p_vci_tgt(signal_vci_tgt_proc1); 218 205 219 206 proc2.p_clk(signal_clk); … … 225 212 proc2.p_irq[4](signal_proc2_it4); 226 213 proc2.p_irq[5](signal_proc2_it5); 227 proc2.p_vci_ini_ d(signal_vci_ini_d_proc2);214 proc2.p_vci_ini_rw(signal_vci_ini_rw_proc2); 228 215 proc2.p_vci_ini_c(signal_vci_ini_c_proc2); 229 proc2.p_vci_tgt _c(signal_vci_tgt_proc2);216 proc2.p_vci_tgt(signal_vci_tgt_proc2); 230 217 231 218 proc3.p_clk(signal_clk); … … 237 224 proc3.p_irq[4](signal_proc3_it4); 238 225 proc3.p_irq[5](signal_proc3_it5); 239 proc3.p_vci_ini_ d(signal_vci_ini_d_proc3);226 proc3.p_vci_ini_rw(signal_vci_ini_rw_proc3); 240 227 proc3.p_vci_ini_c(signal_vci_ini_c_proc3); 241 proc3.p_vci_tgt _c(signal_vci_tgt_proc3);228 proc3.p_vci_tgt(signal_vci_tgt_proc3); 242 229 243 230 rom.p_clk(signal_clk); … … 247 234 // vci_logger_proc0.p_clk(signal_clk); 248 235 // vci_logger_proc0.p_resetn(signal_resetn); 249 // vci_logger_proc0.p_vci(signal_vci_ini_ d_proc0);236 // vci_logger_proc0.p_vci(signal_vci_ini_rw_proc0); 250 237 251 238 // vci_logger_proc1.p_clk(signal_clk); 252 239 // vci_logger_proc1.p_resetn(signal_resetn); 253 // vci_logger_proc1.p_vci(signal_vci_ini_ d_proc2);240 // vci_logger_proc1.p_vci(signal_vci_ini_rw_proc2); 254 241 255 242 // vci_logger_proc2.p_clk(signal_clk); 256 243 // vci_logger_proc2.p_resetn(signal_resetn); 257 // vci_logger_proc2.p_vci(signal_vci_ini_ d_proc2);244 // vci_logger_proc2.p_vci(signal_vci_ini_rw_proc2); 258 245 259 246 // vci_logger_proc3.p_clk(signal_clk); 260 247 // vci_logger_proc3.p_resetn(signal_resetn); 261 // vci_logger_proc3.p_vci(signal_vci_ini_ d_proc3);248 // vci_logger_proc3.p_vci(signal_vci_ini_rw_proc3); 262 249 263 250 // vci_logger_memc.p_clk(signal_clk); … … 286 273 ringd.p_clk(signal_clk); 287 274 ringd.p_resetn(signal_resetn); 288 ringd.p_to_initiator[0](signal_vci_ini_ d_proc0);289 ringd.p_to_initiator[1](signal_vci_ini_ d_proc1);290 ringd.p_to_initiator[2](signal_vci_ini_ d_proc2);291 ringd.p_to_initiator[3](signal_vci_ini_ d_proc3);275 ringd.p_to_initiator[0](signal_vci_ini_rw_proc0); 276 ringd.p_to_initiator[1](signal_vci_ini_rw_proc1); 277 ringd.p_to_initiator[2](signal_vci_ini_rw_proc2); 278 ringd.p_to_initiator[3](signal_vci_ini_rw_proc3); 292 279 ringd.p_to_target[0](signal_vci_tgt_rom); 293 280 ringd.p_to_target[1](signal_vci_tgt_tty); … … 336 323 { 337 324 sc_start(sc_core::sc_time(1, SC_NS)); 338 if ( i%10000 == 0 ) 339 { 340 proc0.print_stats(); 341 proc1.print_stats(); 342 proc2.print_stats(); 343 proc3.print_stats(); 344 memc.print_stats(); 345 } 325 346 326 } 347 327
Note: See TracChangeset
for help on using the changeset viewer.