Changeset 85 for trunk/platforms/caba-xxx-ccxcachemulti-mipsel
- Timestamp:
- Sep 3, 2010, 3:57:30 PM (14 years ago)
- Location:
- trunk/platforms/caba-xxx-ccxcachemulti-mipsel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/caba-xxx-ccxcachemulti-mipsel/platform_desc
r3 r85 17 17 cell_size = 4, 18 18 plen_size = 8, 19 addr_size = 32,19 addr_size = 64, 20 20 rerror_size = 1, 21 21 clen_size = 1, 22 22 rflag_size = 1, 23 srcid_size = 8,24 pktid_size = 6,25 trdid_size = 6,23 srcid_size = 14, 24 pktid_size = 4, 25 trdid_size = 4, 26 26 wrplen_size = 1 27 27 ) -
trunk/platforms/caba-xxx-ccxcachemulti-mipsel/segmentation.h
r3 r85 21 21 #define MMU 22 22 23 #define RESET_BASE 0x BFC0000023 #define RESET_BASE 0x00BFC00000 24 24 #define RESET_SIZE 0x00010000 25 25 26 #define EXCEP_BASE 0x 8000008026 #define EXCEP_BASE 0x0080000080 27 27 #define EXCEP_SIZE 0x00010000 28 28 29 #define TEXT_BASE 0x00 40000029 #define TEXT_BASE 0x0000400000 30 30 #define TEXT_SIZE 0x00050000 31 31 ///////////////////////////////////////////////////////////////// … … 33 33 ///////////////////////////////////////////////////////////////// 34 34 35 #define MC_M_BASE 0x 1000000035 #define MC_M_BASE 0x0010000000 36 36 #define MC_M_SIZE 0x00100000 37 37 38 /////////////////////////////////////////////////////////////////39 // page table (initialised)40 /////////////////////////////////////////////////////////////////41 #define PTD_ADDR 0x4040000042 #define PTE_ADDR 0x4040200043 #define IPTE_ADDR 0x4040300044 #define TAB_SIZE 0x0001000045 46 #define V_TTY_BASE 0x0080000047 #define V_TIMER_BASE 0x00C00000 // timer virtual address48 38 ////////////////////////////////////////////////////////// 49 39 // System devices 50 40 /////////////////////////////////////////////////////////// 51 41 52 #define TTY_BASE 0x C020000042 #define TTY_BASE 0x00C0200000 53 43 #define TTY_SIZE 0x00000100 54 44 55 #define TIMER_BASE 0x D020000045 #define TIMER_BASE 0x00D0200000 56 46 #define TIMER_SIZE 0x00000100 57 47 58 #define LOCKS_BASE 0x E020000048 #define LOCKS_BASE 0x00E0200000 59 49 #define LOCKS_SIZE 0x00000100 60 50 61 #define C_PROC0_BASE 0x0 120000051 #define C_PROC0_BASE 0x0001200000 62 52 #define C_PROC0_SIZE 0x00000010 63 53 64 #define C_PROC1_BASE 0x0 220000054 #define C_PROC1_BASE 0x0002200000 65 55 #define C_PROC1_SIZE 0x00000010 66 56 67 #define C_PROC2_BASE 0x0 320000057 #define C_PROC2_BASE 0x0003200000 68 58 #define C_PROC2_SIZE 0x00000010 69 59 70 #define C_PROC3_BASE 0x0 420000060 #define C_PROC3_BASE 0x0004200000 71 61 #define C_PROC3_SIZE 0x00000010 72 62 73 #define C_MC_M_BASE 0x0020000074 #define C_MC_M_SIZE 0x0000000875 76 #define XRAM_BASE 0xB020000077 #define XRAM_SIZE 0x0000000878 79 #define MC_R_BASE 0x2020000080 #define MC_R_SIZE 0x0000000881 63 82 64 #define CLEANUP_OFFSET 0x20200000 -
trunk/platforms/caba-xxx-ccxcachemulti-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 #define NPROCS 49 #define SIZE 10008 #define NPROCS 1 9 #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 … … 57 53 i=1; 58 54 puts("Memory copy \n"); 59 SortArray = SortArr0 + p*(SIZE+ 200);55 SortArray = SortArr0 + p*(SIZE+50); 60 56 memcpy(SortArray, gQSortNum0 + p*SIZE,SIZE*4); 61 //memcpy(SortArray, gQSortNum0,SIZE*4);62 57 63 58 puts("Sort... \n"); 64 SORT((unsigned int *) (SortArray), (unsigned int) SIZE, SORT_TYPE);59 shellSort((unsigned int *) (SortArray), (unsigned int) SIZE); 65 60 66 61 for (j = 1; j < SIZE; j++) … … 81 76 } 82 77 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 78 96 79 while(1); 97 80 } 98 81 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 82 //------------------------------------------------------ 204 83 /* … … 242 121 } 243 122 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-xxx-ccxcachemulti-mipsel/top.cpp
r46 r85 11 11 #include "vci_simple_ram.h" 12 12 #include "vci_multi_tty.h" 13 //#include "vci_vgsb.h"14 13 #include "vci_vgmn.h" 15 //#include "vci_simple_ring_network.h"16 14 #include "vci_mem_cache_v1.h" 17 15 #include "vci_cc_xcache_wrapper_multi.h" 18 #include "vci_logger.h"19 16 20 17 #ifdef USE_GDB_SERVER … … 32 29 33 30 // Define VCI parameters 34 typedef soclib::caba::VciParams<4,8, 32,1,1,1,8,6,6,1> vci_param;31 typedef soclib::caba::VciParams<4,8,64,1,1,1,14,4,4,1> vci_param; 35 32 typedef soclib::common::Iss2Simhelper<soclib::common::Mips32ElIss> proc_iss; 36 33 // Mapping table 37 34 38 soclib::common::MappingTable maptabp( 32, IntTab(8), IntTab(8), 0x00300000);39 40 maptabp.add(Segment("reset", RESET_BASE, RESET_SIZE, IntTab( 2), true));41 maptabp.add(Segment("excep", EXCEP_BASE, EXCEP_SIZE, IntTab( 2), true));42 maptabp.add(Segment("text" , TEXT_BASE , TEXT_SIZE , IntTab( 2), true));35 soclib::common::MappingTable maptabp(40, IntTab(16), IntTab(8), 0x00300000); 36 37 maptabp.add(Segment("reset", RESET_BASE, RESET_SIZE, IntTab(0), true)); 38 maptabp.add(Segment("excep", EXCEP_BASE, EXCEP_SIZE, IntTab(0), true)); 39 maptabp.add(Segment("text" , TEXT_BASE , TEXT_SIZE , IntTab(0), true)); 43 40 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 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)); 41 maptabp.add(Segment("mc_m" , MC_M_BASE , MC_M_SIZE , IntTab(0), true )); 47 42 48 43 std::cout << maptabp << std::endl; 49 44 50 soclib::common::MappingTable maptabc( 32, IntTab(8), IntTab(8), 0x00300000);45 soclib::common::MappingTable maptabc(40, IntTab(16), IntTab(8), 0x00300000); 51 46 maptabc.add(Segment("c_proc0" , C_PROC0_BASE , C_PROC0_SIZE , IntTab(0), false, true, IntTab(0))); 52 maptabc.add(Segment("c_proc1" , C_PROC1_BASE , C_PROC1_SIZE , IntTab(1), false, true, IntTab(1))); 53 maptabc.add(Segment("c_proc2" , C_PROC2_BASE , C_PROC2_SIZE , IntTab(2), false, true, IntTab(2))); 54 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 maptabc.add(Segment("mc_m" , MC_M_BASE , MC_M_SIZE , IntTab(4), false, false)); 57 maptabc.add(Segment("reset", RESET_BASE, RESET_SIZE, IntTab(4), false, false)); 58 maptabc.add(Segment("excep", EXCEP_BASE, EXCEP_SIZE, IntTab(4), false, false)); 59 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)); 47 maptabc.add(Segment("mc_m" , MC_M_BASE , MC_M_SIZE , IntTab(1), false, false)); 48 maptabc.add(Segment("reset", RESET_BASE, RESET_SIZE, IntTab(1), false, false)); 49 maptabc.add(Segment("excep", EXCEP_BASE, EXCEP_SIZE, IntTab(1), false, false)); 50 maptabc.add(Segment("text" , TEXT_BASE , TEXT_SIZE , IntTab(1), false, false)); 61 51 62 52 std::cout << maptabc << std::endl; 63 53 64 soclib::common::MappingTable maptabx( 32, IntTab(8), IntTab(8), 0x00300000);54 soclib::common::MappingTable maptabx(40, IntTab(16), IntTab(8), 0x00300000); 65 55 maptabx.add(Segment("xram" , MC_M_BASE , MC_M_SIZE , IntTab(0), false)); 66 56 maptabx.add(Segment("reset", RESET_BASE, RESET_SIZE, IntTab(0), false)); 67 57 maptabx.add(Segment("excep", EXCEP_BASE, EXCEP_SIZE, IntTab(0), false)); 68 58 maptabx.add(Segment("text" , TEXT_BASE , TEXT_SIZE , IntTab(0), false)); 69 maptabx.add(Segment("ptba" , PTD_ADDR , TAB_SIZE , IntTab(0), false));70 59 71 60 std::cout << maptabx << std::endl; … … 81 70 sc_signal<bool> signal_proc0_it4("proc0_it4"); 82 71 sc_signal<bool> signal_proc0_it5("proc0_it5"); 83 72 /* 84 73 sc_signal<bool> signal_proc1_it0("proc1_it0"); 85 74 sc_signal<bool> signal_proc1_it1("proc1_it1"); … … 102 91 sc_signal<bool> signal_proc3_it4("proc3_it4"); 103 92 sc_signal<bool> signal_proc3_it5("proc3_it5"); 104 93 */ 105 94 soclib::caba::VciSignals<vci_param> signal_vci_ini_d_proc0("vci_ini_d_proc0"); 106 95 soclib::caba::VciSignals<vci_param> signal_vci_ini_c_proc0("vci_ini_c_proc0"); 107 96 soclib::caba::VciSignals<vci_param> signal_vci_tgt_c_proc0("vci_tgt_proc0"); 108 97 /* 109 98 soclib::caba::VciSignals<vci_param> signal_vci_ini_d_proc1("vci_ini_d_proc1"); 110 99 soclib::caba::VciSignals<vci_param> signal_vci_ini_c_proc1("vci_ini_c_proc1"); … … 118 107 soclib::caba::VciSignals<vci_param> signal_vci_ini_c_proc3("vci_ini_c_proc3"); 119 108 soclib::caba::VciSignals<vci_param> signal_vci_tgt_c_proc3("vci_tgt_proc3"); 120 109 */ 121 110 soclib::caba::VciSignals<vci_param> signal_vci_tgt_tty("vci_tgt_tty"); 122 123 soclib::caba::VciSignals<vci_param> signal_vci_tgt_rom("vci_tgt_rom");124 111 125 112 soclib::caba::VciSignals<vci_param> signal_vci_tgt_xram("vci_tgt_xram"); … … 130 117 soclib::caba::VciSignals<vci_param> signal_vci_tgt_c_memc("vci_tgt_cleanup_memc"); 131 118 132 sc_signal<bool> signal_tty_irq0("signal_tty_irq0"); 119 sc_signal<bool> signal_tty_irq0("signal_tty_irq0"); 120 /* 133 121 sc_signal<bool> signal_tty_irq1("signal_tty_irq1"); 134 122 sc_signal<bool> signal_tty_irq2("signal_tty_irq2"); 135 123 sc_signal<bool> signal_tty_irq3("signal_tty_irq3"); 136 124 */ 137 125 sc_signal<bool> signal_stuck0("signal_stuck0"); 138 126 … … 142 130 soclib::caba::VciCcXCacheWrapperMulti<vci_param, proc_iss > 143 131 proc0("proc0", 0, maptabp, maptabc, IntTab(0),IntTab(0),IntTab(0),1,8,16,1,8,16,4,8,16); 144 132 /* 145 133 soclib::caba::VciCcXCacheWrapperMulti<vci_param, proc_iss > 146 134 proc1("proc1", 1, maptabp, maptabc, IntTab(1),IntTab(1),IntTab(1),1,8,16,1,8,16,4,8,16); … … 151 139 soclib::caba::VciCcXCacheWrapperMulti<vci_param, proc_iss > 152 140 proc3("proc3", 3, maptabp, maptabc, IntTab(3),IntTab(3),IntTab(3),1,8,16,1,8,16,4,8,16); 153 154 soclib::caba::VciSimpleRam<vci_param> 155 rom("rom", IntTab(0), maptabp, loader); 141 */ 156 142 157 143 soclib::caba::VciSimpleRam<vci_param> … … 159 145 160 146 soclib::caba::VciMemCacheV1<vci_param> 161 memc("memc",maptabp,maptabc,maptabx,IntTab(0),IntTab( 4),IntTab(2), IntTab(4),4,16,16);147 memc("memc",maptabp,maptabc,maptabx,IntTab(0),IntTab(1),IntTab(0), IntTab(1),4,16,16); 162 148 163 149 soclib::caba::VciMultiTty<vci_param> 164 tty("tty",IntTab(1),maptabp,"tty0","tty1","tty2","tty3",NULL); 165 166 // soclib::caba::VciLogger<vci_param> vci_logger_proc0("vci_logger_proc0",maptabp); 167 // soclib::caba::VciLogger<vci_param> vci_logger_proc1("vci_logger_proc1",maptabp); 168 // soclib::caba::VciLogger<vci_param> vci_logger_proc2("vci_logger_proc2",maptabp); 169 // soclib::caba::VciLogger<vci_param> vci_logger_proc3("vci_logger_proc3",maptabp); 170 // soclib::caba::VciLogger<vci_param> vci_logger_memc("vci_logger_memc",maptabp); 171 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); 150 tty("tty",IntTab(1),maptabp,"tty0", NULL); 151 176 152 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); 153 ringd("ringd",maptabp, 1, 2, 2, 2); 154 183 155 soclib::caba::VciVgmn<vci_param> 184 ringc("ringc",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); 156 ringc("ringc",maptabc, 2, 2, 2, 2); 157 190 158 soclib::caba::VciVgmn<vci_param> 191 159 ringx("ringx",maptabx, 1, 1, 2, 2); … … 204 172 proc0.p_vci_ini_c(signal_vci_ini_c_proc0); 205 173 proc0.p_vci_tgt_c(signal_vci_tgt_c_proc0); 206 174 /* 207 175 proc1.p_clk(signal_clk); 208 176 proc1.p_resetn(signal_resetn); … … 240 208 proc3.p_vci_ini_c(signal_vci_ini_c_proc3); 241 209 proc3.p_vci_tgt_c(signal_vci_tgt_c_proc3); 242 243 rom.p_clk(signal_clk); 244 rom.p_resetn(signal_resetn); 245 rom.p_vci(signal_vci_tgt_rom); 210 */ 246 211 247 212 tty.p_clk(signal_clk); 248 213 tty.p_resetn(signal_resetn); 249 214 tty.p_vci(signal_vci_tgt_tty); 250 tty.p_irq[0](signal_tty_irq0); 215 tty.p_irq[0](signal_tty_irq0); 216 /* 251 217 tty.p_irq[1](signal_tty_irq1); 252 218 tty.p_irq[2](signal_tty_irq2); 253 219 tty.p_irq[3](signal_tty_irq3); 254 220 */ 255 221 memc.p_clk(signal_clk); 256 222 memc.p_resetn(signal_resetn); … … 267 233 ringd.p_resetn(signal_resetn); 268 234 ringd.p_to_initiator[0](signal_vci_ini_d_proc0); 235 /* 269 236 ringd.p_to_initiator[1](signal_vci_ini_d_proc1); 270 237 ringd.p_to_initiator[2](signal_vci_ini_d_proc2); 271 238 ringd.p_to_initiator[3](signal_vci_ini_d_proc3); 272 ringd.p_to_target[0](signal_vci_tgt_rom); 239 */ 273 240 ringd.p_to_target[1](signal_vci_tgt_tty); 274 ringd.p_to_target[ 2](signal_vci_tgt_d_memc);241 ringd.p_to_target[0](signal_vci_tgt_d_memc); 275 242 276 243 ringc.p_clk(signal_clk); 277 244 ringc.p_resetn(signal_resetn); 278 245 ringc.p_to_initiator[0](signal_vci_ini_c_proc0); 246 /* 279 247 ringc.p_to_initiator[1](signal_vci_ini_c_proc1); 280 248 ringc.p_to_initiator[2](signal_vci_ini_c_proc2); 281 249 ringc.p_to_initiator[3](signal_vci_ini_c_proc3); 282 ringc.p_to_initiator[4](signal_vci_ini_memc); 250 */ 251 ringc.p_to_initiator[1](signal_vci_ini_memc); 283 252 ringc.p_to_target[0](signal_vci_tgt_c_proc0); 253 /* 284 254 ringc.p_to_target[1](signal_vci_tgt_c_proc1); 285 255 ringc.p_to_target[2](signal_vci_tgt_c_proc2); 286 256 ringc.p_to_target[3](signal_vci_tgt_c_proc3); 287 ringc.p_to_target[4](signal_vci_tgt_c_memc); 257 */ 258 ringc.p_to_target[1](signal_vci_tgt_c_memc); 288 259 289 260 ringx.p_clk(signal_clk);
Note: See TracChangeset
for help on using the changeset viewer.