Changeset 628 for trunk/platforms/tsar_generic_leti
- Timestamp:
- Feb 12, 2014, 9:43:49 AM (11 years ago)
- Location:
- trunk/platforms/tsar_generic_leti
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_leti/Makefile
r621 r628 4 4 clean: 5 5 soclib-cc -x -p top.desc -I. 6 rm -rf *.o *.x term* 6 rm -rf *.o *.x term* tty* ext* temp -
trunk/platforms/tsar_generic_leti/top.cpp
r621 r628 3 3 // Author: Alain Greiner 4 4 // Copyright: UPMC/LIP6 5 // Date : may 20135 // Date : february 2014 6 6 // This program is released under the GNU public license 7 7 ///////////////////////////////////////////////////////////////////////// … … 13 13 // to be 0xBFC00000 and 0x80000000. 14 14 // 15 // It does not use an external ROM, as the boot code is stored15 // It does not use an external ROM, as the boot code must be (pre)loaded 16 16 // in cluster (0,0) memory. 17 17 // … … 19 19 // The 8 address MSB bits define the cluster index. 20 20 // 21 // The main hardware parameters are the mesh size (X_SIZE / Y_SIZE), 22 // and the number of ptocessors per cluster (NB_PROCS_MAX). 21 23 // The number of clusters cannot be larger than 256. 22 24 // The number of processors per cluster cannot be larger than 4. 23 25 // 24 // - It uses four dspin_local_crossbar per cluster as local interconnect25 // - It uses two virtual_dspin routers per cluster as global interconnect26 // - It uses the vci_cc_vcache_wrapper27 // - It uses the vci_mem_cache28 // - It contains one vci_xicu per cluster.29 // - It contains one vci_multi_dma per cluster.30 // - It contains one vci_simple_ram per cluster to model the L3 cache.26 // Each cluster contains: 27 // - 5 dspin_local_crossbar (local interconnect) 28 // - 5 dspin_router (global interconnect) 29 // - up to 4 vci_cc_vcache wrapping a MIPS32 processor 30 // - 1 vci_mem_cache 31 // - 1 vci_xicu 32 // - 1 vci_simple_ram (to model the L3 cache). 31 33 // 32 // The communication between the MemCache and the Xram is 64 bits. 34 // Each processor receive 4 consecutive IRQ lines from the local XICU. 35 // In all clusters, the MEMC IRQ line (signaling a late write error) 36 // is connected to XICU HWI[8] 33 37 // 34 // All clusters are identical, but the cluster 0 (called io_cluster), 35 // contains 6 extra components: 36 // - the disk controller (BDEV) 37 // - the multi-channel network controller (MNIC) 38 // - the multi-channel chained buffer dma controller (CDMA) 39 // - the multi-channel tty controller (MTTY) 40 // - the frame buffer controller (FBUF) 38 // The cluster 0 contains two more peripherals: 39 // - one block device controller, whose IRQ is connected to XICU HWI[9]. 40 // - one single channel TTY controller, whose IRQ is connected to XICU HWI[10]. 41 41 // 42 // It is build with one single component implementing acluster,43 // defined in files tsar_leti_cluster.* (with * = cpp, h, sd)42 // The cluster internal architecture is defined in file tsar_leti_cluster, 43 // that must be considered as an extension of this top.cpp file. 44 44 // 45 // The IRQs are connected to XICUs as follow: 46 // - The BDEV IRQ is connected to IRQ_IN[0] in I/O cluster. 47 // - The IRQ_IN[1] to IRQ_IN[7] ports are not used in all clusters. 48 // - The DMA IRQs are connected to IRQ_IN[8:11] in all clusters. 49 // - The MEMC IRQ is connected to IRQ_IN[12] in all clusters. 50 // - The TTY IRQs are connected to IRQ_IN[16:31] in I/O cluster. 51 // 52 // Some hardware parameters are used when compiling the OS, and are used 53 // by this top.cpp file. They must be defined in the hard_config.h file : 45 // Besides the hardware components contained in clusters, external peripherals 46 // are connected to an external IO bus (implemented as a vci_local_crossbar): 47 // - one disk controller 48 // - one multi-channel ethernet controller 49 // - one multi-channel chained buffer dma controller 50 // - one multi-channel tty controller 51 // - one frame buffer controller 52 // - one 16 channels iopic controller 53 // 54 // This IOBUS is connected to the north port of the DIR_CMD 55 // and DIR_RSP routers, in cluster(X_SIZE-1, Y_SIZE-1). 56 // For all external peripherals, the hardware interrupts (HWI) are 57 // translated to software interrupts (SWI) by the iopic component: 58 // - IRQ_MNIC_RX[1:0] connected to IOPIC HWI[1:0] 59 // - IRQ_MNIC_TX[1:0] connected to IOPIC HWI[3:2] 60 // - IRQ_CDMA[3:0] connected to IOPIC HWI[7:4] 61 // - IRQ_BDEV connected to IOPIC HWI[9] 62 // - IRQ_MTTY[3:0] connected to IOPIC HWI[15:12] 63 //////////////////////////////////////////////////////////////////////////// 64 // The following parameters must be defined in the hard_config.h file : 54 65 // - X_WIDTH : number of bits for x coordinate (must be 4) 55 66 // - Y_WIDTH : number of bits for y coordinate (must be 4) 56 67 // - X_SIZE : number of clusters in a row 57 68 // - Y_SIZE : number of clusters in a column 58 // - NB_PROCS_MAX : number of processors per cluster (power of 2) 59 // - NB_DMA_CHANNELS : number of DMA channels per cluster (< 9) 60 // - NB_TTY_CHANNELS : number of TTY channels in I/O cluster (< 17) 61 // - NB_NIC_CHANNELS : number of NIC channels in I/O cluster (< 9) 69 // - NB_PROCS_MAX : number of processors per cluster (1, 2 or 4) 70 // - NB_CMA_CHANNELS : number of CMA channels in I/0 cluster (8 max) 71 // - NB_TTY_CHANNELS : number of TTY channels in I/O cluster (16 max) 72 // - NB_NIC_CHANNELS : number of NIC channels in I/O cluster (2 max) 73 // - USE_EXT_IO : use external peripherals if non zero 62 74 // 63 75 // Some other hardware parameters are not used when compiling the OS, 64 // and can be directly defined in this top.cpp file:76 // and are only defined in this top.cpp file: 65 77 // - XRAM_LATENCY : external ram latency 66 78 // - MEMC_WAYS : L2 cache number of ways 67 79 // - MEMC_SETS : L2 cache number of sets 68 // - L1_IWAYS 69 // - L1_ISETS 70 // - L1_DWAYS 71 // - L1_DSETS 80 // - L1_IWAYS : L1 cache instruction number of ways 81 // - L1_ISETS : L1 cache instruction number of sets 82 // - L1_DWAYS : L1 cache data number of ways 83 // - L1_DSETS : L1 cache data number of sets 72 84 // - FBUF_X_SIZE : width of frame buffer (pixels) 73 85 // - FBUF_Y_SIZE : heigth of frame buffer (lines) 74 // - BDEV_SECTOR_SIZE : block size for block drvice75 86 // - BDEV_IMAGE_NAME : file pathname for block device 76 87 // - NIC_RX_NAME : file pathname for NIC received packets 77 88 // - NIC_TX_NAME : file pathname for NIC transmited packets 78 // - NIC_TIMEOUT : max number of cycles before closing a container 89 // - NIC_MAC4 : MAC address 90 // - NIC_MAC2 : MAC address 79 91 ///////////////////////////////////////////////////////////////////////// 80 92 // General policy for 40 bits physical address decoding: … … 103 115 #include "mapping_table.h" 104 116 #include "tsar_leti_cluster.h" 117 #include "vci_local_crossbar.h" 118 #include "vci_dspin_initiator_wrapper.h" 119 #include "vci_dspin_target_wrapper.h" 120 #include "vci_multi_tty.h" 121 #include "vci_multi_nic.h" 122 #include "vci_chbuf_dma.h" 123 #include "vci_block_device_tsar.h" 124 #include "vci_framebuffer.h" 125 #include "vci_iopic.h" 105 126 #include "alloc_elems.h" 106 127 … … 150 171 #define vci_cell_width_int 4 151 172 #define vci_cell_width_ext 8 152 153 #if USE_ALMOS154 #define vci_address_width 32155 #endif156 157 #if (USE_GIET_VM or USE_GIET_TSAR)158 173 #define vci_address_width 40 159 #endif160 161 174 #define vci_plen_width 8 162 175 #define vci_rerror_width 1 … … 177 190 178 191 #if USE_GIET_TSAR 179 #include "../../softs/soft_ hello_giet/hard_config.h"192 #include "../../softs/soft_transpose_giet/hard_config.h" 180 193 #endif 181 182 194 183 195 //////////////////////////////////////////////////////////// … … 201 213 #define FBUF_Y_SIZE 128 202 214 203 #define BDEV_ SECTOR_SIZE 512204 #define BDEV_IMAGE_NAME "../../softs/soft_hello_giet/fake" 205 206 #define NIC_ TIMEOUT 10000215 #define BDEV_IMAGE_NAME "../../softs/soft_transpose_giet/images.raw" 216 217 #define NIC_MAC4 0XBABEF00D 218 #define NIC_MAC2 0xBEEF 207 219 #define NIC_RX_NAME "../../softs/soft_hello_giet/fake" 208 220 #define NIC_TX_NAME "../../softs/soft_hello_giet/fake" … … 222 234 223 235 #if USE_GIET_TSAR 224 #define loader_args "../../softs/soft_ hello_giet/bin.soft"236 #define loader_args "../../softs/soft_transpose_giet/bin.soft" 225 237 #endif 226 238 … … 229 241 //////////////////////i///////////////////////////////////// 230 242 231 #define MAX_FROZEN_CYCLES 10000 00243 #define MAX_FROZEN_CYCLES 10000 232 244 233 245 //////////////////////////////////////////////////////////////////// 234 // TGTID definition in direct space246 // LOCAL TGTID & SRCID definition 235 247 // For all components: global TGTID = global SRCID = cluster_index 236 248 //////////////////////////////////////////////////////////////////// … … 238 250 #define MEMC_TGTID 0 239 251 #define XICU_TGTID 1 240 #define M DMA_TGTID 2241 #define MTTY_TGTID 3252 #define MTTY_TGTID 2 253 #define BDEV_TGTID 3 242 254 #define FBUF_TGTID 4 243 #define BDEV_TGTID 5 244 #define MNIC_TGTID 6 245 #define CDMA_TGTID 7 246 #define SIMH_TGTID 8 247 248 /////////////////////////////////////////////////////////////// 255 #define MNIC_TGTID 5 256 #define CDMA_TGTID 6 257 #define IOPI_TGTID 7 258 259 #define BDEV_SRCID NB_PROCS_MAX 260 #define CDMA_SRCID NB_PROCS_MAX + 1 261 #define IOPI_SRCID NB_PROCS_MAX + 2 262 263 ///////////////////////////////////////////////////////////////////// 249 264 // Physical segments definition 250 /////////////////////////////////////////////////////////////// 251 // There is 4 segments replicated in all clusters, 252 // and 5 specific segments in cluster 0 (IO cluster) 253 // The following values are for segments in cluster 0. 254 // These 32 bits values must be concatenate with the cluster 265 ///////////////////////////////////////////////////////////////////// 266 // - 3 segments are replicated in all clusters 267 // - 2 segments are replicated in cluster[0,0] & [X_SIZE-1,Y_SIZE-1] 268 // - 4 segments are only in cluster [X_SIZE-1,Y_SIZE] 269 // The following values are for segments in cluster 0, 270 // and these 32 bits values must be concatenate with the cluster 255 271 // index (on 8 bits) to obtain the 40 bits address. 256 /////////////////////////////////////////////////////////////// 257 258 // non replicated segments / only in cluster(0,0) 272 ///////////////////////////////////////////////////////////////////// 273 274 // in cluster [0,0] & [X_SIZE-1,Y_SIZE] 275 276 #define MTTY_BASE 0xF4000000 277 #define MTTY_SIZE 0x00001000 // 4 Kbytes 278 279 #define BDEV_BASE 0xF2000000 280 #define BDEV_SIZE 0x00001000 // 4 Kbytes 281 282 // in cluster [X_SIZE-1,Y_SIZE] 259 283 260 284 #define FBUF_BASE 0xF3000000 261 285 #define FBUF_SIZE (FBUF_X_SIZE * FBUF_Y_SIZE * 2) 262 286 263 #define BDEV_BASE 0xF4000000 264 #define BDEV_SIZE 0x00001000 // 4 Kbytes 265 266 #define MTTY_BASE 0xF2000000 267 #define MTTY_SIZE 0x00001000 // 4 Kbytes 268 269 #define MNIC_BASE 0xF5000000 287 #define MNIC_BASE 0xF7000000 270 288 #define MNIC_SIZE 0x00800000 // 512 Kbytes (for 8 channels) 271 289 272 #define CDMA_BASE 0xF 6000000290 #define CDMA_BASE 0xF8000000 273 291 #define CDMA_SIZE 0x00004000 * NB_CMA_CHANNELS 274 292 293 #define IOPI_BASE 0xF9000000 294 #define IOPI_SIZE 0x00001000 // 4 Kbytes 295 275 296 // replicated segments : address is extended to 40 bits by cluster_xy 276 297 … … 278 299 #define MEMC_SIZE 0x01000000 // 16 Mbytes per cluster 279 300 301 #define MCFG_BASE 0xE0000000 302 #define MCFG_SIZE 0x00001000 // 4 Kbytes per cluster 303 280 304 #define XICU_BASE 0xF0000000 281 #define XICU_SIZE 0x00001000 // 4 Kbytes 282 283 #define MDMA_BASE 0xF1000000 284 #define MDMA_SIZE 0x00001000 * NB_DMA_CHANNELS // 4 Kbytes per channel 285 286 #define SIMH_BASE 0xFF000000 287 #define SIMH_SIZE 0x00001000 // 4 Kbytes 305 #define XICU_SIZE 0x00001000 // 4 Kbytes per cluster 288 306 289 307 bool stop_called = false; … … 296 314 using namespace soclib::common; 297 315 298 uint64_t ncycles = 0xFFFFFFFFFFFFFFFF; // simulated cycles 299 char disk_name[256] = BDEV_IMAGE_NAME; // pathname to the disk image 300 char nic_rx_name[256] = NIC_RX_NAME; // pathname to the rx packets file 301 char nic_tx_name[256] = NIC_TX_NAME; // pathname to the tx packets file 302 size_t threads_nr = 1; // simulator's threads number 316 uint32_t ncycles = 0xFFFFFFFF; // max simulated cycles 317 size_t threads = 1; // simulator's threads number 303 318 bool trace_ok = false; // trace activated 304 319 uint32_t trace_from = 0; // trace start cycle … … 319 334 { 320 335 ncycles = (uint64_t) strtol(argv[n + 1], NULL, 0); 321 }322 else if ((strcmp(argv[n],"-DISK") == 0) && (n + 1 < argc))323 {324 strcpy(disk_name, argv[n + 1]);325 336 } 326 337 else if ((strcmp(argv[n],"-DEBUG") == 0) && (n + 1 < argc)) … … 352 363 else if ((strcmp(argv[n], "-THREADS") == 0) && ((n + 1) < argc)) 353 364 { 354 threads _nr = (ssize_t) strtol(argv[n + 1], NULL, 0);355 threads _nr = (threads_nr < 1) ? 1 : threads_nr;365 threads = (size_t) strtol(argv[n + 1], NULL, 0); 366 threads = (threads < 1) ? 1 : threads; 356 367 } 357 368 else if ((strcmp(argv[n], "-FROZEN") == 0) && (n + 1 < argc)) … … 364 375 std::cout << " The order is not important." << std::endl; 365 376 std::cout << " Accepted arguments are :" << std::endl << std::endl; 366 std::cout << " -DISK pathname_for_disk_image" << std::endl;367 377 std::cout << " -NCYCLES number_of_simulated_cycles" << std::endl; 368 378 std::cout << " -DEBUG debug_start_cycle" << std::endl; … … 385 395 386 396 assert( (NB_PROCS_MAX <= 8) and 387 "The NB_PROCS_MAX parameter cannot be larger than 8" );388 389 assert( (NB_ DMA_CHANNELS < 9) and390 "The NB_ DMA_CHANNELS parameter cannot be larger than 8" );391 392 assert( (NB_TTY_CHANNELS <= 16) and393 "The NB_TTY_CHANNELS parameter cannot be larger than 16" );394 395 assert( (NB_NIC_CHANNELS < 9) and396 "The NB_NIC_CHANNELS parameter cannot be larger than 8" );397 "The NB_PROCS_MAX parameter cannot be larger than 4" ); 398 399 assert( (NB_CMA_CHANNELS <= 4) and 400 "The NB_CMA_CHANNELS parameter cannot be larger than 4" ); 401 402 assert( (NB_TTY_CHANNELS <= 4) and 403 "The NB_TTY_CHANNELS parameter cannot be larger than 4" ); 404 405 assert( (NB_NIC_CHANNELS <= 2) and 406 "The NB_NIC_CHANNELS parameter cannot be larger than 2" ); 397 407 398 408 assert( (vci_address_width == 40) and … … 416 426 std::cout << " - MAX_CYCLES = " << ncycles << std::endl; 417 427 std::cout << " - RESET_ADDRESS = " << RESET_ADDRESS << std::endl; 428 std::cout << " - SOFT_FILENAME = " << loader_args << std::endl; 418 429 419 430 std::cout << std::endl; … … 444 455 #if USE_OPENMP 445 456 omp_set_dynamic(false); 446 omp_set_num_threads(threads _nr);457 omp_set_num_threads(threads); 447 458 std::cerr << "Built with openmp version " << _OPENMP << std::endl; 448 459 #endif 449 460 450 461 451 ///////////////////// 452 // Mapping Tables 453 ///////////////////// 454 455 // internal network 462 /////////////////////////////////////// 463 // Direct Network Mapping Table 464 /////////////////////////////////////// 465 456 466 MappingTable maptabd(vci_address_width, 457 467 IntTab(X_WIDTH + Y_WIDTH, 16 - X_WIDTH - Y_WIDTH), 458 468 IntTab(X_WIDTH + Y_WIDTH, vci_srcid_width - X_WIDTH - Y_WIDTH), 459 0xFF800000); 460 469 0x00FF000000ULL); 470 471 // replicated segments 461 472 for (size_t x = 0; x < X_SIZE; x++) 462 473 { … … 464 475 { 465 476 sc_uint<vci_address_width> offset; 466 offset = (sc_uint<vci_address_width>)cluster(x,y) 467 << (vci_address_width-X_WIDTH-Y_WIDTH); 477 offset = ((sc_uint<vci_address_width>)cluster(x,y)) << 32; 468 478 469 479 std::ostringstream si; … … 473 483 474 484 std::ostringstream sd; 475 sd << "seg_m dma_" << x << "_" << y;476 maptabd.add(Segment(sd.str(), M DMA_BASE + offset, MDMA_SIZE,477 IntTab(cluster(x,y),M DMA_TGTID), false));485 sd << "seg_mcfg_" << x << "_" << y; 486 maptabd.add(Segment(sd.str(), MCFG_BASE + offset, MCFG_SIZE, 487 IntTab(cluster(x,y),MEMC_TGTID), false)); 478 488 479 489 std::ostringstream sh; … … 481 491 maptabd.add(Segment(sh.str(), MEMC_BASE + offset, MEMC_SIZE, 482 492 IntTab(cluster(x,y),MEMC_TGTID), true)); 483 484 if ( cluster(x,y) == 0 )485 {486 maptabd.add(Segment("seg_mtty", MTTY_BASE, MTTY_SIZE,487 IntTab(cluster(x,y),MTTY_TGTID), false));488 maptabd.add(Segment("seg_fbuf", FBUF_BASE, FBUF_SIZE,489 IntTab(cluster(x,y),FBUF_TGTID), false));490 maptabd.add(Segment("seg_bdev", BDEV_BASE, BDEV_SIZE,491 IntTab(cluster(x,y),BDEV_TGTID), false));492 maptabd.add(Segment("seg_mnic", MNIC_BASE, MNIC_SIZE,493 IntTab(cluster(x,y),MNIC_TGTID), false));494 maptabd.add(Segment("seg_cdma", CDMA_BASE, CDMA_SIZE,495 IntTab(cluster(x,y),CDMA_TGTID), false));496 maptabd.add(Segment("seg_simh", SIMH_BASE, SIMH_SIZE,497 IntTab(cluster(x,y),SIMH_TGTID), false));498 }499 493 } 500 494 } 495 496 // segments in cluster(0,0) 497 maptabd.add(Segment("seg_tty0", MTTY_BASE, MTTY_SIZE, 498 IntTab(cluster(0,0),MTTY_TGTID), false)); 499 500 maptabd.add(Segment("seg_ioc0", BDEV_BASE, BDEV_SIZE, 501 IntTab(cluster(0,0),BDEV_TGTID), false)); 502 503 // segments in cluster_io (X_SIZE-1,Y_SIZE) 504 sc_uint<vci_address_width> offset; 505 offset = ((sc_uint<vci_address_width>)cluster(X_SIZE-1,Y_SIZE)) << 32; 506 507 maptabd.add(Segment("seg_mtty", MTTY_BASE + offset, MTTY_SIZE, 508 IntTab(cluster(X_SIZE-1, Y_SIZE),MTTY_TGTID), false)); 509 510 maptabd.add(Segment("seg_fbuf", FBUF_BASE + offset, FBUF_SIZE, 511 IntTab(cluster(X_SIZE-1, Y_SIZE),FBUF_TGTID), false)); 512 513 maptabd.add(Segment("seg_bdev", BDEV_BASE + offset, BDEV_SIZE, 514 IntTab(cluster(X_SIZE-1, Y_SIZE),BDEV_TGTID), false)); 515 516 maptabd.add(Segment("seg_mnic", MNIC_BASE + offset, MNIC_SIZE, 517 IntTab(cluster(X_SIZE-1, Y_SIZE),MNIC_TGTID), false)); 518 519 maptabd.add(Segment("seg_cdma", CDMA_BASE + offset, CDMA_SIZE, 520 IntTab(cluster(X_SIZE-1, Y_SIZE),CDMA_TGTID), false)); 521 522 maptabd.add(Segment("seg_iopi", IOPI_BASE + offset, IOPI_SIZE, 523 IntTab(cluster(X_SIZE-1, Y_SIZE),IOPI_TGTID), false)); 524 501 525 std::cout << maptabd << std::endl; 502 526 503 // external network 504 MappingTable maptabx(vci_address_width, 505 IntTab(X_WIDTH+Y_WIDTH), 506 IntTab(X_WIDTH+Y_WIDTH), 507 0xFFFF000000ULL); 508 509 for (size_t x = 0; x < X_SIZE; x++) 510 { 511 for (size_t y = 0; y < Y_SIZE ; y++) 512 { 513 514 sc_uint<vci_address_width> offset; 515 offset = (sc_uint<vci_address_width>)cluster(x,y) 516 << (vci_address_width-X_WIDTH-Y_WIDTH); 517 518 std::ostringstream sh; 519 sh << "x_seg_memc_" << x << "_" << y; 520 521 maptabx.add(Segment(sh.str(), MEMC_BASE + offset, 527 ///////////////////////////////////////////////// 528 // Ram network mapping table 529 ///////////////////////////////////////////////// 530 531 MappingTable maptabx(vci_address_width, 532 IntTab(X_WIDTH+Y_WIDTH), 533 IntTab(X_WIDTH+Y_WIDTH), 534 0x00FF000000ULL); 535 536 for (size_t x = 0; x < X_SIZE; x++) 537 { 538 for (size_t y = 0; y < Y_SIZE ; y++) 539 { 540 sc_uint<vci_address_width> offset; 541 offset = (sc_uint<vci_address_width>)cluster(x,y) 542 << (vci_address_width-X_WIDTH-Y_WIDTH); 543 544 std::ostringstream sh; 545 sh << "x_seg_memc_" << x << "_" << y; 546 547 maptabx.add(Segment(sh.str(), MEMC_BASE + offset, 522 548 MEMC_SIZE, IntTab(cluster(x,y)), false)); 523 } 524 } 525 std::cout << maptabx << std::endl; 526 527 //////////////////// 528 // Signals 529 /////////////////// 530 531 sc_clock signal_clk("clk"); 532 sc_signal<bool> signal_resetn("resetn"); 549 } 550 } 551 std::cout << maptabx << std::endl; 552 553 //////////////////// 554 // Signals 555 /////////////////// 556 557 sc_clock signal_clk("clk"); 558 sc_signal<bool> signal_resetn("resetn"); 559 560 // IRQs from external peripherals 561 sc_signal<bool> signal_irq_bdev; 562 sc_signal<bool> signal_irq_mnic_rx[NB_NIC_CHANNELS]; 563 sc_signal<bool> signal_irq_mnic_tx[NB_NIC_CHANNELS]; 564 sc_signal<bool> signal_irq_mtty[NB_TTY_CHANNELS]; 565 sc_signal<bool> signal_irq_cdma[NB_CMA_CHANNELS]; 566 sc_signal<bool> signal_irq_false; 533 567 534 568 // Horizontal inter-clusters DSPIN signals 535 DspinSignals<dspin_cmd_width>*** signal_dspin_h_cmd_inc = 536 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_inc", X_SIZE-1, Y_SIZE, 3); 537 DspinSignals<dspin_cmd_width>*** signal_dspin_h_cmd_dec = 538 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_dec", X_SIZE-1, Y_SIZE, 3); 539 DspinSignals<dspin_rsp_width>*** signal_dspin_h_rsp_inc = 540 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_inc", X_SIZE-1, Y_SIZE, 2); 541 DspinSignals<dspin_rsp_width>*** signal_dspin_h_rsp_dec = 542 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_dec", X_SIZE-1, Y_SIZE, 2); 569 DspinSignals<dspin_cmd_width>** signal_dspin_h_cmd_inc = 570 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_inc", X_SIZE-1, Y_SIZE); 571 DspinSignals<dspin_cmd_width>** signal_dspin_h_cmd_dec = 572 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_dec", X_SIZE-1, Y_SIZE); 573 574 DspinSignals<dspin_rsp_width>** signal_dspin_h_rsp_inc = 575 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_inc", X_SIZE-1, Y_SIZE); 576 DspinSignals<dspin_rsp_width>** signal_dspin_h_rsp_dec = 577 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_dec", X_SIZE-1, Y_SIZE); 578 579 DspinSignals<dspin_cmd_width>** signal_dspin_h_m2p_inc = 580 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_inc", X_SIZE-1, Y_SIZE); 581 DspinSignals<dspin_cmd_width>** signal_dspin_h_m2p_dec = 582 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_m2p_dec", X_SIZE-1, Y_SIZE); 583 584 DspinSignals<dspin_rsp_width>** signal_dspin_h_p2m_inc = 585 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_inc", X_SIZE-1, Y_SIZE); 586 DspinSignals<dspin_rsp_width>** signal_dspin_h_p2m_dec = 587 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_p2m_dec", X_SIZE-1, Y_SIZE); 588 589 DspinSignals<dspin_cmd_width>** signal_dspin_h_cla_inc = 590 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_inc", X_SIZE-1, Y_SIZE); 591 DspinSignals<dspin_cmd_width>** signal_dspin_h_cla_dec = 592 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cla_dec", X_SIZE-1, Y_SIZE); 543 593 544 594 // Vertical inter-clusters DSPIN signals 545 DspinSignals<dspin_cmd_width>*** signal_dspin_v_cmd_inc = 546 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_inc", X_SIZE, Y_SIZE-1, 3); 547 DspinSignals<dspin_cmd_width>*** signal_dspin_v_cmd_dec = 548 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_dec", X_SIZE, Y_SIZE-1, 3); 549 DspinSignals<dspin_rsp_width>*** signal_dspin_v_rsp_inc = 550 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_inc", X_SIZE, Y_SIZE-1, 2); 551 DspinSignals<dspin_rsp_width>*** signal_dspin_v_rsp_dec = 552 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_dec", X_SIZE, Y_SIZE-1, 2); 553 554 // Mesh boundaries DSPIN signals 555 DspinSignals<dspin_cmd_width>**** signal_dspin_false_cmd_in = 556 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_in" , X_SIZE, Y_SIZE, 4, 3); 557 DspinSignals<dspin_cmd_width>**** signal_dspin_false_cmd_out = 558 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_out", X_SIZE, Y_SIZE, 4, 3); 559 DspinSignals<dspin_rsp_width>**** signal_dspin_false_rsp_in = 560 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_in" , X_SIZE, Y_SIZE, 4, 2); 561 DspinSignals<dspin_rsp_width>**** signal_dspin_false_rsp_out = 562 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_out", X_SIZE, Y_SIZE, 4, 2); 563 564 595 DspinSignals<dspin_cmd_width>** signal_dspin_v_cmd_inc = 596 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_inc", X_SIZE, Y_SIZE-1); 597 DspinSignals<dspin_cmd_width>** signal_dspin_v_cmd_dec = 598 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_dec", X_SIZE, Y_SIZE-1); 599 600 DspinSignals<dspin_rsp_width>** signal_dspin_v_rsp_inc = 601 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_inc", X_SIZE, Y_SIZE-1); 602 DspinSignals<dspin_rsp_width>** signal_dspin_v_rsp_dec = 603 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_dec", X_SIZE, Y_SIZE-1); 604 605 DspinSignals<dspin_cmd_width>** signal_dspin_v_m2p_inc = 606 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_inc", X_SIZE, Y_SIZE-1); 607 DspinSignals<dspin_cmd_width>** signal_dspin_v_m2p_dec = 608 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_m2p_dec", X_SIZE, Y_SIZE-1); 609 610 DspinSignals<dspin_rsp_width>** signal_dspin_v_p2m_inc = 611 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_inc", X_SIZE, Y_SIZE-1); 612 DspinSignals<dspin_rsp_width>** signal_dspin_v_p2m_dec = 613 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_p2m_dec", X_SIZE, Y_SIZE-1); 614 615 DspinSignals<dspin_cmd_width>** signal_dspin_v_cla_inc = 616 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_inc", X_SIZE, Y_SIZE-1); 617 DspinSignals<dspin_cmd_width>** signal_dspin_v_cla_dec = 618 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cla_dec", X_SIZE, Y_SIZE-1); 619 620 // Mesh boundaries DSPIN signals (Most of those signals are not used...) 621 DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cmd_in = 622 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cmd_in" , X_SIZE, Y_SIZE, 4); 623 DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cmd_out = 624 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cmd_out", X_SIZE, Y_SIZE, 4); 625 626 DspinSignals<dspin_rsp_width>*** signal_dspin_bound_rsp_in = 627 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_rsp_in" , X_SIZE, Y_SIZE, 4); 628 DspinSignals<dspin_rsp_width>*** signal_dspin_bound_rsp_out = 629 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_rsp_out", X_SIZE, Y_SIZE, 4); 630 631 DspinSignals<dspin_cmd_width>*** signal_dspin_bound_m2p_in = 632 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_m2p_in" , X_SIZE, Y_SIZE, 4); 633 DspinSignals<dspin_cmd_width>*** signal_dspin_bound_m2p_out = 634 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_m2p_out", X_SIZE, Y_SIZE, 4); 635 636 DspinSignals<dspin_rsp_width>*** signal_dspin_bound_p2m_in = 637 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_p2m_in" , X_SIZE, Y_SIZE, 4); 638 DspinSignals<dspin_rsp_width>*** signal_dspin_bound_p2m_out = 639 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_bound_p2m_out", X_SIZE, Y_SIZE, 4); 640 641 DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cla_in = 642 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cla_in" , X_SIZE, Y_SIZE, 4); 643 DspinSignals<dspin_cmd_width>*** signal_dspin_bound_cla_out = 644 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_bound_cla_out", X_SIZE, Y_SIZE, 4); 645 646 // VCI signals for iobus and peripherals 647 VciSignals<vci_param_int> signal_vci_ini_bdev("signal_vci_ini_bdev"); 648 VciSignals<vci_param_int> signal_vci_ini_cdma("signal_vci_ini_cdma"); 649 VciSignals<vci_param_int> signal_vci_ini_iopi("signal_vci_ini_iopi"); 650 651 VciSignals<vci_param_int>* signal_vci_ini_proc = 652 alloc_elems<VciSignals<vci_param_int> >("signal_vci_ini_proc", NB_PROCS_MAX ); 653 654 VciSignals<vci_param_int> signal_vci_tgt_memc("signal_vci_tgt_memc"); 655 VciSignals<vci_param_int> signal_vci_tgt_xicu("signal_vci_tgt_xicu"); 656 VciSignals<vci_param_int> signal_vci_tgt_bdev("signal_vci_tgt_bdev"); 657 VciSignals<vci_param_int> signal_vci_tgt_mtty("signal_vci_tgt_mtty"); 658 VciSignals<vci_param_int> signal_vci_tgt_fbuf("signal_vci_tgt_fbuf"); 659 VciSignals<vci_param_int> signal_vci_tgt_mnic("signal_vci_tgt_mnic"); 660 VciSignals<vci_param_int> signal_vci_tgt_cdma("signal_vci_tgt_cdma"); 661 VciSignals<vci_param_int> signal_vci_tgt_iopi("signal_vci_tgt_iopi"); 662 663 VciSignals<vci_param_int> signal_vci_cmd_to_noc("signal_vci_cmd_to_noc"); 664 VciSignals<vci_param_int> signal_vci_cmd_from_noc("signal_vci_cmd_from_noc"); 665 565 666 //////////////////////////// 566 667 // Loader … … 596 697 #endif 597 698 std::cout << std::endl; 598 std::cout << "Cluster_" << x << "_" << y599 << " with cluster_xy = " << cluster(x,y) << std::endl;699 std::cout << "Cluster_" << std::dec << x << "_" << y 700 << " with cluster_xy = " << std::hex << cluster(x,y) << std::endl; 600 701 std::cout << std::endl; 601 702 602 std::ostringstream sc;603 sc << "cluster_" << x << "_" << y;604 703 clusters[x][y] = new TsarLetiCluster<dspin_cmd_width, 605 704 dspin_rsp_width, … … 607 706 vci_param_ext> 608 707 ( 609 sc.str().c_str(),708 "cluster", 610 709 NB_PROCS_MAX, 611 NB_TTY_CHANNELS,612 NB_DMA_CHANNELS,613 710 x, 614 711 y, … … 622 719 MEMC_TGTID, 623 720 XICU_TGTID, 624 MDMA_TGTID,625 FBUF_TGTID,626 721 MTTY_TGTID, 627 MNIC_TGTID,628 CDMA_TGTID,629 722 BDEV_TGTID, 630 SIMH_TGTID,723 BDEV_IMAGE_NAME, 631 724 MEMC_WAYS, 632 725 MEMC_SETS, … … 636 729 L1_DSETS, 637 730 XRAM_LATENCY, 638 (cluster(x,y) == 0),639 FBUF_X_SIZE,640 FBUF_Y_SIZE,641 disk_name,642 BDEV_SECTOR_SIZE,643 NB_NIC_CHANNELS,644 nic_rx_name,645 nic_tx_name,646 NIC_TIMEOUT,647 NB_CMA_CHANNELS,648 731 loader, 649 732 frozen_cycles, … … 663 746 #endif 664 747 665 /////////////////////////////////////////////////////////////// 666 // Net-list 667 /////////////////////////////////////////////////////////////// 668 669 // Clock & RESET 670 for (size_t x = 0; x < (X_SIZE); x++){ 671 for (size_t y = 0; y < Y_SIZE; y++){ 672 clusters[x][y]->p_clk (signal_clk); 673 clusters[x][y]->p_resetn (signal_resetn); 674 } 675 } 676 677 // Inter Clusters horizontal connections 678 if (X_SIZE > 1){ 679 for (size_t x = 0; x < (X_SIZE-1); x++){ 680 for (size_t y = 0; y < Y_SIZE; y++){ 681 for (size_t k = 0; k < 3; k++){ 682 clusters[x][y]->p_cmd_out[EAST][k] (signal_dspin_h_cmd_inc[x][y][k]); 683 clusters[x+1][y]->p_cmd_in[WEST][k] (signal_dspin_h_cmd_inc[x][y][k]); 684 clusters[x][y]->p_cmd_in[EAST][k] (signal_dspin_h_cmd_dec[x][y][k]); 685 clusters[x+1][y]->p_cmd_out[WEST][k] (signal_dspin_h_cmd_dec[x][y][k]); 748 ////////////////////////////////////////////////////////////////// 749 // IO bus and external peripherals in cluster[X_SIZE-1,Y_SIZE] 750 ////////////////////////////////////////////////////////////////// 751 752 size_t cluster_io = cluster(X_SIZE-1, Y_SIZE); 753 754 //////////// vci_local_crossbar 755 VciLocalCrossbar<vci_param_int>* 756 iobus = new VciLocalCrossbar<vci_param_int>( 757 "iobus", 758 maptabd, // mapping table 759 cluster_io, // cluster_xy 760 NB_PROCS_MAX + 3, // number of local initiators 761 8, // number of local targets 762 BDEV_TGTID ); // default target index 763 764 //////////// vci_framebuffer 765 VciFrameBuffer<vci_param_int>* 766 fbuf = new VciFrameBuffer<vci_param_int>( 767 "fbuf", 768 IntTab(cluster_io, FBUF_TGTID), 769 maptabd, 770 FBUF_X_SIZE, FBUF_Y_SIZE ); 771 772 //////////// vci_block_device 773 VciBlockDeviceTsar<vci_param_int>* 774 bdev = new VciBlockDeviceTsar<vci_param_int>( 775 "bdev", 776 maptabd, 777 IntTab(cluster_io, BDEV_SRCID), 778 IntTab(cluster_io, BDEV_TGTID), 779 BDEV_IMAGE_NAME, 780 512, // block size 781 64 ); // burst size 782 783 //////////// vci_multi_nic 784 VciMultiNic<vci_param_int>* 785 mnic = new VciMultiNic<vci_param_int>( 786 "mnic", 787 IntTab(cluster_io, MNIC_TGTID), 788 maptabd, 789 NB_NIC_CHANNELS, 790 NIC_MAC4, 791 NIC_MAC2, 792 NIC_RX_NAME, 793 NIC_TX_NAME ); 794 795 ///////////// vci_chbuf_dma 796 VciChbufDma<vci_param_int>* 797 cdma = new VciChbufDma<vci_param_int>( 798 "cdma", 799 maptabd, 800 IntTab(cluster_io, CDMA_SRCID), 801 IntTab(cluster_io, CDMA_TGTID), 802 64, // burst size 803 NB_CMA_CHANNELS ); 804 805 ////////////// vci_multi_tty 806 std::vector<std::string> vect_names; 807 for (size_t id = 0; id < NB_TTY_CHANNELS; id++) 808 { 809 std::ostringstream term_name; 810 term_name << "ext_" << id; 811 vect_names.push_back(term_name.str().c_str()); 812 } 813 814 VciMultiTty<vci_param_int>* 815 mtty = new VciMultiTty<vci_param_int>( 816 "mtty", 817 IntTab(cluster_io, MTTY_TGTID), 818 maptabd, 819 vect_names ); 820 821 ///////////// vci_iopic 822 VciIopic<vci_param_int>* 823 iopic = new VciIopic<vci_param_int>( 824 "iopic", 825 maptabd, 826 IntTab(cluster_io, IOPI_SRCID), 827 IntTab(cluster_io, IOPI_TGTID), 828 16 ); 829 830 ////////////// vci_dspin wrappers 831 VciDspinTargetWrapper<vci_param_int, dspin_cmd_width, dspin_rsp_width>* 832 wt_iobus = new VciDspinTargetWrapper<vci_param_int, dspin_cmd_width, dspin_rsp_width>( 833 "wt_bdev", 834 vci_srcid_width ); 835 836 VciDspinInitiatorWrapper<vci_param_int, dspin_cmd_width, dspin_rsp_width>* 837 wi_iobus = new VciDspinInitiatorWrapper<vci_param_int, dspin_cmd_width, dspin_rsp_width>( 838 "wi_bdev", 839 vci_srcid_width ); 840 841 /////////////////////////////////////////////////////////////// 842 // Net-list 843 /////////////////////////////////////////////////////////////// 844 845 // iobus 846 iobus->p_clk (signal_clk); 847 iobus->p_resetn (signal_resetn); 848 849 iobus->p_target_to_up (signal_vci_cmd_from_noc); 850 iobus->p_initiator_to_up (signal_vci_cmd_to_noc); 851 852 iobus->p_to_target[MEMC_TGTID] (signal_vci_tgt_memc); 853 iobus->p_to_target[XICU_TGTID] (signal_vci_tgt_xicu); 854 iobus->p_to_target[MTTY_TGTID] (signal_vci_tgt_mtty); 855 iobus->p_to_target[FBUF_TGTID] (signal_vci_tgt_fbuf); 856 iobus->p_to_target[MNIC_TGTID] (signal_vci_tgt_mnic); 857 iobus->p_to_target[BDEV_TGTID] (signal_vci_tgt_bdev); 858 iobus->p_to_target[CDMA_TGTID] (signal_vci_tgt_cdma); 859 iobus->p_to_target[IOPI_TGTID] (signal_vci_tgt_iopi); 860 861 for( size_t p=0 ; p<NB_PROCS_MAX ; p++ ) 862 { 863 iobus->p_to_initiator[p] (signal_vci_ini_proc[p]); 864 } 865 iobus->p_to_initiator[BDEV_SRCID] (signal_vci_ini_bdev); 866 iobus->p_to_initiator[CDMA_SRCID] (signal_vci_ini_cdma); 867 iobus->p_to_initiator[IOPI_SRCID] (signal_vci_ini_iopi); 868 869 std::cout << " - IOBUS connected" << std::endl; 870 871 // block_device 872 bdev->p_clk (signal_clk); 873 bdev->p_resetn (signal_resetn); 874 bdev->p_vci_target (signal_vci_tgt_bdev); 875 bdev->p_vci_initiator (signal_vci_ini_bdev); 876 bdev->p_irq (signal_irq_bdev); 877 878 std::cout << " - BDEV connected" << std::endl; 879 880 // frame_buffer 881 fbuf->p_clk (signal_clk); 882 fbuf->p_resetn (signal_resetn); 883 fbuf->p_vci (signal_vci_tgt_fbuf); 884 885 std::cout << " - FBUF connected" << std::endl; 886 887 // multi_nic 888 mnic->p_clk (signal_clk); 889 mnic->p_resetn (signal_resetn); 890 mnic->p_vci (signal_vci_tgt_mnic); 891 for ( size_t i=0 ; i<NB_NIC_CHANNELS ; i++ ) 892 { 893 mnic->p_rx_irq[i] (signal_irq_mnic_rx[i]); 894 mnic->p_tx_irq[i] (signal_irq_mnic_tx[i]); 895 } 896 897 std::cout << " - MNIC connected" << std::endl; 898 899 // chbuf_dma 900 cdma->p_clk (signal_clk); 901 cdma->p_resetn (signal_resetn); 902 cdma->p_vci_target (signal_vci_tgt_cdma); 903 cdma->p_vci_initiator (signal_vci_ini_cdma); 904 for ( size_t i=0 ; i<NB_CMA_CHANNELS ; i++) 905 { 906 cdma->p_irq[i] (signal_irq_cdma[i]); 907 } 908 909 std::cout << " - CDMA connected" << std::endl; 910 911 // multi_tty 912 mtty->p_clk (signal_clk); 913 mtty->p_resetn (signal_resetn); 914 mtty->p_vci (signal_vci_tgt_mtty); 915 for ( size_t i=0 ; i<NB_TTY_CHANNELS ; i++ ) 916 { 917 mtty->p_irq[i] (signal_irq_mtty[i]); 918 } 919 920 std::cout << " - MTTY connected" << std::endl; 921 922 // iopic 923 iopic->p_clk (signal_clk); 924 iopic->p_resetn (signal_resetn); 925 iopic->p_vci_target (signal_vci_tgt_iopi); 926 iopic->p_vci_initiator (signal_vci_ini_iopi); 927 for ( size_t i=0 ; i<16 ; i++) 928 { 929 if (i < NB_NIC_CHANNELS) iopic->p_hwi[i] (signal_irq_mnic_rx[i]); 930 else if(i < 2 ) iopic->p_hwi[i] (signal_irq_false); 931 else if(i < 2+NB_NIC_CHANNELS) iopic->p_hwi[i] (signal_irq_mnic_tx[i-2]); 932 else if(i < 4 ) iopic->p_hwi[i] (signal_irq_false); 933 else if(i < 4+NB_CMA_CHANNELS) iopic->p_hwi[i] (signal_irq_cdma[i-4]); 934 else if(i < 9) iopic->p_hwi[i] (signal_irq_false); 935 else if(i == 9) iopic->p_hwi[i] (signal_irq_bdev); 936 else if(i < 12) iopic->p_hwi[i] (signal_irq_false); 937 else if(i < 12+NB_TTY_CHANNELS) iopic->p_hwi[i] (signal_irq_mtty[i-12]); 938 else iopic->p_hwi[i] (signal_irq_false); 939 } 940 941 // vci/dspin wrappers 942 wi_iobus->p_clk (signal_clk); 943 wi_iobus->p_resetn (signal_resetn); 944 wi_iobus->p_vci (signal_vci_cmd_to_noc); 945 wi_iobus->p_dspin_cmd (signal_dspin_bound_cmd_in[X_SIZE-1][Y_SIZE-1][NORTH]); 946 wi_iobus->p_dspin_rsp (signal_dspin_bound_rsp_out[X_SIZE-1][Y_SIZE-1][NORTH]); 947 948 // vci/dspin wrappers 949 wt_iobus->p_clk (signal_clk); 950 wt_iobus->p_resetn (signal_resetn); 951 wt_iobus->p_vci (signal_vci_cmd_from_noc); 952 wt_iobus->p_dspin_cmd (signal_dspin_bound_cmd_out[X_SIZE-1][Y_SIZE-1][NORTH]); 953 wt_iobus->p_dspin_rsp (signal_dspin_bound_rsp_in[X_SIZE-1][Y_SIZE-1][NORTH]); 954 955 // Clock & RESET for clusters 956 for (size_t x = 0; x < (X_SIZE); x++) 957 { 958 for (size_t y = 0; y < Y_SIZE; y++) 959 { 960 clusters[x][y]->p_clk (signal_clk); 961 clusters[x][y]->p_resetn (signal_resetn); 962 } 963 } 964 965 // Inter Clusters horizontal connections 966 if (X_SIZE > 1) 967 { 968 for (size_t x = 0; x < (X_SIZE-1); x++) 969 { 970 for (size_t y = 0; y < Y_SIZE; y++) 971 { 972 clusters[x][y]->p_cmd_out[EAST] (signal_dspin_h_cmd_inc[x][y]); 973 clusters[x+1][y]->p_cmd_in[WEST] (signal_dspin_h_cmd_inc[x][y]); 974 clusters[x][y]->p_cmd_in[EAST] (signal_dspin_h_cmd_dec[x][y]); 975 clusters[x+1][y]->p_cmd_out[WEST] (signal_dspin_h_cmd_dec[x][y]); 976 977 clusters[x][y]->p_rsp_out[EAST] (signal_dspin_h_rsp_inc[x][y]); 978 clusters[x+1][y]->p_rsp_in[WEST] (signal_dspin_h_rsp_inc[x][y]); 979 clusters[x][y]->p_rsp_in[EAST] (signal_dspin_h_rsp_dec[x][y]); 980 clusters[x+1][y]->p_rsp_out[WEST] (signal_dspin_h_rsp_dec[x][y]); 981 982 clusters[x][y]->p_m2p_out[EAST] (signal_dspin_h_m2p_inc[x][y]); 983 clusters[x+1][y]->p_m2p_in[WEST] (signal_dspin_h_m2p_inc[x][y]); 984 clusters[x][y]->p_m2p_in[EAST] (signal_dspin_h_m2p_dec[x][y]); 985 clusters[x+1][y]->p_m2p_out[WEST] (signal_dspin_h_m2p_dec[x][y]); 986 987 clusters[x][y]->p_p2m_out[EAST] (signal_dspin_h_p2m_inc[x][y]); 988 clusters[x+1][y]->p_p2m_in[WEST] (signal_dspin_h_p2m_inc[x][y]); 989 clusters[x][y]->p_p2m_in[EAST] (signal_dspin_h_p2m_dec[x][y]); 990 clusters[x+1][y]->p_p2m_out[WEST] (signal_dspin_h_p2m_dec[x][y]); 991 992 clusters[x][y]->p_cla_out[EAST] (signal_dspin_h_cla_inc[x][y]); 993 clusters[x+1][y]->p_cla_in[WEST] (signal_dspin_h_cla_inc[x][y]); 994 clusters[x][y]->p_cla_in[EAST] (signal_dspin_h_cla_dec[x][y]); 995 clusters[x+1][y]->p_cla_out[WEST] (signal_dspin_h_cla_dec[x][y]); 686 996 } 687 688 for (size_t k = 0; k < 2; k++){ 689 clusters[x][y]->p_rsp_out[EAST][k] (signal_dspin_h_rsp_inc[x][y][k]); 690 clusters[x+1][y]->p_rsp_in[WEST][k] (signal_dspin_h_rsp_inc[x][y][k]); 691 clusters[x][y]->p_rsp_in[EAST][k] (signal_dspin_h_rsp_dec[x][y][k]); 692 clusters[x+1][y]->p_rsp_out[WEST][k] (signal_dspin_h_rsp_dec[x][y][k]); 997 } 998 } 999 std::cout << std::endl << "Horizontal connections done" << std::endl; 1000 1001 // Inter Clusters vertical connections 1002 if (Y_SIZE > 1) 1003 { 1004 for (size_t y = 0; y < (Y_SIZE-1); y++) 1005 { 1006 for (size_t x = 0; x < X_SIZE; x++) 1007 { 1008 clusters[x][y]->p_cmd_out[NORTH] (signal_dspin_v_cmd_inc[x][y]); 1009 clusters[x][y+1]->p_cmd_in[SOUTH] (signal_dspin_v_cmd_inc[x][y]); 1010 clusters[x][y]->p_cmd_in[NORTH] (signal_dspin_v_cmd_dec[x][y]); 1011 clusters[x][y+1]->p_cmd_out[SOUTH] (signal_dspin_v_cmd_dec[x][y]); 1012 1013 clusters[x][y]->p_rsp_out[NORTH] (signal_dspin_v_rsp_inc[x][y]); 1014 clusters[x][y+1]->p_rsp_in[SOUTH] (signal_dspin_v_rsp_inc[x][y]); 1015 clusters[x][y]->p_rsp_in[NORTH] (signal_dspin_v_rsp_dec[x][y]); 1016 clusters[x][y+1]->p_rsp_out[SOUTH] (signal_dspin_v_rsp_dec[x][y]); 1017 1018 clusters[x][y]->p_m2p_out[NORTH] (signal_dspin_v_m2p_inc[x][y]); 1019 clusters[x][y+1]->p_m2p_in[SOUTH] (signal_dspin_v_m2p_inc[x][y]); 1020 clusters[x][y]->p_m2p_in[NORTH] (signal_dspin_v_m2p_dec[x][y]); 1021 clusters[x][y+1]->p_m2p_out[SOUTH] (signal_dspin_v_m2p_dec[x][y]); 1022 1023 clusters[x][y]->p_p2m_out[NORTH] (signal_dspin_v_p2m_inc[x][y]); 1024 clusters[x][y+1]->p_p2m_in[SOUTH] (signal_dspin_v_p2m_inc[x][y]); 1025 clusters[x][y]->p_p2m_in[NORTH] (signal_dspin_v_p2m_dec[x][y]); 1026 clusters[x][y+1]->p_p2m_out[SOUTH] (signal_dspin_v_p2m_dec[x][y]); 1027 1028 clusters[x][y]->p_cla_out[NORTH] (signal_dspin_v_cla_inc[x][y]); 1029 clusters[x][y+1]->p_cla_in[SOUTH] (signal_dspin_v_cla_inc[x][y]); 1030 clusters[x][y]->p_cla_in[NORTH] (signal_dspin_v_cla_dec[x][y]); 1031 clusters[x][y+1]->p_cla_out[SOUTH] (signal_dspin_v_cla_dec[x][y]); 693 1032 } 694 } 695 } 696 } 697 std::cout << std::endl << "Horizontal connections established" << std::endl; 698 699 // Inter Clusters vertical connections 700 if (Y_SIZE > 1) { 701 for (size_t y = 0; y < (Y_SIZE-1); y++){ 702 for (size_t x = 0; x < X_SIZE; x++){ 703 for (size_t k = 0; k < 3; k++){ 704 clusters[x][y]->p_cmd_out[NORTH][k] (signal_dspin_v_cmd_inc[x][y][k]); 705 clusters[x][y+1]->p_cmd_in[SOUTH][k] (signal_dspin_v_cmd_inc[x][y][k]); 706 clusters[x][y]->p_cmd_in[NORTH][k] (signal_dspin_v_cmd_dec[x][y][k]); 707 clusters[x][y+1]->p_cmd_out[SOUTH][k] (signal_dspin_v_cmd_dec[x][y][k]); 1033 } 1034 } 1035 std::cout << std::endl << "Vertical connections done" << std::endl; 1036 1037 // East & West boundary cluster connections 1038 for (size_t y = 0; y < Y_SIZE; y++) 1039 { 1040 clusters[0][y]->p_cmd_in[WEST] (signal_dspin_bound_cmd_in[0][y][WEST]); 1041 clusters[0][y]->p_cmd_out[WEST] (signal_dspin_bound_cmd_out[0][y][WEST]); 1042 clusters[X_SIZE-1][y]->p_cmd_in[EAST] (signal_dspin_bound_cmd_in[X_SIZE-1][y][EAST]); 1043 clusters[X_SIZE-1][y]->p_cmd_out[EAST] (signal_dspin_bound_cmd_out[X_SIZE-1][y][EAST]); 1044 1045 clusters[0][y]->p_rsp_in[WEST] (signal_dspin_bound_rsp_in[0][y][WEST]); 1046 clusters[0][y]->p_rsp_out[WEST] (signal_dspin_bound_rsp_out[0][y][WEST]); 1047 clusters[X_SIZE-1][y]->p_rsp_in[EAST] (signal_dspin_bound_rsp_in[X_SIZE-1][y][EAST]); 1048 clusters[X_SIZE-1][y]->p_rsp_out[EAST] (signal_dspin_bound_rsp_out[X_SIZE-1][y][EAST]); 1049 1050 clusters[0][y]->p_m2p_in[WEST] (signal_dspin_bound_m2p_in[0][y][WEST]); 1051 clusters[0][y]->p_m2p_out[WEST] (signal_dspin_bound_m2p_out[0][y][WEST]); 1052 clusters[X_SIZE-1][y]->p_m2p_in[EAST] (signal_dspin_bound_m2p_in[X_SIZE-1][y][EAST]); 1053 clusters[X_SIZE-1][y]->p_m2p_out[EAST] (signal_dspin_bound_m2p_out[X_SIZE-1][y][EAST]); 1054 1055 clusters[0][y]->p_p2m_in[WEST] (signal_dspin_bound_p2m_in[0][y][WEST]); 1056 clusters[0][y]->p_p2m_out[WEST] (signal_dspin_bound_p2m_out[0][y][WEST]); 1057 clusters[X_SIZE-1][y]->p_p2m_in[EAST] (signal_dspin_bound_p2m_in[X_SIZE-1][y][EAST]); 1058 clusters[X_SIZE-1][y]->p_p2m_out[EAST] (signal_dspin_bound_p2m_out[X_SIZE-1][y][EAST]); 1059 1060 clusters[0][y]->p_cla_in[WEST] (signal_dspin_bound_cla_in[0][y][WEST]); 1061 clusters[0][y]->p_cla_out[WEST] (signal_dspin_bound_cla_out[0][y][WEST]); 1062 clusters[X_SIZE-1][y]->p_cla_in[EAST] (signal_dspin_bound_cla_in[X_SIZE-1][y][EAST]); 1063 clusters[X_SIZE-1][y]->p_cla_out[EAST] (signal_dspin_bound_cla_out[X_SIZE-1][y][EAST]); 1064 } 1065 1066 // North & South boundary clusters connections 1067 for (size_t x = 0; x < X_SIZE; x++) 1068 { 1069 clusters[x][0]->p_cmd_in[SOUTH] (signal_dspin_bound_cmd_in[x][0][SOUTH]); 1070 clusters[x][0]->p_cmd_out[SOUTH] (signal_dspin_bound_cmd_out[x][0][SOUTH]); 1071 clusters[x][Y_SIZE-1]->p_cmd_in[NORTH] (signal_dspin_bound_cmd_in[x][Y_SIZE-1][NORTH]); 1072 clusters[x][Y_SIZE-1]->p_cmd_out[NORTH] (signal_dspin_bound_cmd_out[x][Y_SIZE-1][NORTH]); 1073 1074 clusters[x][0]->p_rsp_in[SOUTH] (signal_dspin_bound_rsp_in[x][0][SOUTH]); 1075 clusters[x][0]->p_rsp_out[SOUTH] (signal_dspin_bound_rsp_out[x][0][SOUTH]); 1076 clusters[x][Y_SIZE-1]->p_rsp_in[NORTH] (signal_dspin_bound_rsp_in[x][Y_SIZE-1][NORTH]); 1077 clusters[x][Y_SIZE-1]->p_rsp_out[NORTH] (signal_dspin_bound_rsp_out[x][Y_SIZE-1][NORTH]); 1078 1079 clusters[x][0]->p_m2p_in[SOUTH] (signal_dspin_bound_m2p_in[x][0][SOUTH]); 1080 clusters[x][0]->p_m2p_out[SOUTH] (signal_dspin_bound_m2p_out[x][0][SOUTH]); 1081 clusters[x][Y_SIZE-1]->p_m2p_in[NORTH] (signal_dspin_bound_m2p_in[x][Y_SIZE-1][NORTH]); 1082 clusters[x][Y_SIZE-1]->p_m2p_out[NORTH] (signal_dspin_bound_m2p_out[x][Y_SIZE-1][NORTH]); 1083 1084 clusters[x][0]->p_p2m_in[SOUTH] (signal_dspin_bound_p2m_in[x][0][SOUTH]); 1085 clusters[x][0]->p_p2m_out[SOUTH] (signal_dspin_bound_p2m_out[x][0][SOUTH]); 1086 clusters[x][Y_SIZE-1]->p_p2m_in[NORTH] (signal_dspin_bound_p2m_in[x][Y_SIZE-1][NORTH]); 1087 clusters[x][Y_SIZE-1]->p_p2m_out[NORTH] (signal_dspin_bound_p2m_out[x][Y_SIZE-1][NORTH]); 1088 1089 clusters[x][0]->p_cla_in[SOUTH] (signal_dspin_bound_cla_in[x][0][SOUTH]); 1090 clusters[x][0]->p_cla_out[SOUTH] (signal_dspin_bound_cla_out[x][0][SOUTH]); 1091 clusters[x][Y_SIZE-1]->p_cla_in[NORTH] (signal_dspin_bound_cla_in[x][Y_SIZE-1][NORTH]); 1092 clusters[x][Y_SIZE-1]->p_cla_out[NORTH] (signal_dspin_bound_cla_out[x][Y_SIZE-1][NORTH]); 1093 } 1094 1095 std::cout << std::endl << "North, South, West, East connections done" << std::endl; 1096 std::cout << std::endl; 1097 1098 //////////////////////////////////////////////////////// 1099 // Simulation 1100 /////////////////////////////////////////////////////// 1101 1102 sc_start(sc_core::sc_time(0, SC_NS)); 1103 signal_resetn = false; 1104 signal_irq_false = false; 1105 1106 // set network boundaries signals default values 1107 // for all boundary clusters but the IO cluster 1108 for (size_t x = 0; x < X_SIZE ; x++) 1109 { 1110 for (size_t y = 0; y < Y_SIZE ; y++) 1111 { 1112 for (size_t face = 0; face < 4; face++) 1113 { 1114 if ( (x != X_SIZE-1) or (y != Y_SIZE-1) or (face != NORTH) ) 1115 { 1116 signal_dspin_bound_cmd_in [x][y][face].write = false; 1117 signal_dspin_bound_cmd_in [x][y][face].read = true; 1118 signal_dspin_bound_cmd_out[x][y][face].write = false; 1119 signal_dspin_bound_cmd_out[x][y][face].read = true; 1120 1121 signal_dspin_bound_rsp_in [x][y][face].write = false; 1122 signal_dspin_bound_rsp_in [x][y][face].read = true; 1123 signal_dspin_bound_rsp_out[x][y][face].write = false; 1124 signal_dspin_bound_rsp_out[x][y][face].read = true; 1125 } 1126 1127 signal_dspin_bound_m2p_in [x][y][face].write = false; 1128 signal_dspin_bound_m2p_in [x][y][face].read = true; 1129 signal_dspin_bound_m2p_out[x][y][face].write = false; 1130 signal_dspin_bound_m2p_out[x][y][face].read = true; 1131 1132 signal_dspin_bound_p2m_in [x][y][face].write = false; 1133 signal_dspin_bound_p2m_in [x][y][face].read = true; 1134 signal_dspin_bound_p2m_out[x][y][face].write = false; 1135 signal_dspin_bound_p2m_out[x][y][face].read = true; 1136 1137 signal_dspin_bound_cla_in [x][y][face].write = false; 1138 signal_dspin_bound_cla_in [x][y][face].read = true; 1139 signal_dspin_bound_cla_out[x][y][face].write = false; 1140 signal_dspin_bound_cla_out[x][y][face].read = true; 708 1141 } 709 710 for (size_t k = 0; k < 2; k++){ 711 clusters[x][y]->p_rsp_out[NORTH][k] (signal_dspin_v_rsp_inc[x][y][k]); 712 clusters[x][y+1]->p_rsp_in[SOUTH][k] (signal_dspin_v_rsp_inc[x][y][k]); 713 clusters[x][y]->p_rsp_in[NORTH][k] (signal_dspin_v_rsp_dec[x][y][k]); 714 clusters[x][y+1]->p_rsp_out[SOUTH][k] (signal_dspin_v_rsp_dec[x][y][k]); 715 } 716 } 717 } 718 } 719 std::cout << "Vertical connections established" << std::endl; 720 721 // East & West boundary cluster connections 722 for (size_t y = 0; y < Y_SIZE; y++) 723 { 724 for (size_t k = 0; k < 3; k++) 725 { 726 clusters[0][y]->p_cmd_in[WEST][k] (signal_dspin_false_cmd_in[0][y][WEST][k]); 727 clusters[0][y]->p_cmd_out[WEST][k] (signal_dspin_false_cmd_out[0][y][WEST][k]); 728 clusters[X_SIZE-1][y]->p_cmd_in[EAST][k] (signal_dspin_false_cmd_in[X_SIZE-1][y][EAST][k]); 729 clusters[X_SIZE-1][y]->p_cmd_out[EAST][k] (signal_dspin_false_cmd_out[X_SIZE-1][y][EAST][k]); 730 } 731 732 for (size_t k = 0; k < 2; k++) 733 { 734 clusters[0][y]->p_rsp_in[WEST][k] (signal_dspin_false_rsp_in[0][y][WEST][k]); 735 clusters[0][y]->p_rsp_out[WEST][k] (signal_dspin_false_rsp_out[0][y][WEST][k]); 736 clusters[X_SIZE-1][y]->p_rsp_in[EAST][k] (signal_dspin_false_rsp_in[X_SIZE-1][y][EAST][k]); 737 clusters[X_SIZE-1][y]->p_rsp_out[EAST][k] (signal_dspin_false_rsp_out[X_SIZE-1][y][EAST][k]); 738 } 739 } 740 741 // North & South boundary clusters connections 742 for (size_t x = 0; x < X_SIZE; x++) 743 { 744 for (size_t k = 0; k < 3; k++) 745 { 746 clusters[x][0]->p_cmd_in[SOUTH][k] (signal_dspin_false_cmd_in[x][0][SOUTH][k]); 747 clusters[x][0]->p_cmd_out[SOUTH][k] (signal_dspin_false_cmd_out[x][0][SOUTH][k]); 748 clusters[x][Y_SIZE-1]->p_cmd_in[NORTH][k] (signal_dspin_false_cmd_in[x][Y_SIZE-1][NORTH][k]); 749 clusters[x][Y_SIZE-1]->p_cmd_out[NORTH][k] (signal_dspin_false_cmd_out[x][Y_SIZE-1][NORTH][k]); 750 } 751 752 for (size_t k = 0; k < 2; k++) 753 { 754 clusters[x][0]->p_rsp_in[SOUTH][k] (signal_dspin_false_rsp_in[x][0][SOUTH][k]); 755 clusters[x][0]->p_rsp_out[SOUTH][k] (signal_dspin_false_rsp_out[x][0][SOUTH][k]); 756 clusters[x][Y_SIZE-1]->p_rsp_in[NORTH][k] (signal_dspin_false_rsp_in[x][Y_SIZE-1][NORTH][k]); 757 clusters[x][Y_SIZE-1]->p_rsp_out[NORTH][k] (signal_dspin_false_rsp_out[x][Y_SIZE-1][NORTH][k]); 758 } 759 } 760 std::cout << "North, South, West, East connections established" << std::endl; 761 std::cout << std::endl; 762 763 764 //////////////////////////////////////////////////////// 765 // Simulation 766 /////////////////////////////////////////////////////// 767 768 sc_start(sc_core::sc_time(0, SC_NS)); 769 signal_resetn = false; 770 771 // network boundaries signals 772 for (size_t x = 0; x < X_SIZE ; x++){ 773 for (size_t y = 0; y < Y_SIZE ; y++){ 774 for (size_t a = 0; a < 4; a++){ 775 for (size_t k = 0; k < 3; k++){ 776 signal_dspin_false_cmd_in [x][y][a][k].write = false; 777 signal_dspin_false_cmd_in [x][y][a][k].read = true; 778 signal_dspin_false_cmd_out[x][y][a][k].write = false; 779 signal_dspin_false_cmd_out[x][y][a][k].read = true; 780 } 781 782 for (size_t k = 0; k < 2; k++){ 783 signal_dspin_false_rsp_in [x][y][a][k].write = false; 784 signal_dspin_false_rsp_in [x][y][a][k].read = true; 785 signal_dspin_false_rsp_out[x][y][a][k].write = false; 786 signal_dspin_false_rsp_out[x][y][a][k].read = true; 787 } 788 } 789 } 790 } 791 792 sc_start(sc_core::sc_time(1, SC_NS)); 793 signal_resetn = true; 794 795 if (gettimeofday(&t1, NULL) != 0) 796 { 797 perror("gettimeofday"); 798 return EXIT_FAILURE; 799 } 1142 } 1143 } 1144 1145 sc_start(sc_core::sc_time(1, SC_NS)); 1146 signal_resetn = true; 1147 1148 if (gettimeofday(&t1, NULL) != 0) 1149 { 1150 perror("gettimeofday"); 1151 return EXIT_FAILURE; 1152 } 800 1153 801 1154 for (uint64_t n = 1; n < ncycles && !stop_called; n++) 802 1155 { 803 1156 // Monitor a specific address for L1 & L2 caches 804 // clusters[0][0]->proc[0]->cache_monitor(0x800002c000ULL);805 // clusters[1][0]->memc->copies_monitor(0x800002C000ULL);1157 // clusters[0][0]->proc[0]->cache_monitor(0x0000010000ULL); 1158 // clusters[0][0]->memc->cache_monitor(0x0000030000ULL); 806 1159 807 1160 if( (n % 5000000) == 0) … … 838 1191 std::ostringstream proc_signame; 839 1192 proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << l ; 840 std::ostringstream p2m_signame; 841 p2m_signame << "[SIG]PROC_" << x << "_" << y << "_" << l << " P2M" ; 842 std::ostringstream m2p_signame; 843 m2p_signame << "[SIG]PROC_" << x << "_" << y << "_" << l << " M2P" ; 844 std::ostringstream p_cmd_signame; 845 p_cmd_signame << "[SIG]PROC_" << x << "_" << y << "_" << l << " CMD" ; 846 std::ostringstream p_rsp_signame; 847 p_rsp_signame << "[SIG]PROC_" << x << "_" << y << "_" << l << " RSP" ; 848 849 clusters[x][y]->proc[l]->print_trace(); 850 // clusters[x][y]->wi_proc[l]->print_trace(); 1193 std::ostringstream xicu_signame; 1194 xicu_signame << "[SIG]XICU_" << x << "_" << y ; 1195 1196 clusters[x][y]->proc[l]->print_trace(0x1); 851 1197 clusters[x][y]->signal_vci_ini_proc[l].print_trace(proc_signame.str()); 852 clusters[x][y]->signal_dspin_p2m_proc[l].print_trace(p2m_signame.str()); 853 clusters[x][y]->signal_dspin_m2p_proc[l].print_trace(m2p_signame.str()); 854 clusters[x][y]->signal_dspin_cmd_proc_i[l].print_trace(p_cmd_signame.str()); 855 clusters[x][y]->signal_dspin_rsp_proc_i[l].print_trace(p_rsp_signame.str()); 856 857 // clusters[x][y]->xbar_rsp_d->print_trace(); 858 // clusters[x][y]->xbar_cmd_d->print_trace(); 859 // clusters[x][y]->signal_dspin_cmd_l2g_d.print_trace("[SIG]L2G CMD"); 860 // clusters[x][y]->signal_dspin_cmd_g2l_d.print_trace("[SIG]G2L CMD"); 861 // clusters[x][y]->signal_dspin_rsp_l2g_d.print_trace("[SIG]L2G RSP"); 862 // clusters[x][y]->signal_dspin_rsp_g2l_d.print_trace("[SIG]G2L RSP"); 863 864 // trace memc[trace_memc_id] 1198 1199 clusters[x][y]->xicu->print_trace(0); 1200 clusters[x][y]->signal_vci_tgt_xicu.print_trace(xicu_signame.str()); 1201 1202 if ( clusters[x][y]->signal_proc_irq[0].read() ) 1203 std::cout << " IRQ_PROC active in cluster " << cluster(x,y) << std::endl; 1204 1205 if ( signal_irq_bdev.read() ) 1206 std::cout << " IRQ_BDEV in cluster_io active" << std::endl; 1207 1208 // trace memc[trace_memc_id] and xram[trace_memc_id] 865 1209 x = trace_memc_id >> Y_WIDTH; 866 1210 y = trace_memc_id & ((1<<Y_WIDTH) - 1); … … 870 1214 std::ostringstream sxram; 871 1215 sxram << "[SIG]XRAM_" << x << "_" << y; 872 std::ostringstream sm2p;873 sm2p << "[SIG]MEMC_" << x << "_" << y << " M2P" ;874 std::ostringstream sp2m;875 sp2m << "[SIG]MEMC_" << x << "_" << y << " P2M" ;876 std::ostringstream m_cmd_signame;877 m_cmd_signame << "[SIG]MEMC_" << x << "_" << y << " CMD" ;878 std::ostringstream m_rsp_signame;879 m_rsp_signame << "[SIG]MEMC_" << x << "_" << y << " RSP" ;880 1216 881 1217 clusters[x][y]->memc->print_trace(); 882 // clusters[x][y]->wt_memc->print_trace();883 1218 clusters[x][y]->signal_vci_tgt_memc.print_trace(smemc.str()); 884 1219 clusters[x][y]->signal_vci_xram.print_trace(sxram.str()); 885 clusters[x][y]->signal_dspin_p2m_memc.print_trace(sp2m.str());886 clusters[x][y]->signal_dspin_m2p_memc.print_trace(sm2p.str());887 clusters[x][y]->signal_dspin_cmd_memc_t.print_trace(m_cmd_signame.str());888 clusters[x][y]->signal_dspin_rsp_memc_t.print_trace(m_rsp_signame.str());889 1220 890 // trace replicated peripherals 891 // clusters[1][1]->mdma->print_trace(); 892 // clusters[1][1]->signal_vci_tgt_mdma.print_trace("[SIG]MDMA_TGT_1_1"); 893 // clusters[1][1]->signal_vci_ini_mdma.print_trace("[SIG]MDMA_INI_1_1"); 1221 // trace coherence signals 1222 // clusters[0][0]->signal_dspin_m2p_proc[0].print_trace("[CC_M2P_0_0]"); 1223 // clusters[0][1]->signal_dspin_m2p_proc[0].print_trace("[CC_M2P_0_1]"); 1224 // clusters[1][0]->signal_dspin_m2p_proc[0].print_trace("[CC_M2P_1_0]"); 1225 // clusters[1][1]->signal_dspin_m2p_proc[0].print_trace("[CC_M2P_1_1]"); 1226 1227 // clusters[0][0]->signal_dspin_p2m_proc[0].print_trace("[CC_P2M_0_0]"); 1228 // clusters[0][1]->signal_dspin_p2m_proc[0].print_trace("[CC_P2M_0_1]"); 1229 // clusters[1][0]->signal_dspin_p2m_proc[0].print_trace("[CC_P2M_1_0]"); 1230 // clusters[1][1]->signal_dspin_p2m_proc[0].print_trace("[CC_P2M_1_1]"); 1231 1232 // trace xbar(s) m2p 1233 // clusters[0][0]->xbar_m2p->print_trace(); 1234 // clusters[1][0]->xbar_m2p->print_trace(); 1235 // clusters[0][1]->xbar_m2p->print_trace(); 1236 // clusters[1][1]->xbar_m2p->print_trace(); 894 1237 895 1238 // trace router(s) m2p 1239 // clusters[0][0]->router_m2p->print_trace(); 1240 // clusters[1][0]->router_m2p->print_trace(); 1241 // clusters[0][1]->router_m2p->print_trace(); 1242 // clusters[1][1]->router_m2p->print_trace(); 1243 896 1244 // trace external peripherals 897 898 // clusters[0][0]->bdev->print_trace(); 899 // clusters[0][0]->signal_vci_tgt_bdev.print_trace("[SIG]BDEV_TGT"); 900 // clusters[0][0]->signal_vci_ini_bdev.print_trace("[SIG]BDEV_INI"); 901 902 // clusters[0][0]->mtty->print_trace(); 903 // clusters[0][0]->wt_mtty->print_trace(); 904 // clusters[0][0]->signal_vci_tgt_mtty.print_trace("[SIG]MTTY"); 905 } 1245 bdev->print_trace(); 1246 signal_vci_tgt_bdev.print_trace("[SIG]BDEV_TGT"); 1247 signal_vci_ini_bdev.print_trace("[SIG]BDEV_INI"); 1248 1249 iopic->print_trace(); 1250 signal_vci_tgt_iopi.print_trace("[SIG]IOPI_TGT"); 1251 signal_vci_ini_iopi.print_trace("[SIG]IOPI_INI"); 1252 1253 clusters[0][0]->mtty->print_trace(); 1254 clusters[0][0]->signal_vci_tgt_mtty.print_trace("[SIG]MTTY"); 1255 } // end trace 906 1256 907 1257 sc_start(sc_core::sc_time(1, SC_NS)); … … 917 1267 } 918 1268 919 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cmd_inc, X_SIZE - 1, Y_SIZE, 3);920 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_h_cmd_dec, X_SIZE - 1, Y_SIZE, 3);921 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_rsp_inc, X_SIZE - 1, Y_SIZE, 2);922 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_h_rsp_dec, X_SIZE - 1, Y_SIZE, 2);923 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cmd_inc, X_SIZE, Y_SIZE - 1, 3);924 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_v_cmd_dec, X_SIZE, Y_SIZE - 1, 3);925 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_rsp_inc, X_SIZE, Y_SIZE - 1, 2);926 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_v_rsp_dec, X_SIZE, Y_SIZE - 1, 2);927 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_false_cmd_in, X_SIZE, Y_SIZE, 4, 3);928 dealloc_elems<DspinSignals<dspin_cmd_width> >(signal_dspin_false_cmd_out, X_SIZE, Y_SIZE, 4, 3);929 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_false_rsp_in, X_SIZE, Y_SIZE, 4, 2);930 dealloc_elems<DspinSignals<dspin_rsp_width> >(signal_dspin_false_rsp_out, X_SIZE, Y_SIZE, 4, 2);931 932 1269 return EXIT_SUCCESS; 933 1270 } 934 1271 935 1272 936 void handler(int dummy = 0) { 1273 void handler(int dummy = 0) 1274 { 937 1275 stop_called = true; 938 1276 sc_stop(); -
trunk/platforms/tsar_generic_leti/top.desc
r621 r628 29 29 dspin_rsp_width = dspin_rsp_flit_size), 30 30 31 Uses('caba:vci_dspin_target_wrapper', 32 cell_size = vci_cell_size_int, 33 dspin_cmd_width = dspin_cmd_flit_size, 34 dspin_rsp_width = dspin_rsp_flit_size), 35 36 Uses('caba:vci_dspin_initiator_wrapper', 37 cell_size = vci_cell_size_int, 38 dspin_cmd_width = dspin_cmd_flit_size, 39 dspin_rsp_width = dspin_rsp_flit_size), 40 41 Uses('caba:vci_local_crossbar', 42 cell_size = vci_cell_size_int), 43 44 Uses('caba:vci_framebuffer', 45 cell_size = vci_cell_size_int), 46 47 Uses('caba:vci_multi_nic', 48 cell_size = vci_cell_size_int), 49 50 Uses('caba:vci_chbuf_dma', 51 cell_size = vci_cell_size_int), 52 53 Uses('caba:vci_block_device_tsar', 54 cell_size = vci_cell_size_int), 55 56 Uses('caba:vci_multi_tty', 57 cell_size = vci_cell_size_int), 58 59 Uses('caba:vci_iopic', 60 cell_size = vci_cell_size_int), 61 31 62 Uses('common:elf_file_loader'), 63 32 64 Uses('common:plain_file_loader'), 33 65 ], -
trunk/platforms/tsar_generic_leti/tsar_leti_cluster/caba/metadata/tsar_leti_cluster.sd
r621 r628 40 40 cell_size = parameter.Reference('vci_data_width_ext')), 41 41 42 Uses('caba:vci_simple_ram',43 cell_size = parameter.Reference('vci_data_width_int')),44 45 42 Uses('caba:vci_xicu', 46 43 cell_size = parameter.Reference('vci_data_width_int')), … … 52 49 flit_width = parameter.Reference('dspin_rsp_width')), 53 50 54 Uses('caba: virtual_dspin_router',51 Uses('caba:dspin_router', 55 52 flit_width = parameter.Reference('dspin_cmd_width')), 56 53 57 Uses('caba: virtual_dspin_router',54 Uses('caba:dspin_router', 58 55 flit_width = parameter.Reference('dspin_rsp_width')), 59 56 … … 61 58 cell_size = parameter.Reference('vci_data_width_int')), 62 59 63 Uses('caba:vci_framebuffer',64 cell_size = parameter.Reference('vci_data_width_int')),65 66 Uses('caba:vci_multi_nic',67 cell_size = parameter.Reference('vci_data_width_int')),68 69 Uses('caba:vci_chbuf_dma',70 cell_size = parameter.Reference('vci_data_width_int')),71 72 60 Uses('caba:vci_block_device_tsar', 73 cell_size = parameter.Reference('vci_data_width_int')),74 75 Uses('caba:vci_multi_dma',76 61 cell_size = parameter.Reference('vci_data_width_int')), 77 62 … … 82 67 cell_size = parameter.Reference('vci_data_width_int')), 83 68 84 Uses('caba:vci_simhelper',85 cell_size = parameter.Reference('vci_data_width_int')),86 87 69 Uses('common:elf_file_loader'), 88 70 ], … … 91 73 Port('caba:bit_in', 'p_resetn', auto = 'resetn'), 92 74 Port('caba:clock_in', 'p_clk', auto = 'clock'), 93 Port('caba:dspin_output', 'p_cmd_out', [4, 3], 75 76 Port('caba:dspin_output', 'p_cmd_out', [4], 94 77 dspin_data_size = parameter.Reference('dspin_cmd_width')), 95 Port('caba:dspin_input', 'p_cmd_in', [4 , 3],78 Port('caba:dspin_input', 'p_cmd_in', [4], 96 79 dspin_data_size = parameter.Reference('dspin_cmd_width')), 97 Port('caba:dspin_output', 'p_rsp_out', [4, 2], 80 81 Port('caba:dspin_output', 'p_rsp_out', [4], 98 82 dspin_data_size = parameter.Reference('dspin_rsp_width')), 99 Port('caba:dspin_input', 'p_rsp_in', [4 , 2],83 Port('caba:dspin_input', 'p_rsp_in', [4], 100 84 dspin_data_size = parameter.Reference('dspin_rsp_width')), 85 86 Port('caba:dspin_output', 'p_m2p_out', [4], 87 dspin_data_size = parameter.Reference('dspin_cmd_width')), 88 Port('caba:dspin_input', 'p_m2p_in', [4], 89 dspin_data_size = parameter.Reference('dspin_cmd_width')), 90 91 Port('caba:dspin_output', 'p_p2m_out', [4], 92 dspin_data_size = parameter.Reference('dspin_rsp_width')), 93 Port('caba:dspin_input', 'p_p2m_in', [4], 94 dspin_data_size = parameter.Reference('dspin_rsp_width')), 95 96 Port('caba:dspin_output', 'p_cla_out', [4], 97 dspin_data_size = parameter.Reference('dspin_cmd_width')), 98 Port('caba:dspin_input', 'p_cla_in', [4], 99 dspin_data_size = parameter.Reference('dspin_cmd_width')), 101 100 ], 102 101 ) -
trunk/platforms/tsar_generic_leti/tsar_leti_cluster/caba/source/include/tsar_leti_cluster.h
r621 r628 25 25 #include "vci_dspin_initiator_wrapper.h" 26 26 #include "vci_dspin_target_wrapper.h" 27 #include " virtual_dspin_router.h"27 #include "dspin_router.h" 28 28 #include "vci_multi_tty.h" 29 #include "vci_multi_nic.h"30 #include "vci_chbuf_dma.h"31 29 #include "vci_block_device_tsar.h" 32 #include "vci_framebuffer.h"33 #include "vci_multi_dma.h"34 30 #include "vci_mem_cache.h" 35 31 #include "vci_cc_vcache_wrapper.h" 36 #include "vci_simhelper.h"37 32 38 33 namespace soclib { namespace caba { … … 54 49 sc_in<bool> p_clk; 55 50 sc_in<bool> p_resetn; 56 soclib::caba::DspinOutput<dspin_cmd_width> **p_cmd_out; 57 soclib::caba::DspinInput<dspin_cmd_width> **p_cmd_in; 58 soclib::caba::DspinOutput<dspin_rsp_width> **p_rsp_out; 59 soclib::caba::DspinInput<dspin_rsp_width> **p_rsp_in; 51 52 soclib::caba::DspinOutput<dspin_cmd_width> *p_cmd_out; 53 soclib::caba::DspinInput<dspin_cmd_width> *p_cmd_in; 54 55 soclib::caba::DspinOutput<dspin_rsp_width> *p_rsp_out; 56 soclib::caba::DspinInput<dspin_rsp_width> *p_rsp_in; 57 58 soclib::caba::DspinOutput<dspin_cmd_width> *p_m2p_out; 59 soclib::caba::DspinInput<dspin_cmd_width> *p_m2p_in; 60 61 soclib::caba::DspinOutput<dspin_rsp_width> *p_p2m_out; 62 soclib::caba::DspinInput<dspin_rsp_width> *p_p2m_in; 63 64 soclib::caba::DspinOutput<dspin_cmd_width> *p_cla_out; 65 soclib::caba::DspinInput<dspin_cmd_width> *p_cla_in; 60 66 61 67 // interrupt signals 62 68 sc_signal<bool> signal_false; 63 sc_signal<bool> signal_proc_it[8]; 64 sc_signal<bool> signal_irq_mdma[8]; 65 sc_signal<bool> signal_irq_mtty[23]; 66 sc_signal<bool> signal_irq_mnic_rx[8]; // unused 67 sc_signal<bool> signal_irq_mnic_tx[8]; // unused 68 sc_signal<bool> signal_irq_chbuf[8]; // unused 69 sc_signal<bool> signal_proc_irq[16]; 70 sc_signal<bool> signal_irq_mtty; 69 71 sc_signal<bool> signal_irq_memc; 70 72 sc_signal<bool> signal_irq_bdev; … … 83 85 84 86 // Direct VCI signals to VCI/DSPIN wrappers 85 VciSignals<vci_param_int> signal_vci_ini_proc[ 8];87 VciSignals<vci_param_int> signal_vci_ini_proc[4]; 86 88 VciSignals<vci_param_int> signal_vci_ini_mdma; 87 89 VciSignals<vci_param_int> signal_vci_ini_bdev; … … 99 101 100 102 // Direct DSPIN signals to local crossbars 101 DspinSignals<dspin_cmd_width> signal_dspin_cmd_proc_i[ 8];102 DspinSignals<dspin_rsp_width> signal_dspin_rsp_proc_i[ 8];103 DspinSignals<dspin_cmd_width> signal_dspin_cmd_proc_i[4]; 104 DspinSignals<dspin_rsp_width> signal_dspin_rsp_proc_i[4]; 103 105 DspinSignals<dspin_cmd_width> signal_dspin_cmd_mdma_i; 104 106 DspinSignals<dspin_rsp_width> signal_dspin_rsp_mdma_i; … … 131 133 DspinSignals<dspin_cmd_width> signal_dspin_clack_memc; 132 134 DspinSignals<dspin_rsp_width> signal_dspin_p2m_memc; 133 DspinSignals<dspin_cmd_width> signal_dspin_m2p_proc[ 8];134 DspinSignals<dspin_cmd_width> signal_dspin_clack_proc[ 8];135 DspinSignals<dspin_rsp_width> signal_dspin_p2m_proc[ 8];135 DspinSignals<dspin_cmd_width> signal_dspin_m2p_proc[4]; 136 DspinSignals<dspin_cmd_width> signal_dspin_clack_proc[4]; 137 DspinSignals<dspin_rsp_width> signal_dspin_p2m_proc[4]; 136 138 137 139 // external RAM to MEMC VCI signal … … 143 145 dspin_cmd_width, 144 146 dspin_rsp_width, 145 GdbServer<Mips32ElIss> >* proc[ 8];147 GdbServer<Mips32ElIss> >* proc[4]; 146 148 147 149 VciDspinInitiatorWrapper<vci_param_int, 148 150 dspin_cmd_width, 149 dspin_rsp_width>* wi_proc[ 8];151 dspin_rsp_width>* wi_proc[4]; 150 152 151 153 VciMemCache<vci_param_int, … … 164 166 dspin_rsp_width>* wt_xicu; 165 167 166 VciMultiDma<vci_param_int>* mdma;167 168 VciDspinInitiatorWrapper<vci_param_int,169 dspin_cmd_width,170 dspin_rsp_width>* wi_mdma;171 172 VciDspinTargetWrapper<vci_param_int,173 dspin_cmd_width,174 dspin_rsp_width>* wt_mdma;175 176 168 VciSimpleRam<vci_param_ext>* xram; 177 169 … … 181 173 dspin_cmd_width, 182 174 dspin_rsp_width>* wt_mtty; 183 184 VciSimhelper<vci_param_int>* simhelper;185 186 VciDspinTargetWrapper<vci_param_int,187 dspin_cmd_width,188 dspin_rsp_width>* wt_simhelper;189 190 VciFrameBuffer<vci_param_int>* fbuf;191 192 VciDspinTargetWrapper<vci_param_int,193 dspin_cmd_width,194 dspin_rsp_width>* wt_fbuf;195 196 VciMultiNic<vci_param_int>* mnic;197 198 VciDspinTargetWrapper<vci_param_int,199 dspin_cmd_width,200 dspin_rsp_width>* wt_mnic;201 202 VciChbufDma<vci_param_int>* chbuf;203 204 VciDspinTargetWrapper<vci_param_int,205 dspin_cmd_width,206 dspin_rsp_width>* wt_chbuf;207 208 VciDspinInitiatorWrapper<vci_param_int,209 dspin_cmd_width,210 dspin_rsp_width>* wi_chbuf;211 175 212 176 VciBlockDeviceTsar<vci_param_int>* bdev; … … 220 184 dspin_rsp_width>* wt_bdev; 221 185 222 DspinLocalCrossbar<dspin_cmd_width>* xbar_cmd_d; 223 DspinLocalCrossbar<dspin_rsp_width>* xbar_rsp_d; 224 DspinLocalCrossbar<dspin_cmd_width>* xbar_m2p_c; 225 DspinLocalCrossbar<dspin_rsp_width>* xbar_p2m_c; 226 DspinLocalCrossbar<dspin_cmd_width>* xbar_clack_c; 227 228 VirtualDspinRouter<dspin_cmd_width>* router_cmd; 229 VirtualDspinRouter<dspin_rsp_width>* router_rsp; 186 DspinLocalCrossbar<dspin_cmd_width>* xbar_cmd; 187 DspinLocalCrossbar<dspin_rsp_width>* xbar_rsp; 188 DspinLocalCrossbar<dspin_cmd_width>* xbar_m2p; 189 DspinLocalCrossbar<dspin_rsp_width>* xbar_p2m; 190 DspinLocalCrossbar<dspin_cmd_width>* xbar_cla; 191 192 DspinRouter<dspin_cmd_width>* router_cmd; 193 DspinRouter<dspin_rsp_width>* router_rsp; 194 DspinRouter<dspin_cmd_width>* router_m2p; 195 DspinRouter<dspin_rsp_width>* router_p2m; 196 DspinRouter<dspin_cmd_width>* router_cla; 230 197 231 198 TsarLetiCluster( sc_module_name insname, 232 199 size_t nb_procs, // processors 233 size_t nb_ttys, // TTY terminals234 size_t nb_dmas, // DMA channels235 200 size_t x, // x coordinate 236 201 size_t y, // y coordinate … … 244 209 size_t tgtid_memc, 245 210 size_t tgtid_xicu, 246 size_t tgtid_mdma,247 size_t tgtid_fbuf,248 211 size_t tgtid_mtty, 249 size_t tgtid_mnic,250 size_t tgtid_chbuf,251 212 size_t tgtid_bdev, 252 size_t tgtid_simh,213 const char* disk_pathname, 253 214 size_t memc_ways, 254 215 size_t memc_sets, … … 258 219 size_t l1_d_sets, 259 220 size_t xram_latency, // external ram 260 bool io, // I/O cluster261 size_t xfb, // fbf pixels262 size_t yfb, // fbf lines263 char* disk_name, // virtual disk264 size_t block_size, // block size265 size_t nic_channels, // number channels266 char* nic_rx_name, // filename rx267 char* nic_tx_name, // filename tx268 uint32_t nic_timeout, // cycles269 size_t chbufdma_channels, // number channels270 221 const Loader &loader, 271 222 uint32_t frozen_cycles, -
trunk/platforms/tsar_generic_leti/tsar_leti_cluster/caba/source/src/tsar_leti_cluster.cpp
r621 r628 3 3 // Author: Alain Greiner 4 4 // Copyright: UPMC/LIP6 5 // Date : march 20115 // Date : february 2014 6 6 // This program is released under the GNU public license 7 7 ////////////////////////////////////////////////////////////////////////////// 8 // This file define a TSAR cluster architecture with virtual memory:9 // - It uses two virtual_dspin_router as distributed global interconnect10 // - It uses five dspin_local_crossbar as local interconnect11 // - It uses the vci_cc_vcache_wrapper12 // - It uses the vci_mem_cache13 // - It contains a private RAM with a variable latency to emulate the L3 cache14 // - It can contains 1, 2 or 4 processors15 // - Each processor has a private dma channel (vci_multi_dma)16 // - It uses the vci_xicu interrupt controller17 // - The peripherals MTTY, BDEV, FBUF, MNIC,CDMA are in cluster (0,0)18 // - The Multi-TTY component controls up to 16 terminals.19 // - The BDEV IRQ is connected to IRQ_IN[0] in cluster(0,0).20 // - The DMA IRQs are connected to IRQ_IN[8:11] in all clusters.21 // - The MEMC IRQ is connected to IRQ_IN[12] in all clusters.22 // - The TTY IRQs are connected to IRQ_IN[16:31] in cluster (0,0).23 //////////////////////////////////////////////////////////////////////////////////24 8 25 9 #include "../include/tsar_leti_cluster.h" 26 27 10 28 11 namespace soclib { … … 40 23 sc_module_name insname, 41 24 size_t nb_procs, 42 size_t nb_ttys,43 size_t nb_dmas,44 25 size_t x_id, 45 26 size_t y_id, … … 53 34 size_t tgtid_memc, 54 35 size_t tgtid_xicu, 55 size_t tgtid_mdma,56 size_t tgtid_fbuf,57 36 size_t tgtid_mtty, 58 size_t tgtid_mnic,59 size_t tgtid_chbuf,60 37 size_t tgtid_bdev, 61 size_t tgtid_simh,38 const char* disk_pathname, 62 39 size_t memc_ways, 63 40 size_t memc_sets, … … 67 44 size_t l1_d_sets, 68 45 size_t xram_latency, 69 bool io,70 size_t xfb,71 size_t yfb,72 char* disk_name,73 size_t block_size,74 size_t nic_channels,75 char* nic_rx_name,76 char* nic_tx_name,77 uint32_t nic_timeout,78 size_t chbufdma_channels,79 46 const Loader &loader, 80 47 uint32_t frozen_cycles, … … 89 56 90 57 { 91 92 n_procs = nb_procs; 93 94 // Vectors of ports definition 95 p_cmd_in = alloc_elems<DspinInput<dspin_cmd_width> > ("p_cmd_in", 4, 3); 96 p_cmd_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_cmd_out", 4, 3); 97 p_rsp_in = alloc_elems<DspinInput<dspin_rsp_width> > ("p_rsp_in", 4, 2); 98 p_rsp_out = alloc_elems<DspinOutput<dspin_rsp_width> > ("p_rsp_out", 4, 2); 99 100 ///////////////////////////////////////////////////////////////////////////// 101 // Components definition 58 ///////////////////////////////////////////////////////////////////////////// 59 // Vectors of ports definition and allocation 60 ///////////////////////////////////////////////////////////////////////////// 61 62 p_cmd_in = alloc_elems<DspinInput<dspin_cmd_width> > ("p_cmd_in", 4); 63 p_cmd_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_cmd_out", 4); 64 65 p_rsp_in = alloc_elems<DspinInput<dspin_rsp_width> > ("p_rsp_in", 4); 66 p_rsp_out = alloc_elems<DspinOutput<dspin_rsp_width> > ("p_rsp_out", 4); 67 68 p_m2p_in = alloc_elems<DspinInput<dspin_cmd_width> > ("p_m2p_in", 4); 69 p_m2p_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_m2p_out", 4); 70 71 p_p2m_in = alloc_elems<DspinInput<dspin_rsp_width> > ("p_p2m_in", 4); 72 p_p2m_out = alloc_elems<DspinOutput<dspin_rsp_width> > ("p_p2m_out", 4); 73 74 p_cla_in = alloc_elems<DspinInput<dspin_cmd_width> > ("p_cla_in", 4); 75 p_cla_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_cla_out", 4); 76 77 ///////////////////////////////////////////////////////////////////////////// 78 // Components definition and allocation 102 79 ///////////////////////////////////////////////////////////////////////////// 103 80 … … 194 171 mtd, // mapping table 195 172 IntTab(cluster_xy, tgtid_xicu), // TGTID_D 196 32, // number of timer IRQs197 32, // number of hard IRQs198 32, // number of soft IRQs199 nb_procs);// number of output IRQs173 16, // number of timer IRQs 174 16, // number of hard IRQs 175 16, // number of soft IRQs 176 16 ); // number of output IRQs 200 177 201 178 wt_xicu = new VciDspinTargetWrapper<vci_param_int, … … 206 183 207 184 ///////////////////////////////////////////////////////////////////////////// 208 std::ostringstream smdma; 209 smdma << "mdma_" << x_id << "_" << y_id; 210 mdma = new VciMultiDma<vci_param_int>( 211 smdma.str().c_str(), 212 mtd, 213 IntTab(cluster_xy, nb_procs), // SRCID 214 IntTab(cluster_xy, tgtid_mdma), // TGTID 215 64, // burst size 216 nb_dmas); // number of IRQs 217 218 wt_mdma = new VciDspinTargetWrapper<vci_param_int, 219 dspin_cmd_width, 220 dspin_rsp_width>( 221 "wt_mdma", 222 x_width + y_width + l_width); 223 224 wi_mdma = new VciDspinInitiatorWrapper<vci_param_int, 225 dspin_cmd_width, 226 dspin_rsp_width>( 227 "wi_mdma", 228 x_width + y_width + l_width); 229 230 ///////////////////////////////////////////////////////////////////////////// 231 size_t nb_direct_initiators = nb_procs + 1; 232 size_t nb_direct_targets = 3; 233 if (io) 234 { 235 nb_direct_initiators = nb_procs + 3; 236 nb_direct_targets = 9; 237 } 238 239 xbar_cmd_d = new DspinLocalCrossbar<dspin_cmd_width>( 240 "xbar_cmd_d", 185 size_t nb_initiators = nb_procs; 186 size_t nb_targets = 2; 187 188 if ((x_id == 0) and (y_id == 0)) // cluster(0,0) 189 { 190 nb_initiators = nb_procs + 1; 191 nb_targets = 4; 192 } 193 194 std::ostringstream s_xbar_cmd; 195 s_xbar_cmd << "xbar_cmd_" << x_id << "_" << y_id; 196 xbar_cmd = new DspinLocalCrossbar<dspin_cmd_width>( 197 s_xbar_cmd.str().c_str(), 241 198 mtd, // mapping table 242 199 x_id, y_id, // cluster coordinates 243 200 x_width, y_width, l_width, 244 nb_ direct_initiators,// number of local of sources245 nb_ direct_targets,// number of local dests201 nb_initiators, // number of local of sources 202 nb_targets, // number of local dests 246 203 2, 2, // fifo depths 247 204 true, // CMD … … 250 207 251 208 ///////////////////////////////////////////////////////////////////////////// 252 xbar_rsp_d = new DspinLocalCrossbar<dspin_rsp_width>( 253 "xbar_rsp_d", 209 std::ostringstream s_xbar_rsp; 210 s_xbar_rsp << "xbar_rsp_" << x_id << "_" << y_id; 211 xbar_rsp = new DspinLocalCrossbar<dspin_rsp_width>( 212 s_xbar_rsp.str().c_str(), 254 213 mtd, // mapping table 255 214 x_id, y_id, // cluster coordinates 256 215 x_width, y_width, l_width, 257 nb_ direct_targets,// number of local sources258 nb_ direct_initiators,// number of local dests216 nb_targets, // number of local sources 217 nb_initiators, // number of local dests 259 218 2, 2, // fifo depths 260 219 false, // RSP … … 263 222 264 223 ///////////////////////////////////////////////////////////////////////////// 265 xbar_m2p_c = new DspinLocalCrossbar<dspin_cmd_width>( 266 "xbar_m2p_c", 224 std::ostringstream s_xbar_m2p; 225 s_xbar_m2p << "xbar_m2p_" << x_id << "_" << y_id; 226 xbar_m2p = new DspinLocalCrossbar<dspin_cmd_width>( 227 s_xbar_m2p.str().c_str(), 267 228 mtd, // mapping table 268 229 x_id, y_id, // cluster coordinates 269 230 x_width, y_width, l_width, 270 231 1, // number of local sources 271 nb_procs, // number of local targets232 nb_procs, // number of local dests 272 233 2, 2, // fifo depths 273 234 true, // CMD … … 276 237 277 238 ///////////////////////////////////////////////////////////////////////////// 278 xbar_p2m_c = new DspinLocalCrossbar<dspin_rsp_width>( 279 "xbar_p2m_c", 239 std::ostringstream s_xbar_p2m; 240 s_xbar_p2m << "xbar_p2m_" << x_id << "_" << y_id; 241 xbar_p2m = new DspinLocalCrossbar<dspin_rsp_width>( 242 s_xbar_p2m.str().c_str(), 280 243 mtd, // mapping table 281 244 x_id, y_id, // cluster coordinates … … 289 252 290 253 ///////////////////////////////////////////////////////////////////////////// 291 xbar_clack_c = new DspinLocalCrossbar<dspin_cmd_width>( 292 "xbar_clack_c", 254 std::ostringstream s_xbar_cla; 255 s_xbar_cla << "xbar_cla_" << x_id << "_" << y_id; 256 xbar_cla = new DspinLocalCrossbar<dspin_cmd_width>( 257 s_xbar_cla.str().c_str(), 293 258 mtd, // mapping table 294 259 x_id, y_id, // cluster coordinates 295 260 x_width, y_width, l_width, 296 261 1, // number of local sources 297 nb_procs, // number of local targets298 1, 1, // fifo depths262 nb_procs, // number of local dests 263 2, 2, // fifo depths 299 264 true, // CMD 300 265 false, // don't use local routing table 301 false); // broadcast 302 303 ///////////////////////////////////////////////////////////////////////////// 304 router_cmd = new VirtualDspinRouter<dspin_cmd_width>( 305 "router_cmd", 266 false); // no broadcast 267 268 ///////////////////////////////////////////////////////////////////////////// 269 std::ostringstream s_router_cmd; 270 s_router_cmd << "router_cmd_" << x_id << "_" << y_id; 271 router_cmd = new DspinRouter<dspin_cmd_width>( 272 s_router_cmd.str().c_str(), 306 273 x_id,y_id, // coordinate in the mesh 307 274 x_width, y_width, // x & y fields width 308 3, // nb virtual channels309 275 4,4); // input & output fifo depths 310 276 311 277 ///////////////////////////////////////////////////////////////////////////// 312 router_rsp = new VirtualDspinRouter<dspin_rsp_width>( 313 "router_rsp", 278 std::ostringstream s_router_rsp; 279 s_router_rsp << "router_rsp_" << x_id << "_" << y_id; 280 router_rsp = new DspinRouter<dspin_rsp_width>( 281 s_router_rsp.str().c_str(), 314 282 x_id,y_id, // coordinates in mesh 315 283 x_width, y_width, // x & y fields width 316 2, // nb virtual channels317 284 4,4); // input & output fifo depths 318 285 319 // IO cluster components 320 if (io) 321 { 322 ///////////////////////////////////////////// 323 fbuf = new VciFrameBuffer<vci_param_int>( 324 "fbuf", 325 IntTab(cluster_xy, tgtid_fbuf), 326 mtd, 327 xfb, yfb); 328 329 wt_fbuf = new VciDspinTargetWrapper<vci_param_int, 330 dspin_cmd_width, 331 dspin_rsp_width>( 332 "wt_fbuf", 333 x_width + y_width + l_width); 334 286 ///////////////////////////////////////////////////////////////////////////// 287 std::ostringstream s_router_m2p; 288 s_router_m2p << "router_m2p_" << x_id << "_" << y_id; 289 router_m2p = new DspinRouter<dspin_cmd_width>( 290 s_router_m2p.str().c_str(), 291 x_id,y_id, // coordinate in the mesh 292 x_width, y_width, // x & y fields width 293 4,4, // input & output fifo depths 294 true); // broadcast supported 295 296 ///////////////////////////////////////////////////////////////////////////// 297 std::ostringstream s_router_p2m; 298 s_router_p2m << "router_p2m_" << x_id << "_" << y_id; 299 router_p2m = new DspinRouter<dspin_rsp_width>( 300 s_router_p2m.str().c_str(), 301 x_id,y_id, // coordinates in mesh 302 x_width, y_width, // x & y fields width 303 4,4); // input & output fifo depths 304 305 ///////////////////////////////////////////////////////////////////////////// 306 std::ostringstream s_router_cla; 307 s_router_cla << "router_cla_" << x_id << "_" << y_id; 308 router_cla = new DspinRouter<dspin_cmd_width>( 309 s_router_cla.str().c_str(), 310 x_id,y_id, // coordinate in the mesh 311 x_width, y_width, // x & y fields width 312 4,4); // input & output fifo depths 313 314 if ((x_id == 0) and (y_id == 0)) 315 { 335 316 ///////////////////////////////////////////// 336 317 bdev = new VciBlockDeviceTsar<vci_param_int>( 337 318 "bdev", 338 319 mtd, 339 IntTab(cluster_xy, nb_procs + 1),320 IntTab(cluster_xy, nb_procs), 340 321 IntTab(cluster_xy, tgtid_bdev), 341 disk_ name,342 block_size,343 64 ); // burst size322 disk_pathname, 323 512, 324 64 ); // burst size 344 325 345 326 wt_bdev = new VciDspinTargetWrapper<vci_param_int, … … 355 336 x_width + y_width + l_width); 356 337 357 //////////////////////////////////////358 mnic = new VciMultiNic<vci_param_int>(359 "mnic",360 IntTab(cluster_xy, tgtid_mnic),361 mtd,362 nic_channels,363 0xBEEF0000, // mac_4 address364 0xBABE, // mac_2 address365 nic_rx_name,366 nic_tx_name);367 368 wt_mnic = new VciDspinTargetWrapper<vci_param_int,369 dspin_cmd_width,370 dspin_rsp_width>(371 "wt_mnic",372 x_width + y_width + l_width);373 374 338 ///////////////////////////////////////////// 375 chbuf = new VciChbufDma<vci_param_int>(376 "chbuf_dma",377 mtd,378 IntTab(cluster_xy, nb_procs + 2),379 IntTab(cluster_xy, tgtid_chbuf),380 64,381 chbufdma_channels);382 383 wt_chbuf = new VciDspinTargetWrapper<vci_param_int,384 dspin_cmd_width,385 dspin_rsp_width>(386 "wt_chbuf",387 x_width + y_width + l_width);388 389 wi_chbuf = new VciDspinInitiatorWrapper<vci_param_int,390 dspin_cmd_width,391 dspin_rsp_width>(392 "wi_chbuf",393 x_width + y_width + l_width);394 395 /////////////////////////////////////////////396 std::vector<std::string> vect_names;397 for (size_t tid = 0; tid < nb_ttys; tid++)398 {399 std::ostringstream term_name;400 term_name << "term" << tid;401 vect_names.push_back(term_name.str().c_str());402 }403 339 mtty = new VciMultiTty<vci_param_int>( 404 340 "mtty", 405 341 IntTab(cluster_xy, tgtid_mtty), 406 342 mtd, 407 vect_names);343 "tty_0_0", NULL ); 408 344 409 345 wt_mtty = new VciDspinTargetWrapper<vci_param_int, … … 412 348 "wt_mtty", 413 349 x_width + y_width + l_width); 414 415 //////////////////////////////////////////// 416 simhelper = new VciSimhelper<vci_param_int>( 417 "sim_helper", 418 IntTab(cluster_xy, tgtid_simh), 419 mtd); 420 421 wt_simhelper = new VciDspinTargetWrapper<vci_param_int, 422 dspin_cmd_width, 423 dspin_rsp_width>( 424 "wt_simhelper", 425 x_width + y_width + l_width); 426 } 350 } 351 352 std::cout << std::endl; 427 353 428 354 //////////////////////////////////// … … 430 356 //////////////////////////////////// 431 357 432 //////////////////////// CMD ROUTER and RSP ROUTER 433 router_cmd->p_clk (this->p_clk); 434 router_cmd->p_resetn (this->p_resetn); 435 router_rsp->p_clk (this->p_clk); 436 router_rsp->p_resetn (this->p_resetn); 437 438 for (int i = 0; i < 4; i++) 439 { 440 for (int k = 0; k < 3; k++) 441 { 442 router_cmd->p_out[i][k] (this->p_cmd_out[i][k]); 443 router_cmd->p_in[i][k] (this->p_cmd_in[i][k]); 444 } 445 446 for (int k = 0; k < 2; k++) 447 { 448 router_rsp->p_out[i][k] (this->p_rsp_out[i][k]); 449 router_rsp->p_in[i][k] (this->p_rsp_in[i][k]); 450 } 451 } 452 453 router_cmd->p_out[4][0] (signal_dspin_cmd_g2l_d); 454 router_cmd->p_out[4][1] (signal_dspin_m2p_g2l_c); 455 router_cmd->p_out[4][2] (signal_dspin_clack_g2l_c); 456 router_cmd->p_in[4][0] (signal_dspin_cmd_l2g_d); 457 router_cmd->p_in[4][1] (signal_dspin_m2p_l2g_c); 458 router_cmd->p_in[4][2] (signal_dspin_clack_l2g_c); 459 460 router_rsp->p_out[4][0] (signal_dspin_rsp_g2l_d); 461 router_rsp->p_out[4][1] (signal_dspin_p2m_g2l_c); 462 router_rsp->p_in[4][0] (signal_dspin_rsp_l2g_d); 463 router_rsp->p_in[4][1] (signal_dspin_p2m_l2g_c); 464 465 466 std::cout << " - CMD & RSP routers connected" << std::endl; 358 //////////////////////// ROUTERS 359 router_cmd->p_clk (this->p_clk); 360 router_cmd->p_resetn (this->p_resetn); 361 router_rsp->p_clk (this->p_clk); 362 router_rsp->p_resetn (this->p_resetn); 363 router_m2p->p_clk (this->p_clk); 364 router_m2p->p_resetn (this->p_resetn); 365 router_p2m->p_clk (this->p_clk); 366 router_p2m->p_resetn (this->p_resetn); 367 router_cla->p_clk (this->p_clk); 368 router_cla->p_resetn (this->p_resetn); 369 370 // loop on N/S/E/W ports 371 for (size_t i = 0; i < 4; i++) 372 { 373 router_cmd->p_out[i] (this->p_cmd_out[i]); 374 router_cmd->p_in[i] (this->p_cmd_in[i]); 375 376 router_rsp->p_out[i] (this->p_rsp_out[i]); 377 router_rsp->p_in[i] (this->p_rsp_in[i]); 378 379 router_m2p->p_out[i] (this->p_m2p_out[i]); 380 router_m2p->p_in[i] (this->p_m2p_in[i]); 381 382 router_p2m->p_out[i] (this->p_p2m_out[i]); 383 router_p2m->p_in[i] (this->p_p2m_in[i]); 384 385 router_cla->p_out[i] (this->p_cla_out[i]); 386 router_cla->p_in[i] (this->p_cla_in[i]); 387 } 388 389 router_cmd->p_out[4] (signal_dspin_cmd_g2l_d); 390 router_cmd->p_in[4] (signal_dspin_cmd_l2g_d); 391 392 router_rsp->p_out[4] (signal_dspin_rsp_g2l_d); 393 router_rsp->p_in[4] (signal_dspin_rsp_l2g_d); 394 395 router_m2p->p_out[4] (signal_dspin_m2p_g2l_c); 396 router_m2p->p_in[4] (signal_dspin_m2p_l2g_c); 397 398 router_p2m->p_out[4] (signal_dspin_p2m_g2l_c); 399 router_p2m->p_in[4] (signal_dspin_p2m_l2g_c); 400 401 router_cla->p_out[4] (signal_dspin_clack_g2l_c); 402 router_cla->p_in[4] (signal_dspin_clack_l2g_c); 403 404 std::cout << " - routers connected" << std::endl; 467 405 468 406 ///////////////////// CMD DSPIN local crossbar direct 469 xbar_cmd_d->p_clk (this->p_clk); 470 xbar_cmd_d->p_resetn (this->p_resetn); 471 xbar_cmd_d->p_global_out (signal_dspin_cmd_l2g_d); 472 xbar_cmd_d->p_global_in (signal_dspin_cmd_g2l_d); 473 474 xbar_cmd_d->p_local_out[tgtid_memc] (signal_dspin_cmd_memc_t); 475 xbar_cmd_d->p_local_out[tgtid_xicu] (signal_dspin_cmd_xicu_t); 476 xbar_cmd_d->p_local_out[tgtid_mdma] (signal_dspin_cmd_mdma_t); 477 478 xbar_cmd_d->p_local_in[nb_procs] (signal_dspin_cmd_mdma_i); 407 xbar_cmd->p_clk (this->p_clk); 408 xbar_cmd->p_resetn (this->p_resetn); 409 xbar_cmd->p_global_out (signal_dspin_cmd_l2g_d); 410 xbar_cmd->p_global_in (signal_dspin_cmd_g2l_d); 411 412 xbar_cmd->p_local_out[tgtid_memc] (signal_dspin_cmd_memc_t); 413 xbar_cmd->p_local_out[tgtid_xicu] (signal_dspin_cmd_xicu_t); 479 414 480 415 for (size_t p = 0; p < nb_procs; p++) 481 xbar_cmd_d->p_local_in[p] (signal_dspin_cmd_proc_i[p]); 482 483 if (io) 484 { 485 xbar_cmd_d->p_local_out[tgtid_mtty] (signal_dspin_cmd_mtty_t); 486 xbar_cmd_d->p_local_out[tgtid_bdev] (signal_dspin_cmd_bdev_t); 487 xbar_cmd_d->p_local_out[tgtid_fbuf] (signal_dspin_cmd_fbuf_t); 488 xbar_cmd_d->p_local_out[tgtid_mnic] (signal_dspin_cmd_mnic_t); 489 xbar_cmd_d->p_local_out[tgtid_chbuf] (signal_dspin_cmd_chbuf_t); 490 xbar_cmd_d->p_local_out[tgtid_simh] (signal_dspin_cmd_simh_t); 491 492 xbar_cmd_d->p_local_in[nb_procs + 1] (signal_dspin_cmd_bdev_i); 493 xbar_cmd_d->p_local_in[nb_procs + 2] (signal_dspin_cmd_chbuf_i); 494 } 495 496 std::cout << " - Command Direct crossbar connected" << std::endl; 416 xbar_cmd->p_local_in[p] (signal_dspin_cmd_proc_i[p]); 417 418 if ((x_id == 0) and (y_id == 0)) // cluster(0,0) 419 { 420 xbar_cmd->p_local_out[tgtid_mtty] (signal_dspin_cmd_mtty_t); 421 xbar_cmd->p_local_out[tgtid_bdev] (signal_dspin_cmd_bdev_t); 422 423 xbar_cmd->p_local_in[nb_procs] (signal_dspin_cmd_bdev_i); 424 } 425 426 std::cout << " - CMD Direct crossbar connected" << std::endl; 497 427 498 428 //////////////////////// RSP DSPIN local crossbar direct 499 xbar_rsp_d->p_clk (this->p_clk); 500 xbar_rsp_d->p_resetn (this->p_resetn); 501 xbar_rsp_d->p_global_out (signal_dspin_rsp_l2g_d); 502 xbar_rsp_d->p_global_in (signal_dspin_rsp_g2l_d); 503 504 xbar_rsp_d->p_local_in[tgtid_memc] (signal_dspin_rsp_memc_t); 505 xbar_rsp_d->p_local_in[tgtid_xicu] (signal_dspin_rsp_xicu_t); 506 xbar_rsp_d->p_local_in[tgtid_mdma] (signal_dspin_rsp_mdma_t); 507 508 xbar_rsp_d->p_local_out[nb_procs] (signal_dspin_rsp_mdma_i); 429 xbar_rsp->p_clk (this->p_clk); 430 xbar_rsp->p_resetn (this->p_resetn); 431 xbar_rsp->p_global_out (signal_dspin_rsp_l2g_d); 432 xbar_rsp->p_global_in (signal_dspin_rsp_g2l_d); 433 434 xbar_rsp->p_local_in[tgtid_memc] (signal_dspin_rsp_memc_t); 435 xbar_rsp->p_local_in[tgtid_xicu] (signal_dspin_rsp_xicu_t); 509 436 510 437 for (size_t p = 0; p < nb_procs; p++) 511 xbar_rsp_d->p_local_out[p] (signal_dspin_rsp_proc_i[p]); 512 513 if (io) 514 { 515 xbar_rsp_d->p_local_in[tgtid_mtty] (signal_dspin_rsp_mtty_t); 516 xbar_rsp_d->p_local_in[tgtid_bdev] (signal_dspin_rsp_bdev_t); 517 xbar_rsp_d->p_local_in[tgtid_fbuf] (signal_dspin_rsp_fbuf_t); 518 xbar_rsp_d->p_local_in[tgtid_mnic] (signal_dspin_rsp_mnic_t); 519 xbar_rsp_d->p_local_in[tgtid_chbuf] (signal_dspin_rsp_chbuf_t); 520 xbar_rsp_d->p_local_in[tgtid_simh] (signal_dspin_rsp_simh_t); 521 522 xbar_rsp_d->p_local_out[nb_procs + 1] (signal_dspin_rsp_bdev_i); 523 xbar_rsp_d->p_local_out[nb_procs + 2] (signal_dspin_rsp_chbuf_i); 524 } 525 526 std::cout << " - Response Direct crossbar connected" << std::endl; 438 xbar_rsp->p_local_out[p] (signal_dspin_rsp_proc_i[p]); 439 440 if ((x_id == 0) and (y_id == 0)) // cluster(0,0) 441 { 442 xbar_rsp->p_local_in[tgtid_mtty] (signal_dspin_rsp_mtty_t); 443 xbar_rsp->p_local_in[tgtid_bdev] (signal_dspin_rsp_bdev_t); 444 445 xbar_rsp->p_local_out[nb_procs] (signal_dspin_rsp_bdev_i); 446 } 447 448 std::cout << " - RSP Direct crossbar connected" << std::endl; 527 449 528 450 ////////////////////// M2P DSPIN local crossbar coherence 529 xbar_m2p _c->p_clk (this->p_clk);530 xbar_m2p _c->p_resetn (this->p_resetn);531 xbar_m2p _c->p_global_out (signal_dspin_m2p_l2g_c);532 xbar_m2p _c->p_global_in (signal_dspin_m2p_g2l_c);533 xbar_m2p _c->p_local_in[0] (signal_dspin_m2p_memc);451 xbar_m2p->p_clk (this->p_clk); 452 xbar_m2p->p_resetn (this->p_resetn); 453 xbar_m2p->p_global_out (signal_dspin_m2p_l2g_c); 454 xbar_m2p->p_global_in (signal_dspin_m2p_g2l_c); 455 xbar_m2p->p_local_in[0] (signal_dspin_m2p_memc); 534 456 for (size_t p = 0; p < nb_procs; p++) 535 xbar_m2p _c->p_local_out[p] (signal_dspin_m2p_proc[p]);457 xbar_m2p->p_local_out[p] (signal_dspin_m2p_proc[p]); 536 458 537 459 std::cout << " - M2P Coherence crossbar connected" << std::endl; 538 460 461 ////////////////////////// P2M DSPIN local crossbar coherence 462 xbar_p2m->p_clk (this->p_clk); 463 xbar_p2m->p_resetn (this->p_resetn); 464 xbar_p2m->p_global_out (signal_dspin_p2m_l2g_c); 465 xbar_p2m->p_global_in (signal_dspin_p2m_g2l_c); 466 xbar_p2m->p_local_out[0] (signal_dspin_p2m_memc); 467 for (size_t p = 0; p < nb_procs; p++) 468 xbar_p2m->p_local_in[p] (signal_dspin_p2m_proc[p]); 469 470 std::cout << " - P2M Coherence crossbar connected" << std::endl; 471 539 472 ////////////////////// CLACK DSPIN local crossbar coherence 540 xbar_cla ck_c->p_clk (this->p_clk);541 xbar_cla ck_c->p_resetn (this->p_resetn);542 xbar_cla ck_c->p_global_out (signal_dspin_clack_l2g_c);543 xbar_cla ck_c->p_global_in (signal_dspin_clack_g2l_c);544 xbar_cla ck_c->p_local_in[0] (signal_dspin_clack_memc);473 xbar_cla->p_clk (this->p_clk); 474 xbar_cla->p_resetn (this->p_resetn); 475 xbar_cla->p_global_out (signal_dspin_clack_l2g_c); 476 xbar_cla->p_global_in (signal_dspin_clack_g2l_c); 477 xbar_cla->p_local_in[0] (signal_dspin_clack_memc); 545 478 for (size_t p = 0; p < nb_procs; p++) 546 xbar_clack_c->p_local_out[p] (signal_dspin_clack_proc[p]); 547 548 std::cout << " - Clack Coherence crossbar connected" << std::endl; 549 550 ////////////////////////// P2M DSPIN local crossbar coherence 551 xbar_p2m_c->p_clk (this->p_clk); 552 xbar_p2m_c->p_resetn (this->p_resetn); 553 xbar_p2m_c->p_global_out (signal_dspin_p2m_l2g_c); 554 xbar_p2m_c->p_global_in (signal_dspin_p2m_g2l_c); 555 xbar_p2m_c->p_local_out[0] (signal_dspin_p2m_memc); 556 for (size_t p = 0; p < nb_procs; p++) 557 xbar_p2m_c->p_local_in[p] (signal_dspin_p2m_proc[p]); 558 559 std::cout << " - P2M Coherence crossbar connected" << std::endl; 560 479 xbar_cla->p_local_out[p] (signal_dspin_clack_proc[p]); 480 481 std::cout << " - CLA Coherence crossbar connected" << std::endl; 561 482 562 483 //////////////////////////////////// Processors … … 569 490 proc[p]->p_dspin_p2m (signal_dspin_p2m_proc[p]); 570 491 proc[p]->p_dspin_clack (signal_dspin_clack_proc[p]); 571 proc[p]->p_irq[0] (signal_proc_it[p]); 572 for ( size_t j = 1; j < 6 ; j++)492 493 for ( size_t j = 0 ; j < 6 ; j++) 573 494 { 574 proc[p]->p_irq[j] (signal_false); 495 if ( j < 4 ) proc[p]->p_irq[j] (signal_proc_irq[4*p + j]); 496 else proc[p]->p_irq[j] (signal_false); 575 497 } 576 498 … … 588 510 xicu->p_resetn (this->p_resetn); 589 511 xicu->p_vci (signal_vci_tgt_xicu); 590 for (size_t p = 0; p < nb_procs; p++) 591 { 592 xicu->p_irq[p] (signal_proc_it[p]); 593 } 594 595 for (size_t i = 0; i < 32; i++) 596 { 597 if (io) // I/O cluster 512 513 for (size_t i = 0 ; i < 16 ; i++) 514 { 515 xicu->p_irq[i] (signal_proc_irq[i]); 516 } 517 518 for (size_t i = 0; i < 16; i++) 519 { 520 if ((x_id == 0) and (y_id == 0)) // cluster (0,0) 598 521 { 599 if (i == 0) xicu->p_hwi[i] (signal_irq_bdev); 600 else if (i < 8) xicu->p_hwi[i] (signal_false); 601 else if (i < (8 + nb_dmas)) xicu->p_hwi[i] (signal_irq_mdma[i - 8]); 602 else if (i < 12) xicu->p_hwi[i] (signal_false); 603 else if (i == 12) xicu->p_hwi[i] (signal_irq_memc); 604 else if (i < 16) xicu->p_hwi[i] (signal_false); 605 else if (i < (16 + nb_ttys)) xicu->p_hwi[i] (signal_irq_mtty[i - 16]); 606 else xicu->p_hwi[i] (signal_false); 522 if (i == 8) xicu->p_hwi[i] (signal_irq_memc); 523 else if (i == 9) xicu->p_hwi[i] (signal_irq_bdev); 524 else if (i == 10) xicu->p_hwi[i] (signal_irq_mtty); 525 else xicu->p_hwi[i] (signal_false); 607 526 } 608 else // other clusters527 else // other clusters 609 528 { 610 if (i < 8) xicu->p_hwi[i] (signal_false); 611 else if (i < (8 + nb_dmas)) xicu->p_hwi[i] (signal_irq_mdma[i - 8]); 612 else if (i < 12) xicu->p_hwi[i] (signal_false); 613 else if (i == 12) xicu->p_hwi[i] (signal_irq_memc); 614 else xicu->p_hwi[i] (signal_false); 529 if (i == 1) xicu->p_hwi[i] (signal_irq_memc); 530 else xicu->p_hwi[i] (signal_false); 615 531 } 616 532 } … … 651 567 std::cout << " - XRAM connected" << std::endl; 652 568 653 ////////////////////////////////////////////// MDMA 654 mdma->p_clk (this->p_clk); 655 mdma->p_resetn (this->p_resetn); 656 mdma->p_vci_target (signal_vci_tgt_mdma); 657 mdma->p_vci_initiator (signal_vci_ini_mdma); 658 for (size_t i = 0; i < nb_dmas; i++) 659 mdma->p_irq[i] (signal_irq_mdma[i]); 660 661 // wrapper tgt MDMA 662 wt_mdma->p_clk (this->p_clk); 663 wt_mdma->p_resetn (this->p_resetn); 664 wt_mdma->p_dspin_cmd (signal_dspin_cmd_mdma_t); 665 wt_mdma->p_dspin_rsp (signal_dspin_rsp_mdma_t); 666 wt_mdma->p_vci (signal_vci_tgt_mdma); 667 668 // wrapper ini MDMA 669 wi_mdma->p_clk (this->p_clk); 670 wi_mdma->p_resetn (this->p_resetn); 671 wi_mdma->p_dspin_cmd (signal_dspin_cmd_mdma_i); 672 wi_mdma->p_dspin_rsp (signal_dspin_rsp_mdma_i); 673 wi_mdma->p_vci (signal_vci_ini_mdma); 674 675 std::cout << " - MDMA connected" << std::endl; 676 677 /////////////////////////////// Components in I/O cluster 678 679 if (io) 569 /////////////////////////////// Extra Components in cluster(0,0) 570 571 if ((x_id == 0) and (y_id == 0)) 680 572 { 681 573 // BDEV … … 702 594 std::cout << " - BDEV connected" << std::endl; 703 595 704 // FBUF 705 fbuf->p_clk (this->p_clk); 706 fbuf->p_resetn (this->p_resetn); 707 fbuf->p_vci (signal_vci_tgt_fbuf); 708 709 // wrapper tgt FBUF 710 wt_fbuf->p_clk (this->p_clk); 711 wt_fbuf->p_resetn (this->p_resetn); 712 wt_fbuf->p_dspin_cmd (signal_dspin_cmd_fbuf_t); 713 wt_fbuf->p_dspin_rsp (signal_dspin_rsp_fbuf_t); 714 wt_fbuf->p_vci (signal_vci_tgt_fbuf); 715 716 std::cout << " - FBUF connected" << std::endl; 717 718 // MNIC 719 mnic->p_clk (this->p_clk); 720 mnic->p_resetn (this->p_resetn); 721 mnic->p_vci (signal_vci_tgt_mnic); 722 for (size_t i = 0; i < nic_channels; i++) 723 { 724 mnic->p_rx_irq[i] (signal_irq_mnic_rx[i]); 725 mnic->p_tx_irq[i] (signal_irq_mnic_tx[i]); 726 } 727 728 // wrapper tgt MNIC 729 wt_mnic->p_clk (this->p_clk); 730 wt_mnic->p_resetn (this->p_resetn); 731 wt_mnic->p_dspin_cmd (signal_dspin_cmd_mnic_t); 732 wt_mnic->p_dspin_rsp (signal_dspin_rsp_mnic_t); 733 wt_mnic->p_vci (signal_vci_tgt_mnic); 734 735 std::cout << " - MNIC connected" << std::endl; 736 737 // CHBUF 738 chbuf->p_clk (this->p_clk); 739 chbuf->p_resetn (this->p_resetn); 740 chbuf->p_vci_target (signal_vci_tgt_chbuf); 741 chbuf->p_vci_initiator (signal_vci_ini_chbuf); 742 for (size_t i = 0; i < chbufdma_channels; i++) 743 { 744 chbuf->p_irq[i] (signal_irq_chbuf[i]); 745 } 746 747 // wrapper tgt CHBUF 748 wt_chbuf->p_clk (this->p_clk); 749 wt_chbuf->p_resetn (this->p_resetn); 750 wt_chbuf->p_dspin_cmd (signal_dspin_cmd_chbuf_t); 751 wt_chbuf->p_dspin_rsp (signal_dspin_rsp_chbuf_t); 752 wt_chbuf->p_vci (signal_vci_tgt_chbuf); 753 754 // wrapper ini CHBUF 755 wi_chbuf->p_clk (this->p_clk); 756 wi_chbuf->p_resetn (this->p_resetn); 757 wi_chbuf->p_dspin_cmd (signal_dspin_cmd_chbuf_i); 758 wi_chbuf->p_dspin_rsp (signal_dspin_rsp_chbuf_i); 759 wi_chbuf->p_vci (signal_vci_ini_chbuf); 760 761 std::cout << " - CHBUF connected" << std::endl; 762 763 // MTTY 596 // MTTY (single channel) 764 597 mtty->p_clk (this->p_clk); 765 598 mtty->p_resetn (this->p_resetn); 766 599 mtty->p_vci (signal_vci_tgt_mtty); 767 for (size_t i = 0; i < nb_ttys; i++) 768 { 769 mtty->p_irq[i] (signal_irq_mtty[i]); 770 } 600 mtty->p_irq[0] (signal_irq_mtty); 771 601 772 602 // wrapper tgt MTTY … … 777 607 wt_mtty->p_vci (signal_vci_tgt_mtty); 778 608 779 780 // Sim Helper781 simhelper->p_clk (this->p_clk);782 simhelper->p_resetn (this->p_resetn);783 simhelper->p_vci (signal_vci_tgt_simh);784 785 // wrapper tgt Sim Helper786 wt_simhelper->p_clk (this->p_clk);787 wt_simhelper->p_resetn (this->p_resetn);788 wt_simhelper->p_dspin_cmd (signal_dspin_cmd_simh_t);789 wt_simhelper->p_dspin_rsp (signal_dspin_rsp_simh_t);790 wt_simhelper->p_vci (signal_vci_tgt_simh);791 792 609 std::cout << " - MTTY connected" << std::endl; 793 }610 } 794 611 } // end constructor 795 612 … … 804 621 vci_param_ext>::~TsarLetiCluster() { 805 622 806 dealloc_elems<DspinInput<dspin_cmd_width> > (p_cmd_in, 4, 3); 807 dealloc_elems<DspinOutput<dspin_cmd_width> >(p_cmd_out, 4, 3); 808 dealloc_elems<DspinInput<dspin_rsp_width> > (p_rsp_in, 4, 2); 809 dealloc_elems<DspinOutput<dspin_rsp_width> >(p_rsp_out, 4, 2); 810 811 for (size_t p = 0; p < n_procs; p++) 812 { 813 delete proc[p]; 814 delete wi_proc[p]; 623 dealloc_elems<DspinInput<dspin_cmd_width> > (p_cmd_in, 4); 624 dealloc_elems<DspinOutput<dspin_cmd_width> >(p_cmd_out, 4); 625 626 dealloc_elems<DspinInput<dspin_rsp_width> > (p_rsp_in, 4); 627 dealloc_elems<DspinOutput<dspin_rsp_width> >(p_rsp_out, 4); 628 629 dealloc_elems<DspinInput<dspin_cmd_width> > (p_m2p_in, 4); 630 dealloc_elems<DspinOutput<dspin_cmd_width> >(p_m2p_out, 4); 631 632 dealloc_elems<DspinInput<dspin_rsp_width> > (p_p2m_in, 4); 633 dealloc_elems<DspinOutput<dspin_rsp_width> >(p_p2m_out, 4); 634 635 dealloc_elems<DspinInput<dspin_cmd_width> > (p_cla_in, 4); 636 dealloc_elems<DspinOutput<dspin_cmd_width> >(p_cla_out, 4); 637 638 for (size_t p = 0; p < 4 ; p++) 639 { 640 if ( proc[p] ) delete proc[p]; 641 if ( wi_proc[p] ) delete wi_proc[p]; 815 642 } 816 643 … … 820 647 delete xicu; 821 648 delete wt_xicu; 822 delete mdma; 823 delete wt_mdma; 824 delete wi_mdma; 825 delete xbar_cmd_d; 826 delete xbar_rsp_d; 827 delete xbar_m2p_c; 828 delete xbar_p2m_c; 829 delete xbar_clack_c; 649 delete xbar_cmd; 650 delete xbar_rsp; 651 delete xbar_m2p; 652 delete xbar_p2m; 653 delete xbar_cla; 830 654 delete router_cmd; 831 655 delete router_rsp; 832 if (bdev != NULL) 833 { 834 delete fbuf; 835 delete wt_fbuf; 656 delete router_m2p; 657 delete router_p2m; 658 delete router_cla; 659 660 if ( bdev ) 661 { 836 662 delete bdev; 837 663 delete wt_bdev; 838 664 delete wi_bdev; 839 delete mnic; 840 delete wt_mnic; 841 delete chbuf; 842 delete wt_chbuf; 843 delete wi_chbuf; 665 } 666 667 if ( mtty ) 668 { 844 669 delete mtty; 845 670 delete wt_mtty; 846 delete simhelper;847 delete wt_simhelper;848 671 } 849 672 }
Note: See TracChangeset
for help on using the changeset viewer.