- Timestamp:
- Oct 28, 2010, 5:36:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/caba-vdspin-vci_synthetic_initiator/top.cpp
r105 r112 67 67 //soclib::common::Loader loader(); 68 68 // Mapping table primary network 69 soclib::common::MappingTable maptab0(address_width, IntTab(srcid_width-1 ,1), IntTab(srcid_width-1 ,1), 0xFFC0000); 70 soclib::common::MappingTable maptab1(address_width, IntTab(srcid_width-1 ,1), IntTab(srcid_width-1 ,1), 0xFFC0000); 69 soclib::common::MappingTable maptab0(address_width, IntTab(soclib::common::uint32_log2(X_MAX)+soclib::common::uint32_log2(Y_MAX) ,srcid_width-soclib::common::uint32_log2(X_MAX)-soclib::common::uint32_log2(Y_MAX)), 70 IntTab(soclib::common::uint32_log2(X_MAX)+soclib::common::uint32_log2(Y_MAX) ,srcid_width-soclib::common::uint32_log2(X_MAX)-soclib::common::uint32_log2(Y_MAX)), 0xFFC0000); 71 soclib::common::MappingTable maptab1(address_width, IntTab(soclib::common::uint32_log2(X_MAX)+soclib::common::uint32_log2(Y_MAX) ,srcid_width-soclib::common::uint32_log2(X_MAX)-soclib::common::uint32_log2(Y_MAX)), 72 IntTab(soclib::common::uint32_log2(X_MAX)+soclib::common::uint32_log2(Y_MAX) ,srcid_width-soclib::common::uint32_log2(X_MAX)-soclib::common::uint32_log2(Y_MAX)), 0xFFC0000); 71 73 for(int i = 0 ; i < Y_MAX ; i++){ 72 74 for(int j = 0 ; j < X_MAX ; j++){ 73 75 std::ostringstream str0; 74 76 std::ostringstream str1; 75 str0 << "Target_c0_" << (i* X_MAX+j) ;76 str1 << "Target_c1_" << (i* X_MAX+j) ;77 maptab0.add(Segment(str0.str(), TARGET_ADDR + ((i* X_MAX+j) << (address_width-srcid_width+1)), TARGET_SIZE, IntTab((i*X_MAX+j),0), false));78 maptab1.add(Segment(str1.str(), TARGET_ADDR + ((i* X_MAX+j) << (address_width-srcid_width+1)), TARGET_SIZE, IntTab((i*X_MAX+j),0), false));77 str0 << "Target_c0_" << (i*Y_MAX+j) ; 78 str1 << "Target_c1_" << (i*Y_MAX+j) ; 79 maptab0.add(Segment(str0.str(), TARGET_ADDR + ((i*Y_MAX+j) << (address_width-soclib::common::uint32_log2(X_MAX)-soclib::common::uint32_log2(Y_MAX))), TARGET_SIZE, IntTab((i*X_MAX+j),0), false)); 80 maptab1.add(Segment(str1.str(), TARGET_ADDR + ((i*Y_MAX+j) << (address_width-soclib::common::uint32_log2(X_MAX)-soclib::common::uint32_log2(Y_MAX))), TARGET_SIZE, IntTab((i*X_MAX+j),0), false)); 79 81 } 80 82 } … … 109 111 str0 << "cluster_c0_" << i ; 110 112 str1 << "cluster_c1_" << i ; 111 new(&local_ring_c0[i]) soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> (str0.str().c_str() ,maptab0, IntTab(i), 2, 18, 1, 1); 112 new(&local_ring_c1[i]) soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> (str1.str().c_str() ,maptab1, IntTab(i), 2, 18, 1, 1); 113 new(&local_ring_c0[i]) soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> (str0.str().c_str(), 114 maptab0, 115 IntTab(i), 116 2, 117 18, 118 1, 119 1); 120 new(&local_ring_c1[i]) soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> (str1.str().c_str(), 121 maptab1, 122 IntTab(i), 123 2, 124 18, 125 1, 126 1); 113 127 } 114 128 115 129 // Virtual dspin routers 116 soclib::caba::VirtualDspinRouter<WIDTH_CMD> ** routers_cmd = (soclib::caba::VirtualDspinRouter<WIDTH_CMD> **) malloc(sizeof(soclib::caba::VirtualDspinRouter<WIDTH_CMD> *) * Y_MAX);117 soclib::caba::VirtualDspinRouter<WIDTH_RSP> ** routers_rsp = (soclib::caba::VirtualDspinRouter<WIDTH_RSP> **) malloc(sizeof(soclib::caba::VirtualDspinRouter<WIDTH_RSP> *) * Y_MAX);118 119 for(int i = 0; i < Y_MAX; i++ ){120 routers_cmd[i] = (soclib::caba::VirtualDspinRouter<WIDTH_CMD> * ) malloc(sizeof(soclib::caba::VirtualDspinRouter<WIDTH_CMD>) * X_MAX);121 routers_rsp[i] = (soclib::caba::VirtualDspinRouter<WIDTH_RSP> * ) malloc(sizeof(soclib::caba::VirtualDspinRouter<WIDTH_RSP>) * X_MAX);122 for(int j = 0; j < X_MAX; j++){130 soclib::caba::VirtualDspinRouter<WIDTH_CMD> ** routers_cmd = (soclib::caba::VirtualDspinRouter<WIDTH_CMD> **) malloc(sizeof(soclib::caba::VirtualDspinRouter<WIDTH_CMD> *) * X_MAX); 131 soclib::caba::VirtualDspinRouter<WIDTH_RSP> ** routers_rsp = (soclib::caba::VirtualDspinRouter<WIDTH_RSP> **) malloc(sizeof(soclib::caba::VirtualDspinRouter<WIDTH_RSP> *) * X_MAX); 132 133 for(int i = 0; i < X_MAX; i++ ){ 134 routers_cmd[i] = (soclib::caba::VirtualDspinRouter<WIDTH_CMD> * ) malloc(sizeof(soclib::caba::VirtualDspinRouter<WIDTH_CMD>) * Y_MAX); 135 routers_rsp[i] = (soclib::caba::VirtualDspinRouter<WIDTH_RSP> * ) malloc(sizeof(soclib::caba::VirtualDspinRouter<WIDTH_RSP>) * Y_MAX); 136 for(int j = 0; j < Y_MAX; j++){ 123 137 std::cout << "Passe " << i << j << " pour instanciation vdspin" << std::endl; 124 new(&routers_cmd[i][j]) soclib::caba::VirtualDspinRouter<WIDTH_CMD> ("VDspinRouterCMD" + i + j, j, i, soclib::common::uint32_log2(X_MAX), soclib::common::uint32_log2(Y_MAX), 4, 4); 125 new(&routers_rsp[i][j]) soclib::caba::VirtualDspinRouter<WIDTH_RSP> ("VDspinRouterRSP" + i + j, j, i, soclib::common::uint32_log2(X_MAX), soclib::common::uint32_log2(Y_MAX), 4, 4); 138 std::ostringstream str0; 139 std::ostringstream str1; 140 str0 << "VDspinRouterCMD" << i << j; 141 str1 << "VDspinRouterRSP" << i << j; 142 new(&routers_cmd[i][j]) soclib::caba::VirtualDspinRouter<WIDTH_CMD> (str0.str().c_str(), i, j, soclib::common::uint32_log2(X_MAX), soclib::common::uint32_log2(Y_MAX), 4, 4); 143 new(&routers_rsp[i][j]) soclib::caba::VirtualDspinRouter<WIDTH_RSP> (str1.str().c_str(), i, j, soclib::common::uint32_log2(X_MAX), soclib::common::uint32_log2(Y_MAX), 4, 4); 126 144 } 127 145 } … … 135 153 soclib::caba::VciSyntheticInitiator<vci_param> * initiator_c0 = (soclib::caba::VciSyntheticInitiator<vci_param> *) malloc(sizeof(soclib::caba::VciSyntheticInitiator<vci_param> )* N_CLUSTERS); 136 154 soclib::caba::VciSyntheticInitiator<vci_param> * initiator_c1 = (soclib::caba::VciSyntheticInitiator<vci_param> *) malloc(sizeof(soclib::caba::VciSyntheticInitiator<vci_param> )* N_CLUSTERS); 137 for(int i = 0 ; i < Y_MAX; i++)138 for(int j = 0 ; j < X_MAX ; j++){155 for(int i = 0 ; i < X_MAX; i++) 156 for(int j = 0 ; j < Y_MAX ; j++){ 139 157 std::cout << "Passe " << i << j << " pour instanciation synthetic_init" << std::endl; 140 158 std::ostringstream str0; 141 159 std::ostringstream str1; 142 str0 << "Initiator_c0_" << (i*X_MAX+j) ; 143 str1 << "Initiator_c1_" << (i*X_MAX+j) ; 144 new(&initiator_c0[X_MAX*i+j]) soclib::caba::VciSyntheticInitiator<vci_param> (str0.str().c_str() , maptab0, IntTab(i*X_MAX+j,0), 16, 0.5, 2, X_MAX, Y_MAX ); //, 0, 0, 0, 0, 0); 145 new(&initiator_c1[X_MAX*i+j]) soclib::caba::VciSyntheticInitiator<vci_param> (str1.str().c_str() , maptab0, IntTab(i*X_MAX+j,0), 16, 0.5, 2, X_MAX, Y_MAX ); //, 0, 0, 0, 0, 0); 160 str0 << "Initiator_c0_" << (i*Y_MAX+j) ; 161 str1 << "Initiator_c1_" << (i*Y_MAX+j) ; 162 if( (i == X_MAX-1) && (j == Y_MAX-1)){ 163 new(&initiator_c0[Y_MAX*i+j]) soclib::caba::VciSyntheticInitiator<vci_param> (str0.str().c_str() , maptab0, IntTab((i*Y_MAX+j) ,0), 16, 900, 2, X_MAX, Y_MAX, 25, 0, X_MAX, 0, Y_MAX); //, 0, 0, 0, 0, 0); 164 new(&initiator_c1[Y_MAX*i+j]) soclib::caba::VciSyntheticInitiator<vci_param> (str1.str().c_str() , maptab1, IntTab((i*Y_MAX+j) ,0), 16, 900, 2, X_MAX, Y_MAX, 25, 0, X_MAX, 0, Y_MAX); //, 0, 0, 0, 0, 0); 165 } else { 166 new(&initiator_c0[Y_MAX*i+j]) soclib::caba::VciSyntheticInitiator<vci_param> (str0.str().c_str() , maptab0, IntTab((i*Y_MAX+j),0), 16, 500, 2, X_MAX, Y_MAX); //, 0, 0, 0, 0, 0); 167 new(&initiator_c1[Y_MAX*i+j]) soclib::caba::VciSyntheticInitiator<vci_param> (str1.str().c_str() , maptab1, IntTab((i*Y_MAX+j),0), 16, 500, 2, X_MAX, Y_MAX); //, 0, 0, 0, 0, 0); 168 } 146 169 } 147 170 148 171 soclib::caba::VciSimpleRam<vci_param> * ram_c0 = (soclib::caba::VciSimpleRam<vci_param> *) malloc(sizeof(soclib::caba::VciSimpleRam<vci_param>) * N_CLUSTERS); 149 172 soclib::caba::VciSimpleRam<vci_param> * ram_c1 = (soclib::caba::VciSimpleRam<vci_param> *) malloc(sizeof(soclib::caba::VciSimpleRam<vci_param>) * N_CLUSTERS); 150 for(int i = 0 ; i < Y_MAX ; i++)151 for(int j = 0 ; j < X_MAX ; j++){173 for(int i = 0 ; i < X_MAX ; i++) 174 for(int j = 0 ; j < Y_MAX ; j++){ 152 175 std::cout << "Passe " << i << j << " pour instanciation Ram" << std::endl; 153 176 std::ostringstream str0; 154 177 std::ostringstream str1; 155 str0 << "Ram_c0_" << (i* X_MAX+j) ;156 str1 << "Ram_c1_" << (i* X_MAX+j) ;157 new(&ram_c0[ X_MAX*i+j]) soclib::caba::VciSimpleRam<vci_param> (str0.str().c_str() , IntTab(i*X_MAX+j,0), maptab0, soclib::common::Loader(), 0);158 new(&ram_c1[ X_MAX*i+j]) soclib::caba::VciSimpleRam<vci_param> (str1.str().c_str() , IntTab(i*X_MAX+j,0), maptab1, soclib::common::Loader(), 0);178 str0 << "Ram_c0_" << (i*Y_MAX+j) ; 179 str1 << "Ram_c1_" << (i*Y_MAX+j) ; 180 new(&ram_c0[Y_MAX*i+j]) soclib::caba::VciSimpleRam<vci_param> (str0.str().c_str() , IntTab(i*Y_MAX+j,0), maptab0, soclib::common::Loader(), 0); 181 new(&ram_c1[Y_MAX*i+j]) soclib::caba::VciSimpleRam<vci_param> (str1.str().c_str() , IntTab(i*Y_MAX+j,0), maptab1, soclib::common::Loader(), 0); 159 182 } 160 183 … … 189 212 // neighbors VDspin Router 190 213 /////////////////////////////////////////////////////////////// 191 for(int i = 0; i < Y_MAX ; i++){192 for(int j = 0; j < X_MAX ; j++){214 for(int i = 0; i < X_MAX ; i++){ 215 for(int j = 0; j < Y_MAX ; j++){ 193 216 routers_cmd[i][j].p_clk(signal_clk); 194 217 routers_cmd[i][j].p_resetn(signal_resetn); 195 218 routers_rsp[i][j].p_clk(signal_clk); 196 219 routers_rsp[i][j].p_resetn(signal_resetn); 197 local_ring_c0[i*X_MAX+j].p_gate_cmd_in( dspin_signals_cmd_c0[0][i][j][LOCAL]); 198 local_ring_c0[i*X_MAX+j].p_gate_cmd_out(dspin_signals_cmd_c0[1][i][j][LOCAL] ); 199 local_ring_c0[i*X_MAX+j].p_gate_rsp_in( dspin_signals_rsp_c0[0][i][j][LOCAL]); 200 local_ring_c0[i*X_MAX+j].p_gate_rsp_out(dspin_signals_rsp_c0[1][i][j][LOCAL] ); 201 local_ring_c1[i*X_MAX+j].p_gate_cmd_in( dspin_signals_cmd_c1[0][i][j][LOCAL]); 202 local_ring_c1[i*X_MAX+j].p_gate_cmd_out(dspin_signals_cmd_c1[1][i][j][LOCAL] ); 203 local_ring_c1[i*X_MAX+j].p_gate_rsp_in( dspin_signals_rsp_c1[0][i][j][LOCAL]); 204 local_ring_c1[i*X_MAX+j].p_gate_rsp_out(dspin_signals_rsp_c1[1][i][j][LOCAL] ); 220 local_ring_c0[i*Y_MAX+j].p_gate_cmd_in( dspin_signals_cmd_c0[0][i][j][LOCAL]); 221 local_ring_c1[i*Y_MAX+j].p_gate_cmd_in( dspin_signals_cmd_c1[0][i][j][LOCAL]); 222 local_ring_c0[i*Y_MAX+j].p_gate_cmd_out(dspin_signals_cmd_c0[1][i][j][LOCAL]); 223 local_ring_c1[i*Y_MAX+j].p_gate_cmd_out(dspin_signals_cmd_c1[1][i][j][LOCAL]); 224 local_ring_c0[i*Y_MAX+j].p_gate_rsp_in( dspin_signals_rsp_c0[0][i][j][LOCAL]); 225 local_ring_c1[i*Y_MAX+j].p_gate_rsp_in( dspin_signals_rsp_c1[0][i][j][LOCAL]); 226 local_ring_c0[i*Y_MAX+j].p_gate_rsp_out(dspin_signals_rsp_c0[1][i][j][LOCAL]); 227 local_ring_c1[i*Y_MAX+j].p_gate_rsp_out(dspin_signals_rsp_c1[1][i][j][LOCAL]); 228 std::cout << "Ring to DSPIN Connection done" << std::endl; 205 229 for(int k = 0; k < 5; k++){ 206 if(i== 0){207 if(j== 0){208 209 210 211 212 213 214 215 216 217 218 routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[1][i][j-1][EAST]);219 routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[1][i][j-1][EAST]);220 routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[0][i][j-1][EAST]);221 routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[0][i][j-1][EAST]);222 routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[1][i][j-1][EAST]);223 routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[1][i][j-1][EAST]);224 routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[0][i][j-1][EAST]);225 routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[0][i][j-1][EAST]);226 227 228 229 230 231 232 233 234 235 236 237 238 239 routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[1][i-1][j][NORTH]);240 routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[1][i-1][j][NORTH]);241 routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[0][i-1][j][NORTH]);242 routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[0][i-1][j][NORTH]);243 routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[1][i-1][j][NORTH]);244 routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[1][i-1][j][NORTH]);245 routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[0][i-1][j][NORTH]);246 routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[0][i-1][j][NORTH]);247 248 if(j== 0){249 250 251 252 253 254 255 256 257 258 routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[1][i][j-1][EAST]);259 routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[1][i][j-1][EAST]);260 routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[0][i][j-1][EAST]);261 routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[0][i][j-1][EAST]);262 routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[1][i][j-1][EAST]);263 routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[1][i][j-1][EAST]);264 routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[0][i][j-1][EAST]);265 routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[0][i][j-1][EAST]);266 267 268 269 270 271 272 273 274 275 276 277 230 if(j == 0){ 231 if(i == 0){ 232 routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[0][i][j][k]); 233 routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[0][i][j][k]); 234 routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[1][i][j][k]); 235 routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[1][i][j][k]); 236 routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[0][i][j][k]); 237 routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[0][i][j][k]); 238 routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[1][i][j][k]); 239 routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[1][i][j][k]); 240 } else { 241 if(k == WEST){ 242 routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[1][i-1][j][EAST]); 243 routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[1][i-1][j][EAST]); 244 routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[0][i-1][j][EAST]); 245 routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[0][i-1][j][EAST]); 246 routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[1][i-1][j][EAST]); 247 routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[1][i-1][j][EAST]); 248 routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[0][i-1][j][EAST]); 249 routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[0][i-1][j][EAST]); 250 } else { 251 routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[0][i][j][k]); 252 routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[0][i][j][k]); 253 routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[1][i][j][k]); 254 routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[1][i][j][k]); 255 routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[0][i][j][k]); 256 routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[0][i][j][k]); 257 routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[1][i][j][k]); 258 routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[1][i][j][k]); 259 } 260 } 261 } else { 262 if(k == SOUTH){ 263 routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[1][i][j-1][NORTH]); 264 routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[1][i][j-1][NORTH]); 265 routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[0][i][j-1][NORTH]); 266 routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[0][i][j-1][NORTH]); 267 routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[1][i][j-1][NORTH]); 268 routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[1][i][j-1][NORTH]); 269 routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[0][i][j-1][NORTH]); 270 routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[0][i][j-1][NORTH]); 271 } else if(k == WEST){ 272 if(i == 0){ 273 routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[0][i][j][k]); 274 routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[0][i][j][k]); 275 routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[1][i][j][k]); 276 routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[1][i][j][k]); 277 routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[0][i][j][k]); 278 routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[0][i][j][k]); 279 routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[1][i][j][k]); 280 routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[1][i][j][k]); 281 } else { 282 routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[1][i-1][j][EAST]); 283 routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[1][i-1][j][EAST]); 284 routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[0][i-1][j][EAST]); 285 routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[0][i-1][j][EAST]); 286 routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[1][i-1][j][EAST]); 287 routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[1][i-1][j][EAST]); 288 routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[0][i-1][j][EAST]); 289 routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[0][i-1][j][EAST]); 290 } 291 } else { 292 routers_cmd[i][j].p_out[0][k](dspin_signals_cmd_c0[0][i][j][k]); 293 routers_cmd[i][j].p_out[1][k](dspin_signals_cmd_c1[0][i][j][k]); 294 routers_cmd[i][j].p_in[0][k](dspin_signals_cmd_c0[1][i][j][k]); 295 routers_cmd[i][j].p_in[1][k](dspin_signals_cmd_c1[1][i][j][k]); 296 routers_rsp[i][j].p_out[0][k](dspin_signals_rsp_c0[0][i][j][k]); 297 routers_rsp[i][j].p_out[1][k](dspin_signals_rsp_c1[0][i][j][k]); 298 routers_rsp[i][j].p_in[0][k](dspin_signals_rsp_c0[1][i][j][k]); 299 routers_rsp[i][j].p_in[1][k](dspin_signals_rsp_c1[1][i][j][k]); 300 } 301 } 278 302 } 279 303 } … … 281 305 282 306 //////////////////////////////////////////////////////// 307 for(int i = 0; i < Y_MAX ; i++){ 308 for(int j = 0; j < Y_MAX ; j++){ 309 if(i == 0){ 310 dspin_signals_cmd_c0[0][i][j][SOUTH].read = true ; 311 dspin_signals_cmd_c0[1][i][j][SOUTH].write = false ; 312 dspin_signals_cmd_c1[0][i][j][SOUTH].read = true ; 313 dspin_signals_cmd_c1[1][i][j][SOUTH].write = false ; 314 dspin_signals_rsp_c0[0][i][j][SOUTH].read = true ; 315 dspin_signals_rsp_c0[1][i][j][SOUTH].write = false ; 316 dspin_signals_rsp_c1[0][i][j][SOUTH].read = true ; 317 dspin_signals_rsp_c1[1][i][j][SOUTH].write = false ; 318 } 319 if(i == Y_MAX-1){ 320 dspin_signals_cmd_c0[0][i][j][NORTH].read = true ; 321 dspin_signals_cmd_c0[1][i][j][NORTH].write = false ; 322 dspin_signals_cmd_c1[0][i][j][NORTH].read = true ; 323 dspin_signals_cmd_c1[1][i][j][NORTH].write = false ; 324 dspin_signals_rsp_c0[0][i][j][NORTH].read = true ; 325 dspin_signals_rsp_c0[1][i][j][NORTH].write = false ; 326 dspin_signals_rsp_c1[0][i][j][NORTH].read = true ; 327 dspin_signals_rsp_c1[1][i][j][NORTH].write = false ; 328 } 329 if(j == 0){ 330 dspin_signals_cmd_c0[0][i][j][WEST].read = true ; 331 dspin_signals_cmd_c0[1][i][j][WEST].write = false ; 332 dspin_signals_cmd_c1[0][i][j][WEST].read = true ; 333 dspin_signals_cmd_c1[1][i][j][WEST].write = false ; 334 dspin_signals_rsp_c0[0][i][j][WEST].read = true ; 335 dspin_signals_rsp_c0[1][i][j][WEST].write = false ; 336 dspin_signals_rsp_c1[0][i][j][WEST].read = true ; 337 dspin_signals_rsp_c1[1][i][j][WEST].write = false ; 338 } 339 if(j == X_MAX-1){ 340 dspin_signals_cmd_c0[0][i][j][EAST].read = true ; 341 dspin_signals_cmd_c0[1][i][j][EAST].write = false ; 342 dspin_signals_cmd_c1[0][i][j][EAST].read = true ; 343 dspin_signals_cmd_c1[1][i][j][EAST].write = false ; 344 dspin_signals_rsp_c0[0][i][j][EAST].read = true ; 345 dspin_signals_rsp_c0[1][i][j][EAST].write = false ; 346 dspin_signals_rsp_c1[0][i][j][EAST].read = true ; 347 dspin_signals_rsp_c1[1][i][j][EAST].write = false ; 348 } 349 } 350 } 283 351 284 352 … … 287 355 // Simulation Loop // 288 356 //////////////////////////////////////////////// 289 int ncycles;357 //int ncycles; 290 358 291 359 sc_start(sc_core::sc_time(0, SC_NS)); … … 296 364 297 365 while(1) { 298 sc_start(sc_core::sc_time(100000, SC_NS)); 366 sc_start(sc_time(1, SC_NS)); 367 std::cout << "Synthetic initiators signals ------------------------------" << std::endl; 368 for(int i = 0 ; i < N_CLUSTERS ; i++){ 369 initiator_c0[i].print_trace(); 370 std::cout << std::hex; 371 std::cout << "synt_cmdval = " << signal_vci_ini_synth_c0[0][i].cmdval.read() << std::endl; 372 std::cout << "synt_address = " << signal_vci_ini_synth_c0[0][i].address.read() << std::endl; 373 std::cout << "synt_cmd = " << signal_vci_ini_synth_c0[0][i].cmd.read() << std::endl; 374 std::cout << "synt_srcid = " << signal_vci_ini_synth_c0[0][i].srcid.read() << std::endl; 375 std::cout << "synt_plen = " << signal_vci_ini_synth_c0[0][i].plen.read() << std::endl; 376 std::cout << "synt_eop = " << signal_vci_ini_synth_c0[0][i].eop.read() << std::endl; 377 std::cout << "synt_rspval = " << signal_vci_ini_synth_c0[0][i].rspval.read() << std::endl; 378 std::cout << "synt_rerror = " << signal_vci_ini_synth_c0[0][i].rerror.read() << std::endl; 379 std::cout << "synt_reop = " << signal_vci_ini_synth_c0[0][i].reop.read() << std::endl; 380 } 381 std::cout << "RAM signals -----------------------------------------------" << std::endl; 382 for(int i = 0 ; i < N_CLUSTERS ; i++){ 383 ram_c0[i].print_trace(); 384 std::cout << std::hex; 385 std::cout << "ram_cmdval = " << signal_vci_ini_synth_c0[1][i].cmdval.read() << std::endl; 386 std::cout << "ram_address = " << signal_vci_ini_synth_c0[1][i].address.read() << std::endl; 387 std::cout << "ram_cmd = " << signal_vci_ini_synth_c0[1][i].cmd.read() << std::endl; 388 std::cout << "ram_srcid = " << signal_vci_ini_synth_c0[1][i].srcid.read() << std::endl; 389 std::cout << "ram_plen = " << signal_vci_ini_synth_c0[1][i].plen.read() << std::endl; 390 std::cout << "ram_eop = " << signal_vci_ini_synth_c0[1][i].eop.read() << std::endl; 391 std::cout << "ram_rspval = " << signal_vci_ini_synth_c0[1][i].rspval.read() << std::endl; 392 std::cout << "ram_rsrcid = " << signal_vci_ini_synth_c0[1][i].rsrcid.read() << std::endl; 393 std::cout << "ram_rerror = " << signal_vci_ini_synth_c0[1][i].rerror.read() << std::endl; 394 std::cout << "ram_reop = " << signal_vci_ini_synth_c0[1][i].reop.read() << std::endl; 395 } 396 std::cout << "Local_ring ------------------------------------------------" << std::endl; 397 for(int i = 0 ; i < N_CLUSTERS ; i++){ 398 local_ring_c0[i].print_trace(); 399 } 400 std::cout << "Routers CMD -----------------------------------------------" << std::endl; 401 for(int i = 0 ; i < Y_MAX ; i++){ 402 for(int j = 0 ; j < X_MAX ; j++){ 403 routers_cmd[i][j].printTrace(0); 404 } 405 } 406 std::cout << "Routers RSP -----------------------------------------------" << std::endl; 407 for(int i = 0 ; i < Y_MAX ; i++){ 408 for(int j = 0 ; j < X_MAX ; j++){ 409 routers_rsp[i][j].printTrace(0); 410 } 411 } 412 413 //for(int i = 0; i< N_CLUSTERS; i++){ 414 // initiator_c1[i].print_trace(); 415 // std::cout << std::hex; 416 // std::cout << "synt_cmdval = " << signal_vci_ini_synth_c1[0][i].cmdval.read() << std::endl; 417 // std::cout << "synt_address = " << signal_vci_ini_synth_c1[0][i].address.read() << std::endl; 418 // std::cout << "synt_cmd = " << signal_vci_ini_synth_c1[0][i].cmd.read() << std::endl; 419 // std::cout << "synt_srcid = " << signal_vci_ini_synth_c1[0][i].srcid.read() << std::endl; 420 // std::cout << "synt_plen = " << signal_vci_ini_synth_c1[0][i].plen.read() << std::endl; 421 // std::cout << "synt_eop = " << signal_vci_ini_synth_c1[0][i].eop.read() << std::endl; 422 // std::cout << "synt_rspval = " << signal_vci_ini_synth_c1[0][i].rspval.read() << std::endl; 423 // std::cout << "synt_rerror = " << signal_vci_ini_synth_c1[0][i].rerror.read() << std::endl; 424 // std::cout << "synt_reop = " << signal_vci_ini_synth_c1[0][i].reop.read() << std::endl; 425 //} 426 //for(int i = 0 ; i < N_CLUSTERS ; i++){ 427 // ram_c1[i].print_trace(); 428 // std::cout << std::hex; 429 // std::cout << "ram_cmdval = " << signal_vci_ini_synth_c0[1][i].cmdval.read() << std::endl; 430 // std::cout << "ram_address = " << signal_vci_ini_synth_c0[1][i].address.read() << std::endl; 431 // std::cout << "ram_cmd = " << signal_vci_ini_synth_c0[1][i].cmd.read() << std::endl; 432 // std::cout << "ram_srcid = " << signal_vci_ini_synth_c0[1][i].srcid.read() << std::endl; 433 // std::cout << "ram_plen = " << signal_vci_ini_synth_c0[1][i].plen.read() << std::endl; 434 // std::cout << "ram_eop = " << signal_vci_ini_synth_c0[1][i].eop.read() << std::endl; 435 // std::cout << "ram_rspval = " << signal_vci_ini_synth_c0[1][i].rspval.read() << std::endl; 436 // std::cout << "ram_rerror = " << signal_vci_ini_synth_c0[1][i].rerror.read() << std::endl; 437 // std::cout << "ram_reop = " << signal_vci_ini_synth_c0[1][i].reop.read() << std::endl; 438 //} 439 299 440 } 300 441
Note: See TracChangeset
for help on using the changeset viewer.