Changeset 885 for trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp
- Timestamp:
- Nov 14, 2014, 11:05:54 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp
r836 r885 91 91 n_procs = nb_procs; 92 92 93 // Vectors of ports definition 94 p_cmd_in = alloc_elems<DspinInput<dspin_cmd_width> > ("p_cmd_in", 4, 3); 95 p_cmd_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_cmd_out", 4, 3); 96 p_rsp_in = alloc_elems<DspinInput<dspin_rsp_width> > ("p_rsp_in", 4, 2); 97 p_rsp_out = alloc_elems<DspinOutput<dspin_rsp_width> > ("p_rsp_out", 4, 2); 93 ///////////////////////////////////////////////////////////////////////////// 94 // Vectors of ports definition and allocation 95 ///////////////////////////////////////////////////////////////////////////// 96 97 p_cmd_in = alloc_elems<DspinInput<dspin_cmd_width> > ("p_cmd_in", 4); 98 p_cmd_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_cmd_out", 4); 99 100 p_rsp_in = alloc_elems<DspinInput<dspin_rsp_width> > ("p_rsp_in", 4); 101 p_rsp_out = alloc_elems<DspinOutput<dspin_rsp_width> > ("p_rsp_out", 4); 102 103 p_m2p_in = alloc_elems<DspinInput<dspin_cmd_width> > ("p_m2p_in", 4); 104 p_m2p_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_m2p_out", 4); 105 106 p_p2m_in = alloc_elems<DspinInput<dspin_rsp_width> > ("p_p2m_in", 4); 107 p_p2m_out = alloc_elems<DspinOutput<dspin_rsp_width> > ("p_p2m_out", 4); 108 109 p_cla_in = alloc_elems<DspinInput<dspin_cmd_width> > ("p_cla_in", 4); 110 p_cla_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_cla_out", 4); 98 111 99 112 ///////////////////////////////////////////////////////////////////////////// … … 174 187 32, // number of hard IRQs 175 188 32, // number of soft IRQs 176 nb_procs *irq_per_processor);// number of output IRQs189 nb_procs * irq_per_processor); // number of output IRQs 177 190 178 191 … … 262 275 263 276 ///////////////////////////////////////////////////////////////////////////// 264 router_cmd = new VirtualDspinRouter<dspin_cmd_width>( 265 "router_cmd", 277 std::ostringstream s_router_cmd; 278 s_router_cmd << "router_cmd_" << x_id << "_" << y_id; 279 router_cmd = new DspinRouter<dspin_cmd_width>( 280 s_router_cmd.str().c_str(), 266 281 x_id,y_id, // coordinate in the mesh 267 282 x_width, y_width, // x & y fields width 268 3, // nb virtual channels269 283 4,4); // input & output fifo depths 270 284 271 285 ///////////////////////////////////////////////////////////////////////////// 272 router_rsp = new VirtualDspinRouter<dspin_rsp_width>( 273 "router_rsp", 286 std::ostringstream s_router_rsp; 287 s_router_rsp << "router_rsp_" << x_id << "_" << y_id; 288 router_rsp = new DspinRouter<dspin_rsp_width>( 289 s_router_rsp.str().c_str(), 274 290 x_id,y_id, // coordinates in mesh 275 291 x_width, y_width, // x & y fields width 276 2, // nb virtual channels 292 4,4); // input & output fifo depths 293 294 ///////////////////////////////////////////////////////////////////////////// 295 std::ostringstream s_router_m2p; 296 s_router_m2p << "router_m2p_" << x_id << "_" << y_id; 297 router_m2p = new DspinRouter<dspin_cmd_width>( 298 s_router_m2p.str().c_str(), 299 x_id,y_id, // coordinate in the mesh 300 x_width, y_width, // x & y fields width 301 4,4, // input & output fifo depths 302 true); // broadcast supported 303 304 ///////////////////////////////////////////////////////////////////////////// 305 std::ostringstream s_router_p2m; 306 s_router_p2m << "router_p2m_" << x_id << "_" << y_id; 307 router_p2m = new DspinRouter<dspin_rsp_width>( 308 s_router_p2m.str().c_str(), 309 x_id,y_id, // coordinates in mesh 310 x_width, y_width, // x & y fields width 311 4,4); // input & output fifo depths 312 313 ///////////////////////////////////////////////////////////////////////////// 314 std::ostringstream s_router_cla; 315 s_router_cla << "router_cla_" << x_id << "_" << y_id; 316 router_cla = new DspinRouter<dspin_cmd_width>( 317 s_router_cla.str().c_str(), 318 x_id,y_id, // coordinate in the mesh 319 x_width, y_width, // x & y fields width 277 320 4,4); // input & output fifo depths 278 321 … … 350 393 //////////////////////////////////// 351 394 352 //////////////////////// CMD ROUTER and RSP ROUTER 353 router_cmd->p_clk (this->p_clk); 354 router_cmd->p_resetn (this->p_resetn); 355 router_rsp->p_clk (this->p_clk); 356 router_rsp->p_resetn (this->p_resetn); 357 358 for (int i = 0; i < 4; i++) 359 { 360 for (int k = 0; k < 3; k++) 361 { 362 router_cmd->p_out[i][k] (this->p_cmd_out[i][k]); 363 router_cmd->p_in[i][k] (this->p_cmd_in[i][k]); 364 } 365 366 for (int k = 0; k < 2; k++) 367 { 368 router_rsp->p_out[i][k] (this->p_rsp_out[i][k]); 369 router_rsp->p_in[i][k] (this->p_rsp_in[i][k]); 370 } 371 } 372 373 router_cmd->p_out[4][0] (signal_dspin_cmd_g2l_d); 374 router_cmd->p_out[4][1] (signal_dspin_m2p_g2l_c); 375 router_cmd->p_out[4][2] (signal_dspin_clack_g2l_c); 376 router_cmd->p_in[4][0] (signal_dspin_cmd_l2g_d); 377 router_cmd->p_in[4][1] (signal_dspin_m2p_l2g_c); 378 router_cmd->p_in[4][2] (signal_dspin_clack_l2g_c); 379 380 router_rsp->p_out[4][0] (signal_dspin_rsp_g2l_d); 381 router_rsp->p_out[4][1] (signal_dspin_p2m_g2l_c); 382 router_rsp->p_in[4][0] (signal_dspin_rsp_l2g_d); 383 router_rsp->p_in[4][1] (signal_dspin_p2m_l2g_c); 384 385 386 std::cout << " - CMD & RSP routers connected" << std::endl; 395 //////////////////////// ROUTERS 396 router_cmd->p_clk (this->p_clk); 397 router_cmd->p_resetn (this->p_resetn); 398 router_rsp->p_clk (this->p_clk); 399 router_rsp->p_resetn (this->p_resetn); 400 router_m2p->p_clk (this->p_clk); 401 router_m2p->p_resetn (this->p_resetn); 402 router_p2m->p_clk (this->p_clk); 403 router_p2m->p_resetn (this->p_resetn); 404 router_cla->p_clk (this->p_clk); 405 router_cla->p_resetn (this->p_resetn); 406 407 // loop on N/S/E/W ports 408 for (size_t i = 0; i < 4; i++) 409 { 410 router_cmd->p_out[i] (this->p_cmd_out[i]); 411 router_cmd->p_in[i] (this->p_cmd_in[i]); 412 413 router_rsp->p_out[i] (this->p_rsp_out[i]); 414 router_rsp->p_in[i] (this->p_rsp_in[i]); 415 416 router_m2p->p_out[i] (this->p_m2p_out[i]); 417 router_m2p->p_in[i] (this->p_m2p_in[i]); 418 419 router_p2m->p_out[i] (this->p_p2m_out[i]); 420 router_p2m->p_in[i] (this->p_p2m_in[i]); 421 422 router_cla->p_out[i] (this->p_cla_out[i]); 423 router_cla->p_in[i] (this->p_cla_in[i]); 424 } 425 426 router_cmd->p_out[4] (signal_dspin_cmd_g2l_d); 427 router_cmd->p_in[4] (signal_dspin_cmd_l2g_d); 428 429 router_rsp->p_out[4] (signal_dspin_rsp_g2l_d); 430 router_rsp->p_in[4] (signal_dspin_rsp_l2g_d); 431 432 router_m2p->p_out[4] (signal_dspin_m2p_g2l_c); 433 router_m2p->p_in[4] (signal_dspin_m2p_l2g_c); 434 435 router_p2m->p_out[4] (signal_dspin_p2m_g2l_c); 436 router_p2m->p_in[4] (signal_dspin_p2m_l2g_c); 437 438 router_cla->p_out[4] (signal_dspin_clack_g2l_c); 439 router_cla->p_in[4] (signal_dspin_clack_l2g_c); 440 441 std::cout << " - routers connected" << std::endl; 387 442 388 443 wi_xbar_d->p_clk (this->p_clk); … … 633 688 vci_param_ext>::~TsarXbarCluster() { 634 689 635 dealloc_elems<DspinInput<dspin_cmd_width> > (p_cmd_in, 4, 3); 636 dealloc_elems<DspinOutput<dspin_cmd_width> >(p_cmd_out, 4, 3); 637 dealloc_elems<DspinInput<dspin_rsp_width> > (p_rsp_in, 4, 2); 638 dealloc_elems<DspinOutput<dspin_rsp_width> >(p_rsp_out, 4, 2); 690 dealloc_elems<DspinInput<dspin_cmd_width> > (p_cmd_in, 4); 691 dealloc_elems<DspinOutput<dspin_cmd_width> >(p_cmd_out, 4); 692 693 dealloc_elems<DspinInput<dspin_rsp_width> > (p_rsp_in, 4); 694 dealloc_elems<DspinOutput<dspin_rsp_width> >(p_rsp_out, 4); 695 696 dealloc_elems<DspinInput<dspin_cmd_width> > (p_m2p_in, 4); 697 dealloc_elems<DspinOutput<dspin_cmd_width> >(p_m2p_out, 4); 698 699 dealloc_elems<DspinInput<dspin_rsp_width> > (p_p2m_in, 4); 700 dealloc_elems<DspinOutput<dspin_rsp_width> >(p_p2m_out, 4); 701 702 dealloc_elems<DspinInput<dspin_cmd_width> > (p_cla_in, 4); 703 dealloc_elems<DspinOutput<dspin_cmd_width> >(p_cla_out, 4); 639 704 640 705 for (size_t p = 0; p < n_procs; p++) … … 701 766 702 767 } 703 704 705 706 768 707 769 }}
Note: See TracChangeset
for help on using the changeset viewer.