Changeset 718
- Timestamp:
- Jun 24, 2014, 10:15:26 AM (11 years ago)
- Location:
- trunk/platforms/tsar_generic_iob
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_iob/top.cpp
r714 r718 1 1 /////////////////////////////////////////////////////////////////////////////// 2 2 // File: top.cpp (for tsar_generic_iob platform) 3 // Author: Alain Greiner 3 // Author: Alain Greiner 4 4 // Copyright: UPMC/LIP6 5 5 // Date : august 2013 6 6 // This program is released under the GNU public license 7 7 /////////////////////////////////////////////////////////////////////////////// 8 // This file define a generic TSAR architecture with an IO network emulating 8 // This file define a generic TSAR architecture with an IO network emulating 9 9 // an external bus (i.e. Hypertransport) to access 7 external peripherals: 10 10 // … … 25 25 // 26 26 // 1) the "INT" network supports Read/Write transactions 27 // between processors and L2 caches or peripherals. 27 // between processors and L2 caches or peripherals. 28 28 // (VCI ADDDRESS = 40 bits / VCI DATA width = 32 bits) 29 29 // It supports also coherence transactions between L1 & L2 caches. 30 // 3) the "RAM" network is emulatingthe 3D network between L2 caches30 // 3) the "RAM" network emulates the 3D network between L2 caches 31 31 // and L3 caches, and is implemented as a 2D mesh between the L2 caches, 32 32 // the two IO bridges and the physical RAMs disributed in all clusters. … … 35 35 // 7 external peripheral controllers. 36 36 // (VCI ADDDRESS = 40 bits / VCI DATA width = 64 bits) 37 // 38 // The external peripherals HWI IRQs are translated to WTI IRQs by the 37 // 38 // The external peripherals HWI IRQs are translated to WTI IRQs by the 39 39 // external IOPIC component, that must be configured by the OS to route 40 // these WTI ITQS to one or several internal XICU components. 40 // these WTI ITQS to one or several internal XICU components. 41 41 // The total number of channels for the external peripherals (MTTY, MNIC, CDMA 42 42 // IOC or HBA) is limited by the IOPIC 32 HWI inputs:.. 43 43 // - IOPIC HWI[1:0] connected to IRQ_NIC_RX[1:0] 44 // - IOPIC HWI[3:2] connected to IRQ_NIC_TX[1:0] 44 // - IOPIC HWI[3:2] connected to IRQ_NIC_TX[1:0] 45 45 // - IOPIC HWI[7:4] connected to IRQ_CMA_TX[3:0]] 46 46 // - IOPIC HWI[8] connected to IRQ_BDEV … … 52 52 // and one multi channels DMA component. 53 53 // The XICU component is mainly used to handle WTI IRQs, as only 2 HWI IRQs 54 // are connected to XICU in each cluster: 54 // are connected to XICU in each cluster: 55 55 // - IRQ_IN[0] : MMC 56 56 // - IRQ_IN[1] : DMA channel 0 … … 58 58 // - IRQ_IN[3] : DMA channel 2 59 59 // - IRQ_IN[4] : DMA channel 3 60 // 60 // 61 61 // All clusters are identical, but cluster(0,0) and cluster(XMAX-1,YMAX-1) 62 62 // contain an extra IO bridge component. These IOB0 & IOB1 components are 63 63 // connected to the three networks (INT, RAM, IOX). 64 // 64 // 65 65 // - It uses two dspin_local_crossbar per cluster to implement the 66 // local interconnect correponding to the INT network. 67 // - It uses t wodspin_local_crossbar per cluster to implement the68 // local interconnect correponding to the coherence INT network. 66 // local interconnect correponding to the INT network. 67 // - It uses three dspin_local_crossbar per cluster to implement the 68 // local interconnect correponding to the coherence INT network. 69 69 // - It uses two virtual_dspin_router per cluster to implement 70 70 // the INT network (routing both the direct and coherence trafic). … … 79 79 // 80 80 // The main hardware parameters must be defined in the hard_config.h file : 81 // - X_SIZE : number of clusters in a row 81 // - X_SIZE : number of clusters in a row 82 82 // - Y_SIZE : number of clusters in a column 83 83 // - NB_PROCS_MAX : number of processors per cluster (power of 2) … … 88 88 // - FBUF_Y_SIZE : heigth of frame buffer (lines) 89 89 // - XCU_NB_INPUTS : number of HWIs = number of WTIs = number of PTIs 90 // 90 // 91 91 // Some secondary hardware parameters must be defined in this top.cpp file: 92 // - XRAM_LATENCY : external ram latency 92 // - XRAM_LATENCY : external ram latency 93 93 // - MEMC_WAYS : L2 cache number of ways 94 94 // - MEMC_SETS : L2 cache number of sets 95 // - L1_IWAYS 96 // - L1_ISETS 97 // - L1_DWAYS 98 // - L1_DSETS 99 // - BDEV_IMAGE_NAME : file pathname for block device 95 // - L1_IWAYS 96 // - L1_ISETS 97 // - L1_DWAYS 98 // - L1_DSETS 99 // - BDEV_IMAGE_NAME : file pathname for block device 100 100 // - NIC_RX_NAME : file pathname for NIC received packets 101 101 // - NIC_TX_NAME : file pathname for NIC transmited packets … … 104 104 // General policy for 40 bits physical address decoding: 105 105 // All physical segments base addresses are multiple of 1 Mbytes 106 // (=> the 24 LSB bits = 0, and the 16 MSB bits define the target) 106 // (=> the 24 LSB bits = 0, and the 16 MSB bits define the target) 107 107 // The (x_width + y_width) MSB bits (left aligned) define 108 108 // the cluster index, and the LADR bits define the local index: … … 159 159 160 160 /////////////////////////////////////////////////////////// 161 // DSPIN parameters 161 // DSPIN parameters 162 162 /////////////////////////////////////////////////////////// 163 163 … … 169 169 170 170 /////////////////////////////////////////////////////////// 171 // VCI fields width for the 3 VCI networks 171 // VCI fields width for the 3 VCI networks 172 172 /////////////////////////////////////////////////////////// 173 173 … … 186 186 187 187 //////////////////////////////////////////////////////////// 188 // Main Hardware Parameters values 188 // Main Hardware Parameters values 189 189 //////////////////////i///////////////////////////////////// 190 190 … … 192 192 193 193 //////////////////////////////////////////////////////////// 194 // Secondary Hardware Parameters values 194 // Secondary Hardware Parameters values 195 195 //////////////////////i///////////////////////////////////// 196 196 … … 223 223 224 224 //////////////////////////////////////////////////////////// 225 // Software to be loaded in ROM & RAM 225 // Software to be loaded in ROM & RAM 226 226 //////////////////////i///////////////////////////////////// 227 227 … … 229 229 230 230 //////////////////////////////////////////////////////////// 231 // DEBUG Parameters default values 231 // DEBUG Parameters default values 232 232 //////////////////////i///////////////////////////////////// 233 233 … … 238 238 ///////////////////////////////////////////////////////// 239 239 240 // Non replicated peripherals (must be in cluster 0) 241 242 #define BROM_BASE 0x00BFC00000 243 #define BROM_SIZE 0x0000100000 // 1 M Kbytes 244 245 #define IOBX_BASE 0x00BE000000 246 #define IOBX_SIZE 0x0000001000 // 4 Kbytes 247 248 #define BDEV_BASE 0x00B3000000 249 #define BDEV_SIZE 0x0000001000 // 4 Kbytes 250 251 #define MTTY_BASE 0x00B4000000 252 #define MTTY_SIZE 0x0000001000 // 4 Kbytes 253 254 #define MNIC_BASE 0x00B5000000 255 #define MNIC_SIZE 0x0000080000 // 512 Kbytes 256 257 #define CDMA_BASE 0x00B6000000 258 #define CDMA_SIZE 0x0000001000 * (NB_CMA_CHANNELS) // 4 Kbytes per channel 259 260 #define FBUF_BASE 0x00B7000000 261 #define FBUF_SIZE FBUF_X_SIZE * FBUF_Y_SIZE 262 263 #define IOPI_BASE 0x00B8000000 264 #define IOPI_SIZE 0x0000001000 // 4 Kbytes 265 266 // Replicated peripherals : address is incremented by a cluster offset 240 // Replicated RAMs : address is incremented by a cluster offset 267 241 // offset = cluster(x,y) << (address_width-x_width-y_width); 268 242 269 #define XRAM_BASE 0x0000000000 270 #define XRAM_SIZE 0x0004000000 // 64 Mbytes 271 272 #define XICU_BASE 0x00B0000000 273 #define XICU_SIZE 0x0000001000 // 4 Kbytes 274 275 #define MDMA_BASE 0x00B1000000 276 #define MDMA_SIZE 0x0000001000 * NB_DMA_CHANNELS // 4 Kbytes per channel 277 278 // Replicated memory segments (XRAM) : address is incremented by a cluster offset 279 // offset = cluster(x,y) << (address_width-x_width-y_width); 280 281 #define MEMC_BASE 0x00B2000000 282 #define MEMC_SIZE 0x0000001000 // 4 Kbytes 243 #define SEG_RAM_BASE 0x0000000000 244 #define SEG_RAM_SIZE 0x0004000000 // 64 Mbytes 283 245 284 246 //////////////////////////////////////////////////////////////////////// … … 289 251 // - The 10 MSB bits define the cluster index (left aligned) 290 252 // - The 4 LSB bits define the local index. 291 // Two different initiators cannot have the same SRCID, but a given 292 // initiator can have two alias SRCIDs: 253 // Two different initiators cannot have the same SRCID, but a given 254 // initiator can have two alias SRCIDs: 293 255 // - Internal initiators (procs, mdma) are replicated in all clusters, 294 256 // and each initiator has one single SRCID. 295 257 // - External initiators (bdev, cdma) are not replicated, but can be 296 // accessed in 2 clusters : cluster_iob0 and cluster_iob1. 258 // accessed in 2 clusters : cluster_iob0 and cluster_iob1. 297 259 // They have the same local index, but two different cluster indexes. 298 260 // 299 261 // As cluster_iob0 and cluster_iob1 contain both internal initiators 300 // and external initiators, they must have different local indexes. 262 // and external initiators, they must have different local indexes. 301 263 // Consequence: For a local interconnect, the INI_ID port index 302 264 // is NOT equal to the SRCID local index, and the local interconnect 303 // must make a translation: SRCID => INI_ID 265 // must make a translation: SRCID => INI_ID 304 266 //////////////////////////////////////////////////////////////////////// 305 267 … … 308 270 #define IOBX_LOCAL_SRCID 0x9 309 271 #define MEMC_LOCAL_SRCID 0xA 272 #define CDMA_LOCAL_SRCID 0xB 273 #define BDEV_LOCAL_SRCID 0xC 310 274 #define IOPI_LOCAL_SRCID 0xD 311 #define CDMA_LOCAL_SRCID 0xE // hard-coded in dspin_tsar312 #define BDEV_LOCAL_SRCID 0xF // hard-coded in dspin_tsar313 275 314 276 /////////////////////////////////////////////////////////////////////// … … 338 300 /////////////////////////////////////////////////////////////////////// 339 301 340 #define IOX_ IOB0_TGT_ID 0 // don't change this value341 #define IOX_ IOB1_TGT_ID 1 // don't change this value342 #define IOX_ FBUF_TGT_ID 2343 #define IOX_ BDEV_TGT_ID 3344 #define IOX_ MNIC_TGT_ID 4345 #define IOX_ CDMA_TGT_ID 5346 #define IOX_ BROM_TGT_ID 6347 #define IOX_ MTTY_TGT_ID 7348 #define IOX_IO PI_TGT_ID 8349 350 #define IOX_ IOB0_INI_ID 0 // Don't change this value351 #define IOX_ IOB1_INI_ID 1 // Don't change this value352 #define IOX_ BDEV_INI_ID 2353 #define IOX_ CDMA_INI_ID 3354 #define IOX_IO PI_INI_ID 4302 #define IOX_FBUF_TGT_ID 0 303 #define IOX_BDEV_TGT_ID 1 304 #define IOX_MNIC_TGT_ID 2 305 #define IOX_CDMA_TGT_ID 3 306 #define IOX_BROM_TGT_ID 4 307 #define IOX_MTTY_TGT_ID 5 308 #define IOX_IOPI_TGT_ID 6 309 #define IOX_IOB0_TGT_ID 7 310 #define IOX_IOB1_TGT_ID 8 311 312 #define IOX_BDEV_INI_ID 0 313 #define IOX_CDMA_INI_ID 1 314 #define IOX_IOPI_INI_ID 2 315 #define IOX_IOB0_INI_ID 3 316 #define IOX_IOB1_INI_ID 4 355 317 356 318 //////////////////////////////////////////////////////////////////////// … … 371 333 bool debug_ok = false; // trace activated 372 334 size_t debug_period = 1; // trace period 373 size_t debug_memc_id = 0xFFFFFFFF; // index of traced memc 374 size_t debug_proc_id = 0xFFFFFFFF; // index of traced proc 375 size_t debug_xram_id = 0xFFFFFFFF; // index of traced xram 335 size_t debug_memc_id = 0xFFFFFFFF; // index of traced memc 336 size_t debug_proc_id = 0xFFFFFFFF; // index of traced proc 337 size_t debug_xram_id = 0xFFFFFFFF; // index of traced xram 376 338 bool debug_iob = false; // trace iob0 & iob1 when true 377 339 uint32_t debug_from = 0; // trace start cycle … … 384 346 assert( (X_WIDTH == 4) and (Y_WIDTH == 4) and 385 347 "ERROR: we must have X_WIDTH == Y_WIDTH == 4"); 386 348 387 349 ////////////// command line arguments ////////////////////// 388 350 if (argc > 1) … … 536 498 vci_plen_width, 537 499 vci_address_width, 538 vci_rerror_width, 500 vci_rerror_width, 539 501 vci_clen_width, 540 502 vci_rflag_width, … … 551 513 // - 4 local targets (MEMC, XICU, MDMA, IOBX) per cluster 552 514 ///////////////////////////////////////////////////////////////////// 553 MappingTable maptab_int( vci_address_width, 554 IntTab(x_width + y_width, 16 - x_width - y_width), 555 IntTab(x_width + y_width, vci_srcid_width - x_width - y_width), 515 MappingTable maptab_int( vci_address_width, 516 IntTab(x_width + y_width, 16 - x_width - y_width), 517 IntTab(x_width + y_width, vci_srcid_width - x_width - y_width), 556 518 0x00FF000000); 557 519 … … 560 522 for (size_t y = 0; y < YMAX; y++) 561 523 { 562 uint64_t offset = ((uint64_t)cluster(x,y)) 524 uint64_t offset = ((uint64_t)cluster(x,y)) 563 525 << (vci_address_width-x_width-y_width); 564 526 bool config = true; … … 569 531 std::ostringstream smemc_conf; 570 532 smemc_conf << "int_seg_memc_conf_" << x << "_" << y; 571 maptab_int.add(Segment(smemc_conf.str(), MEMC_BASE+offset, MEMC_SIZE,572 IntTab(cluster(x,y), INT_MEMC_TGT_ID), not cacheable, config ));533 maptab_int.add(Segment(smemc_conf.str(), SEG_MMC_BASE+offset, SEG_MMC_SIZE, 534 IntTab(cluster(x,y), INT_MEMC_TGT_ID), not cacheable, config )); 573 535 574 536 std::ostringstream smemc_xram; 575 537 smemc_xram << "int_seg_memc_xram_" << x << "_" << y; 576 maptab_int.add(Segment(smemc_xram.str(), XRAM_BASE+offset, XRAM_SIZE,577 IntTab(cluster(x,y), INT_MEMC_TGT_ID), cacheable));538 maptab_int.add(Segment(smemc_xram.str(), SEG_RAM_BASE+offset, SEG_RAM_SIZE, 539 IntTab(cluster(x,y), INT_MEMC_TGT_ID), cacheable)); 578 540 579 541 std::ostringstream sxicu; 580 542 sxicu << "int_seg_xicu_" << x << "_" << y; 581 maptab_int.add(Segment(sxicu.str(), XICU_BASE+offset, XICU_SIZE,582 IntTab(cluster(x,y), INT_XICU_TGT_ID), not cacheable));543 maptab_int.add(Segment(sxicu.str(), SEG_XCU_BASE+offset, SEG_XCU_SIZE, 544 IntTab(cluster(x,y), INT_XICU_TGT_ID), not cacheable)); 583 545 584 546 std::ostringstream smdma; 585 547 smdma << "int_seg_mdma_" << x << "_" << y; 586 maptab_int.add(Segment(smdma.str(), MDMA_BASE+offset, MDMA_SIZE,587 IntTab(cluster(x,y), INT_MDMA_TGT_ID), not cacheable));548 maptab_int.add(Segment(smdma.str(), SEG_DMA_BASE+offset, SEG_DMA_SIZE, 549 IntTab(cluster(x,y), INT_MDMA_TGT_ID), not cacheable)); 588 550 589 551 // the following segments are only defined in cluster_iob0 or in cluster_iob1 590 552 591 if ( (cluster(x,y) == cluster_iob0) or (cluster(x,y) == cluster_iob1) ) 553 if ( (cluster(x,y) == cluster_iob0) or (cluster(x,y) == cluster_iob1) ) 592 554 { 593 555 std::ostringstream siobx; 594 556 siobx << "int_seg_iobx_" << x << "_" << y; 595 maptab_int.add(Segment(siobx.str(), IOBX_BASE+offset, IOBX_SIZE,557 maptab_int.add(Segment(siobx.str(), SEG_IOB_BASE+offset, SEG_IOB_SIZE, 596 558 IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable, config )); 597 559 598 560 std::ostringstream stty; 599 561 stty << "int_seg_mtty_" << x << "_" << y; 600 maptab_int.add(Segment(stty.str(), MTTY_BASE+offset, MTTY_SIZE,562 maptab_int.add(Segment(stty.str(), SEG_TTY_BASE+offset, SEG_TTY_SIZE, 601 563 IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable)); 602 564 603 565 std::ostringstream sfbf; 604 566 sfbf << "int_seg_fbuf_" << x << "_" << y; 605 maptab_int.add(Segment(sfbf.str(), FBUF_BASE+offset, FBUF_SIZE,567 maptab_int.add(Segment(sfbf.str(), SEG_FBF_BASE+offset, SEG_FBF_SIZE, 606 568 IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable)); 607 569 608 570 std::ostringstream sbdv; 609 571 sbdv << "int_seg_bdev_" << x << "_" << y; 610 maptab_int.add(Segment(sbdv.str(), BDEV_BASE+offset, BDEV_SIZE,572 maptab_int.add(Segment(sbdv.str(), SEG_IOC_BASE+offset, SEG_IOC_SIZE, 611 573 IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable)); 612 574 613 575 std::ostringstream snic; 614 576 snic << "int_seg_mnic_" << x << "_" << y; 615 maptab_int.add(Segment(snic.str(), MNIC_BASE+offset, MNIC_SIZE,577 maptab_int.add(Segment(snic.str(), SEG_NIC_BASE+offset, SEG_NIC_SIZE, 616 578 IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable)); 617 579 618 580 std::ostringstream srom; 619 581 srom << "int_seg_brom_" << x << "_" << y; 620 maptab_int.add(Segment(srom.str(), BROM_BASE+offset, BROM_SIZE,582 maptab_int.add(Segment(srom.str(), SEG_ROM_BASE+offset, SEG_ROM_SIZE, 621 583 IntTab(cluster(x,y), INT_IOBX_TGT_ID), cacheable )); 622 584 623 585 std::ostringstream sdma; 624 586 sdma << "int_seg_cdma_" << x << "_" << y; 625 maptab_int.add(Segment(sdma.str(), CDMA_BASE+offset, CDMA_SIZE,587 maptab_int.add(Segment(sdma.str(), SEG_CMA_BASE+offset, SEG_CMA_SIZE, 626 588 IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable)); 627 589 628 590 std::ostringstream spic; 629 591 spic << "int_seg_iopi_" << x << "_" << y; 630 maptab_int.add(Segment(spic.str(), IOPI_BASE+offset, IOPI_SIZE,592 maptab_int.add(Segment(spic.str(), SEG_PIC_BASE+offset, SEG_PIC_SIZE, 631 593 IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable)); 632 594 } … … 635 597 // and the port index on the local interconnect. 636 598 637 maptab_int.srcid_map( IntTab( cluster(x,y), MDMA_LOCAL_SRCID ), 599 maptab_int.srcid_map( IntTab( cluster(x,y), MDMA_LOCAL_SRCID ), 638 600 IntTab( cluster(x,y), INT_MDMA_INI_ID ) ); 639 601 … … 645 607 646 608 for ( size_t p = 0 ; p < NB_PROCS_MAX ; p++ ) 647 maptab_int.srcid_map( IntTab( cluster(x,y), PROC_LOCAL_SRCID+p ), 609 maptab_int.srcid_map( IntTab( cluster(x,y), PROC_LOCAL_SRCID+p ), 648 610 IntTab( cluster(x,y), INT_PROC_INI_ID+p ) ); 649 611 } … … 652 614 653 615 ///////////////////////////////////////////////////////////////////////// 654 // RAM network mapping table 616 // RAM network mapping table 655 617 // - two levels address decoding for commands 656 618 // - two levels srcid decoding for responses 657 // - 2 local initiators (MEMC, IOBX) per cluster 619 // - 2 local initiators (MEMC, IOBX) per cluster 658 620 // (IOBX component only in cluster_iob0 and cluster_iob1) 659 621 // - 1 local target (XRAM) per cluster 660 622 //////////////////////////////////////////////////////////////////////// 661 623 MappingTable maptab_ram( vci_address_width, 662 IntTab(x_width+y_width, 16 - x_width - y_width),663 IntTab(x_width+y_width, vci_srcid_width - x_width - y_width), 624 IntTab(x_width+y_width, 0), 625 IntTab(x_width+y_width, vci_srcid_width - x_width - y_width), 664 626 0x00FF000000); 665 627 … … 667 629 { 668 630 for (size_t y = 0; y < YMAX ; y++) 669 { 670 uint64_t offset = ((uint64_t)cluster(x,y)) 631 { 632 uint64_t offset = ((uint64_t)cluster(x,y)) 671 633 << (vci_address_width-x_width-y_width); 672 634 673 635 std::ostringstream sxram; 674 636 sxram << "ext_seg_xram_" << x << "_" << y; 675 maptab_ram.add(Segment(sxram.str(), XRAM_BASE+offset,676 XRAM_SIZE, IntTab(cluster(x,y), 0), false));637 maptab_ram.add(Segment(sxram.str(), SEG_RAM_BASE+offset, 638 SEG_RAM_SIZE, IntTab(cluster(x,y), RAM_XRAM_TGT_ID), false)); 677 639 } 678 640 } … … 680 642 // This define the mapping between the initiators SRCID 681 643 // and the port index on the RAM local interconnect. 682 // External initiator have two alias SRCID (iob0 / iob1) 683 684 maptab_ram.srcid_map( IntTab( cluster_iob0, CDMA_LOCAL_SRCID ), 644 // External initiator have two alias SRCID (iob0 / iob1) 645 646 maptab_ram.srcid_map( IntTab( cluster_iob0, CDMA_LOCAL_SRCID ), 685 647 IntTab( cluster_iob0, RAM_IOBX_INI_ID ) ); 686 648 687 maptab_ram.srcid_map( IntTab( cluster_iob1, CDMA_LOCAL_SRCID ), 649 maptab_ram.srcid_map( IntTab( cluster_iob1, CDMA_LOCAL_SRCID ), 688 650 IntTab( cluster_iob1, RAM_IOBX_INI_ID ) ); 689 651 … … 694 656 IntTab( cluster_iob1, RAM_IOBX_INI_ID ) ); 695 657 696 maptab_ram.srcid_map( IntTab( cluster_iob1, MEMC_LOCAL_SRCID ), 658 maptab_ram.srcid_map( IntTab( cluster_iob0, IOPI_LOCAL_SRCID ), 659 IntTab( cluster_iob0, RAM_IOBX_INI_ID ) ); 660 661 maptab_ram.srcid_map( IntTab( cluster_iob1, IOPI_LOCAL_SRCID ), 662 IntTab( cluster_iob1, RAM_IOBX_INI_ID ) ); 663 664 maptab_ram.srcid_map( IntTab( cluster_iob0, MEMC_LOCAL_SRCID ), 665 IntTab( cluster_iob0, RAM_MEMC_INI_ID ) ); 666 667 maptab_ram.srcid_map( IntTab( cluster_iob1, MEMC_LOCAL_SRCID ), 697 668 IntTab( cluster_iob1, RAM_MEMC_INI_ID ) ); 698 669 … … 700 671 701 672 /////////////////////////////////////////////////////////////////////// 702 // IOX network mapping table 703 // - two levels address decoding for commands 673 // IOX network mapping table 674 // - two levels address decoding for commands (9, 7) bits 704 675 // - two levels srcid decoding for responses 705 676 // - 5 initiators (IOB0, IOB1, BDEV, CDMA, IOPI) 706 677 // - 9 targets (IOB0, IOB1, BDEV, CDMA, MTTY, FBUF, BROM, MNIC, IOPI) 678 // 679 // Address bit 32 is used to determine if a command must be routed to 680 // IOB0 or IOB1. 707 681 /////////////////////////////////////////////////////////////////////// 708 MappingTable maptab_iox( vci_address_width, 709 IntTab(x_width+y_width, 16 - x_width - y_width), 710 IntTab(x_width+y_width, vci_srcid_width - x_width - y_width), 711 0x00FF000000); 712 713 // compute base addresses for cluster_iob0 and cluster_iob1 714 uint64_t iob0_base = ((uint64_t)cluster_iob0) << (vci_address_width - x_width - y_width); 715 uint64_t iob1_base = ((uint64_t)cluster_iob1) << (vci_address_width - x_width - y_width); 682 MappingTable maptab_iox( 683 vci_address_width, 684 IntTab(x_width + y_width - 1, 16 - x_width - y_width + 1), 685 IntTab(x_width + y_width , vci_param_ext::S - x_width - y_width), 686 0x00FF000000); 716 687 717 688 // External peripherals segments 718 // W Hen there is more than one cluster, external peripherals can be accessed689 // When there is more than one cluster, external peripherals can be accessed 719 690 // through two segments, depending on the used IOB (IOB0 or IOB1). 720 maptab_iox.add(Segment("iox_seg_mtty_0", MTTY_BASE + iob0_base, MTTY_SIZE, 721 IntTab(cluster_iob0,IOX_MTTY_TGT_ID), false)); 722 maptab_iox.add(Segment("iox_seg_fbuf_0", FBUF_BASE + iob0_base, FBUF_SIZE, 723 IntTab(cluster_iob0,IOX_FBUF_TGT_ID), false)); 724 maptab_iox.add(Segment("iox_seg_bdev_0", BDEV_BASE + iob0_base, BDEV_SIZE, 725 IntTab(cluster_iob0,IOX_BDEV_TGT_ID), false)); 726 maptab_iox.add(Segment("iox_seg_mnic_0", MNIC_BASE + iob0_base, MNIC_SIZE, 727 IntTab(cluster_iob0,IOX_MNIC_TGT_ID), false)); 728 maptab_iox.add(Segment("iox_seg_cdma_0", CDMA_BASE + iob0_base, CDMA_SIZE, 729 IntTab(cluster_iob0,IOX_CDMA_TGT_ID), false)); 730 maptab_iox.add(Segment("iox_seg_brom_0", BROM_BASE + iob0_base, BROM_SIZE, 731 IntTab(cluster_iob0,IOX_BROM_TGT_ID), false)); 732 maptab_iox.add(Segment("iox_seg_iopi_0", IOPI_BASE + iob0_base, IOPI_SIZE, 733 IntTab(cluster_iob0,IOX_IOPI_TGT_ID), false)); 734 691 692 const uint64_t iob0_base = ((uint64_t)cluster_iob0) 693 << (vci_address_width - x_width - y_width); 694 695 maptab_iox.add(Segment("iox_seg_mtty_0", SEG_TTY_BASE + iob0_base, SEG_TTY_SIZE, 696 IntTab(0, IOX_MTTY_TGT_ID), false)); 697 maptab_iox.add(Segment("iox_seg_fbuf_0", SEG_FBF_BASE + iob0_base, SEG_FBF_SIZE, 698 IntTab(0, IOX_FBUF_TGT_ID), false)); 699 maptab_iox.add(Segment("iox_seg_bdev_0", SEG_IOC_BASE + iob0_base, SEG_IOC_SIZE, 700 IntTab(0, IOX_BDEV_TGT_ID), false)); 701 maptab_iox.add(Segment("iox_seg_mnic_0", SEG_NIC_BASE + iob0_base, SEG_NIC_SIZE, 702 IntTab(0, IOX_MNIC_TGT_ID), false)); 703 maptab_iox.add(Segment("iox_seg_cdma_0", SEG_CMA_BASE + iob0_base, SEG_CMA_SIZE, 704 IntTab(0, IOX_CDMA_TGT_ID), false)); 705 maptab_iox.add(Segment("iox_seg_brom_0", SEG_ROM_BASE + iob0_base, SEG_ROM_SIZE, 706 IntTab(0, IOX_BROM_TGT_ID), false)); 707 maptab_iox.add(Segment("iox_seg_iopi_0", SEG_PIC_BASE + iob0_base, SEG_PIC_SIZE, 708 IntTab(0, IOX_IOPI_TGT_ID), false)); 709 735 710 if ( cluster_iob0 != cluster_iob1 ) 736 711 { 737 maptab_iox.add(Segment("iox_seg_mtty_1", MTTY_BASE + iob1_base, MTTY_SIZE, 738 IntTab(cluster_iob1,IOX_MTTY_TGT_ID), false)); 739 maptab_iox.add(Segment("iox_seg_fbuf_1", FBUF_BASE + iob1_base, FBUF_SIZE, 740 IntTab(cluster_iob1,IOX_FBUF_TGT_ID), false)); 741 maptab_iox.add(Segment("iox_seg_bdev_1", BDEV_BASE + iob1_base, BDEV_SIZE, 742 IntTab(cluster_iob1,IOX_BDEV_TGT_ID), false)); 743 maptab_iox.add(Segment("iox_seg_mnic_1", MNIC_BASE + iob1_base, MNIC_SIZE, 744 IntTab(cluster_iob1,IOX_MNIC_TGT_ID), false)); 745 maptab_iox.add(Segment("iox_seg_cdma_1", CDMA_BASE + iob1_base, CDMA_SIZE, 746 IntTab(cluster_iob1,IOX_CDMA_TGT_ID), false)); 747 maptab_iox.add(Segment("iox_seg_brom_1", BROM_BASE + iob1_base, BROM_SIZE, 748 IntTab(cluster_iob1,IOX_BROM_TGT_ID), false)); 749 maptab_iox.add(Segment("iox_seg_iopi_1", IOPI_BASE + iob1_base, IOPI_SIZE, 750 IntTab(cluster_iob1,IOX_IOPI_TGT_ID), false)); 712 const uint64_t iob1_base = ((uint64_t)cluster_iob1) 713 << (vci_address_width - x_width - y_width); 714 715 maptab_iox.add(Segment("iox_seg_mtty_1", SEG_TTY_BASE + iob1_base, SEG_TTY_SIZE, 716 IntTab(0, IOX_MTTY_TGT_ID), false)); 717 maptab_iox.add(Segment("iox_seg_fbuf_1", SEG_FBF_BASE + iob1_base, SEG_FBF_SIZE, 718 IntTab(0, IOX_FBUF_TGT_ID), false)); 719 maptab_iox.add(Segment("iox_seg_bdev_1", SEG_IOC_BASE + iob1_base, SEG_IOC_SIZE, 720 IntTab(0, IOX_BDEV_TGT_ID), false)); 721 maptab_iox.add(Segment("iox_seg_mnic_1", SEG_NIC_BASE + iob1_base, SEG_NIC_SIZE, 722 IntTab(0, IOX_MNIC_TGT_ID), false)); 723 maptab_iox.add(Segment("iox_seg_cdma_1", SEG_CMA_BASE + iob1_base, SEG_CMA_SIZE, 724 IntTab(0, IOX_CDMA_TGT_ID), false)); 725 maptab_iox.add(Segment("iox_seg_brom_1", SEG_ROM_BASE + iob1_base, SEG_ROM_SIZE, 726 IntTab(0, IOX_BROM_TGT_ID), false)); 727 maptab_iox.add(Segment("iox_seg_iopi_1", SEG_PIC_BASE + iob1_base, SEG_PIC_SIZE, 728 IntTab(0, IOX_IOPI_TGT_ID), false)); 751 729 } 752 730 753 // If there is more than one cluster, external peripherals 731 // If there is more than one cluster, external peripherals 754 732 // can access RAM through two segments (IOB0 / IOB1). 755 733 // As IOMMU is not activated, addresses are 40 bits (physical addresses), 756 // and the choice depends on address bit A[3 9].734 // and the choice depends on address bit A[32]. 757 735 for (size_t x = 0; x < XMAX; x++) 758 736 { 759 737 for (size_t y = 0; y < YMAX ; y++) 760 { 761 uint64_t offset = ((uint64_t)cluster(x,y)) 762 << (vci_address_width-x_width-y_width); 763 764 if ( (cluster_iob0 != cluster_iob1) and (x >= (XMAX/2)) ) // use IOB1 738 { 739 const bool wti = true; 740 const bool cacheable = true; 741 742 const uint64_t offset = ((uint64_t)cluster(x,y)) 743 << (vci_address_width-x_width-y_width); 744 745 const uint64_t xicu_base = SEG_XCU_BASE + offset; 746 747 if ( (y & 0x1) == 0 ) // use IOB0 765 748 { 749 std::ostringstream sxcu0; 750 sxcu0 << "iox_seg_xcu0_" << x << "_" << y; 751 maptab_iox.add(Segment(sxcu0.str(), xicu_base, SEG_XCU_SIZE, 752 IntTab(0, IOX_IOB0_TGT_ID), not cacheable, wti)); 753 754 std::ostringstream siob0; 755 siob0 << "iox_seg_ram0_" << x << "_" << y; 756 maptab_iox.add(Segment(siob0.str(), offset, SEG_XCU_BASE, 757 IntTab(0, IOX_IOB0_TGT_ID), not cacheable, not wti)); 758 } 759 else // USE IOB1 760 { 761 std::ostringstream sxcu1; 762 sxcu1 << "iox_seg_xcu1_" << x << "_" << y; 763 maptab_iox.add(Segment(sxcu1.str(), xicu_base, SEG_XCU_SIZE, 764 IntTab(0, IOX_IOB1_TGT_ID), not cacheable, wti)); 765 766 766 std::ostringstream siob1; 767 siob1 << "iox_seg_xram_" << x << "_" << y; 768 maptab_iox.add(Segment(siob1.str(), offset, XRAM_SIZE, 769 IntTab(cluster_iob1,IOX_IOB1_TGT_ID), false)); 770 } 771 else // USE IOB0 772 { 773 std::ostringstream siob0; 774 siob0 << "iox_seg_xram_" << x << "_" << y; 775 maptab_iox.add(Segment(siob0.str(), offset, XRAM_SIZE, 776 IntTab(cluster_iob0,IOX_IOB0_TGT_ID), false)); 767 siob1 << "iox_seg_ram1_" << x << "_" << y; 768 maptab_iox.add(Segment(siob1.str(), offset, SEG_XCU_BASE, 769 IntTab(0, IOX_IOB1_TGT_ID), not cacheable, not wti)); 777 770 } 778 771 } … … 781 774 // This define the mapping between the external initiators (SRCID) 782 775 // and the port index on the IOX local interconnect. 783 // If there is more than one cluster, external initiators 784 // have two alias SRCID (iob0 / iob1 access) 785 maptab_iox.srcid_map( IntTab( cluster_iob0, CDMA_LOCAL_SRCID ), 786 IntTab( cluster_iob0, IOX_CDMA_INI_ID ) ); 787 maptab_iox.srcid_map( IntTab( cluster_iob0, BDEV_LOCAL_SRCID ), 788 IntTab( cluster_iob0, IOX_BDEV_INI_ID ) ); 789 maptab_iox.srcid_map( IntTab( cluster_iob0, IOPI_LOCAL_SRCID ), 790 IntTab( cluster_iob0, IOX_IOPI_INI_ID ) ); 776 777 maptab_iox.srcid_map( IntTab( 0, CDMA_LOCAL_SRCID ) , 778 IntTab( 0, IOX_CDMA_INI_ID ) ); 779 maptab_iox.srcid_map( IntTab( 0, BDEV_LOCAL_SRCID ) , 780 IntTab( 0, IOX_BDEV_INI_ID ) ); 781 maptab_iox.srcid_map( IntTab( 0, IOPI_LOCAL_SRCID ) , 782 IntTab( 0, IOX_IOPI_INI_ID ) ); 783 maptab_iox.srcid_map( IntTab( 0, IOX_IOB0_INI_ID ) , 784 IntTab( 0, IOX_IOB0_INI_ID ) ); 791 785 792 786 if ( cluster_iob0 != cluster_iob1 ) 793 787 { 794 maptab_iox.srcid_map( IntTab( cluster_iob1, CDMA_LOCAL_SRCID ), 795 IntTab( cluster_iob1, IOX_CDMA_INI_ID ) ); 796 maptab_iox.srcid_map( IntTab( cluster_iob1, BDEV_LOCAL_SRCID ), 797 IntTab( cluster_iob1, IOX_BDEV_INI_ID ) ); 798 maptab_iox.srcid_map( IntTab( cluster_iob1, BDEV_LOCAL_SRCID ), 799 IntTab( cluster_iob1, IOX_IOPI_INI_ID ) ); 800 } 801 802 // This define the mapping between the internal initiators (SRCID) 803 // and the port index on the IOX local interconnect. 804 // If there is more than one cluster, external initiators 805 806 for (size_t x = 0; x < XMAX; x++) 807 { 808 for (size_t y = 0; y < YMAX ; y++) 809 { 810 if ( (cluster_iob0 != cluster_iob1) and (x >= (XMAX/2)) ) // use IOB1 811 { 812 for (size_t p = 0 ; p < NB_PROCS_MAX ; p++) 813 maptab_iox.srcid_map( IntTab( cluster(x,y), PROC_LOCAL_SRCID + p ), 814 IntTab( cluster_iob1, IOX_IOB1_INI_ID ) ); 815 816 maptab_iox.srcid_map( IntTab( cluster(x,y), MDMA_LOCAL_SRCID ), 817 IntTab( cluster_iob1, IOX_IOB1_INI_ID ) ); 818 } 819 else // USE IOB0 820 { 821 for (size_t p = 0 ; p < NB_PROCS_MAX ; p++) 822 maptab_iox.srcid_map( IntTab( cluster(x,y), PROC_LOCAL_SRCID + p ), 823 IntTab( cluster_iob0, IOX_IOB0_INI_ID ) ); 824 825 maptab_iox.srcid_map( IntTab( cluster(x,y), MDMA_LOCAL_SRCID ), 826 IntTab( cluster_iob0, IOX_IOB0_INI_ID ) ); 827 } 828 } 788 maptab_iox.srcid_map( IntTab( 0, IOX_IOB1_INI_ID ) , 789 IntTab( 0, IOX_IOB1_INI_ID ) ); 829 790 } 830 791 … … 844 805 sc_signal<bool> signal_irq_mnic_tx[NB_NIC_CHANNELS]; 845 806 sc_signal<bool> signal_irq_cdma[NB_CMA_CHANNELS]; 846 847 // DSPIN signals for loopback in cluster_iob0 & cluster_iob1848 DspinSignals<dspin_ram_cmd_width> signal_dspin_cmd_iob0_loopback;849 DspinSignals<dspin_ram_rsp_width> signal_dspin_rsp_iob0_loopback;850 DspinSignals<dspin_ram_cmd_width> signal_dspin_cmd_iob1_loopback;851 DspinSignals<dspin_ram_rsp_width> signal_dspin_rsp_iob1_loopback;852 807 853 808 // VCI signals for IOX network … … 868 823 VciSignals<vci_param_ext> signal_vci_tgt_iopi("signal_vci_ini_iopi"); 869 824 870 // Horizontal inter-clusters INT network DSPIN 825 // Horizontal inter-clusters INT network DSPIN 871 826 DspinSignals<dspin_int_cmd_width>*** signal_dspin_int_cmd_h_inc = 872 827 alloc_elems<DspinSignals<dspin_int_cmd_width> >("signal_dspin_int_cmd_h_inc", XMAX-1, YMAX, 3); … … 888 843 alloc_elems<DspinSignals<dspin_int_rsp_width> >("signal_dspin_int_rsp_v_dec", XMAX, YMAX-1, 2); 889 844 890 // Mesh boundaries INT network DSPIN 845 // Mesh boundaries INT network DSPIN 891 846 DspinSignals<dspin_int_cmd_width>**** signal_dspin_false_int_cmd_in = 892 847 alloc_elems<DspinSignals<dspin_int_cmd_width> >("signal_dspin_false_int_cmd_in", XMAX, YMAX, 4, 3); … … 899 854 900 855 901 // Horizontal inter-clusters RAM network DSPIN 856 // Horizontal inter-clusters RAM network DSPIN 902 857 DspinSignals<dspin_ram_cmd_width>** signal_dspin_ram_cmd_h_inc = 903 858 alloc_elems<DspinSignals<dspin_ram_cmd_width> >("signal_dspin_ram_cmd_h_inc", XMAX-1, YMAX); … … 919 874 alloc_elems<DspinSignals<dspin_ram_rsp_width> >("signal_dspin_ram_rsp_v_dec", XMAX, YMAX-1); 920 875 921 // Mesh boundaries RAM network DSPIN 876 // Mesh boundaries RAM network DSPIN 922 877 DspinSignals<dspin_ram_cmd_width>*** signal_dspin_false_ram_cmd_in = 923 878 alloc_elems<DspinSignals<dspin_ram_cmd_width> >("signal_dspin_false_ram_cmd_in", XMAX, YMAX, 4); … … 930 885 931 886 //////////////////////////// 932 // Loader 887 // Loader 933 888 //////////////////////////// 934 889 … … 950 905 std::cout << std::endl << "External Bus and Peripherals" << std::endl << std::endl; 951 906 907 const size_t nb_iox_initiators = (cluster_iob0 != cluster_iob1) ? 5 : 4; 908 const size_t nb_iox_targets = (cluster_iob0 != cluster_iob1) ? 9 : 8; 909 952 910 // IOX network 953 911 VciIoxNetwork<vci_param_ext>* iox_network; 954 iox_network = new VciIoxNetwork<vci_param_ext>( "iox_network", 912 iox_network = new VciIoxNetwork<vci_param_ext>( "iox_network", 955 913 maptab_iox, 956 9, // number of targets957 5 ); // number of initiators914 nb_iox_targets, 915 nb_iox_initiators ); 958 916 // boot ROM 959 917 VciSimpleRom<vci_param_ext>* brom; … … 991 949 disk_name, 992 950 512, // block size 993 64, // burst size (bytes) 994 0 ); // disk latency 951 64, // burst size (bytes) 952 0 ); // disk latency 995 953 996 954 // Chained Buffer DMA controller … … 1013 971 mtty = new VciMultiTty<vci_param_ext>( "mtty", 1014 972 IntTab(0, IOX_MTTY_TGT_ID), 1015 maptab_iox, 973 maptab_iox, 1016 974 vect_names); 1017 975 … … 1022 980 IntTab(0, IOPI_LOCAL_SRCID), 1023 981 IntTab(0, IOX_IOPI_TGT_ID), 1024 32 ); // number of input HWI 1025 // Clusters 982 32 ); // number of input HWI 983 // Clusters 1026 984 TsarIobCluster<vci_param_int, 1027 985 vci_param_ext, … … 1048 1006 std::cout << "Cluster_" << std::dec << x << "_" << y << std::endl; 1049 1007 std::cout << std::endl; 1008 1009 const bool is_iob0 = (cluster(x,y) == cluster_iob0); 1010 const bool is_iob1 = (cluster(x,y) == cluster_iob1); 1011 const bool is_io_cluster = is_iob0 || is_iob1; 1012 1013 const int iox_iob_ini_id = is_iob0 ? 1014 IOX_IOB0_INI_ID : 1015 IOX_IOB1_INI_ID ; 1016 const int iox_iob_tgt_id = is_iob0 ? 1017 IOX_IOB0_TGT_ID : 1018 IOX_IOB1_TGT_ID ; 1050 1019 1051 1020 std::ostringstream sc; … … 1088 1057 RAM_IOBX_INI_ID, 1089 1058 1059 is_io_cluster, 1060 iox_iob_tgt_id, 1061 iox_iob_ini_id, 1062 1090 1063 MEMC_WAYS, 1091 1064 MEMC_SETS, … … 1117 1090 1118 1091 /////////////////////////////////////////////////////////////////////////////// 1119 // Net-list 1092 // Net-list 1120 1093 /////////////////////////////////////////////////////////////////////////////// 1121 1094 … … 1124 1097 iox_network->p_resetn (signal_resetn); 1125 1098 iox_network->p_to_ini[IOX_IOB0_INI_ID] (signal_vci_ini_iob0); 1126 iox_network->p_to_ini[IOX_IOB1_INI_ID] (signal_vci_ini_iob1);1127 1099 iox_network->p_to_ini[IOX_BDEV_INI_ID] (signal_vci_ini_bdev); 1128 1100 iox_network->p_to_ini[IOX_CDMA_INI_ID] (signal_vci_ini_cdma); … … 1130 1102 1131 1103 iox_network->p_to_tgt[IOX_IOB0_TGT_ID] (signal_vci_tgt_iob0); 1132 iox_network->p_to_tgt[IOX_IOB1_TGT_ID] (signal_vci_tgt_iob1);1133 1104 iox_network->p_to_tgt[IOX_MTTY_TGT_ID] (signal_vci_tgt_mtty); 1134 1105 iox_network->p_to_tgt[IOX_FBUF_TGT_ID] (signal_vci_tgt_fbuf); … … 1139 1110 iox_network->p_to_tgt[IOX_IOPI_TGT_ID] (signal_vci_tgt_iopi); 1140 1111 1112 if (cluster_iob0 != cluster_iob1) 1113 { 1114 iox_network->p_to_ini[IOX_IOB1_INI_ID] (signal_vci_ini_iob1); 1115 iox_network->p_to_tgt[IOX_IOB1_TGT_ID] (signal_vci_tgt_iob1); 1116 } 1117 1141 1118 // BDEV connexion 1142 1119 bdev->p_clk (signal_clk); 1143 1120 bdev->p_resetn (signal_resetn); 1144 1121 bdev->p_irq (signal_irq_bdev); … … 1178 1155 mtty->p_resetn (signal_resetn); 1179 1156 mtty->p_vci (signal_vci_tgt_mtty); 1180 mtty->p_irq[0] 1157 mtty->p_irq[0] (signal_irq_mtty_rx); 1181 1158 1182 1159 std::cout << " - MTTY connected" << std::endl; 1183 1160 1184 1161 // CDMA connexion 1185 cdma->p_clk 1186 cdma->p_resetn 1187 cdma->p_vci_target 1188 cdma->p_vci_initiator 1162 cdma->p_clk (signal_clk); 1163 cdma->p_resetn (signal_resetn); 1164 cdma->p_vci_target (signal_vci_tgt_cdma); 1165 cdma->p_vci_initiator (signal_vci_ini_cdma); 1189 1166 for ( size_t i=0 ; i<(NB_NIC_CHANNELS*2) ; i++) 1190 1167 { 1191 cdma->p_irq[i] (signal_irq_cdma[i]);1168 cdma->p_irq[i] (signal_irq_cdma[i]); 1192 1169 } 1193 1170 … … 1195 1172 1196 1173 // IOPI connexion 1197 iopi->p_clk 1198 iopi->p_resetn 1199 iopi->p_vci_target 1200 iopi->p_vci_initiator 1174 iopi->p_clk (signal_clk); 1175 iopi->p_resetn (signal_resetn); 1176 iopi->p_vci_target (signal_vci_tgt_iopi); 1177 iopi->p_vci_initiator (signal_vci_ini_iopi); 1201 1178 for ( size_t i=0 ; i<32 ; i++) 1202 1179 { … … 1214 1191 std::cout << " - IOPIC connected" << std::endl; 1215 1192 1216 1193 1217 1194 // IOB0 cluster connexion to IOX network 1218 (*clusters[0][0]->p_vci_iob_iox_ini) 1219 (*clusters[0][0]->p_vci_iob_iox_tgt) 1220 1221 // IOB1 cluster connexion to IOX network 1195 (*clusters[0][0]->p_vci_iob_iox_ini) (signal_vci_ini_iob0); 1196 (*clusters[0][0]->p_vci_iob_iox_tgt) (signal_vci_tgt_iob0); 1197 1198 // IOB1 cluster connexion to IOX network 1222 1199 // (only when there is more than 1 cluster) 1223 1200 if ( cluster_iob0 != cluster_iob1 ) … … 1272 1249 } 1273 1250 1274 std::cout << std::endl << "Horizontal connections established" << std::endl; 1251 std::cout << std::endl << "Horizontal connections established" << std::endl; 1275 1252 1276 1253 // Inter Clusters vertical connections 1277 if (YMAX > 1) 1254 if (YMAX > 1) 1278 1255 { 1279 1256 for (size_t y = 0; y < (YMAX-1); y++) … … 1330 1307 } 1331 1308 1332 if( y == 0 ) // handling IOB to RAM network connection in cluster_iob0 1333 { 1334 (*clusters[0][0]->p_dspin_iob_cmd_out) (signal_dspin_cmd_iob0_loopback); 1335 clusters[0][0]->p_dspin_ram_cmd_in[WEST] (signal_dspin_cmd_iob0_loopback); 1336 1337 clusters[0][0]->p_dspin_ram_cmd_out[WEST] (signal_dspin_false_ram_cmd_out[0][0][WEST]); 1338 clusters[0][0]->p_dspin_ram_rsp_in[WEST] (signal_dspin_false_ram_rsp_in[0][0][WEST]); 1339 1340 clusters[0][0]->p_dspin_ram_rsp_out[WEST] (signal_dspin_rsp_iob0_loopback); 1341 (*clusters[0][0]->p_dspin_iob_rsp_in) (signal_dspin_rsp_iob0_loopback); 1342 1343 } 1344 else 1345 { 1346 clusters[0][y]->p_dspin_ram_cmd_in[WEST] (signal_dspin_false_ram_cmd_in[0][y][WEST]); 1347 clusters[0][y]->p_dspin_ram_cmd_out[WEST] (signal_dspin_false_ram_cmd_out[0][y][WEST]); 1348 clusters[0][y]->p_dspin_ram_rsp_in[WEST] (signal_dspin_false_ram_rsp_in[0][y][WEST]); 1349 clusters[0][y]->p_dspin_ram_rsp_out[WEST] (signal_dspin_false_ram_rsp_out[0][y][WEST]); 1350 } 1351 1352 if( (y == YMAX-1) and (cluster_iob0 != cluster_iob1) ) // handling IOB to RAM network connection in cluster_iob1 1353 { 1354 (*clusters[XMAX-1][YMAX-1]->p_dspin_iob_cmd_out) (signal_dspin_cmd_iob1_loopback); 1355 clusters[XMAX-1][YMAX-1]->p_dspin_ram_cmd_in[EAST] (signal_dspin_cmd_iob1_loopback); 1356 1357 clusters[XMAX-1][YMAX-1]->p_dspin_ram_cmd_out[EAST] (signal_dspin_false_ram_cmd_out[XMAX-1][YMAX-1][EAST]); 1358 clusters[XMAX-1][YMAX-1]->p_dspin_ram_rsp_in[EAST] (signal_dspin_false_ram_rsp_in[XMAX-1][YMAX-1][EAST]); 1359 1360 clusters[XMAX-1][YMAX-1]->p_dspin_ram_rsp_out[EAST] (signal_dspin_rsp_iob1_loopback); 1361 (*clusters[XMAX-1][YMAX-1]->p_dspin_iob_rsp_in) (signal_dspin_rsp_iob1_loopback); 1362 } 1363 else 1364 { 1365 clusters[XMAX-1][y]->p_dspin_ram_cmd_in[EAST] (signal_dspin_false_ram_cmd_in[XMAX-1][y][EAST]); 1366 clusters[XMAX-1][y]->p_dspin_ram_cmd_out[EAST] (signal_dspin_false_ram_cmd_out[XMAX-1][y][EAST]); 1367 clusters[XMAX-1][y]->p_dspin_ram_rsp_in[EAST] (signal_dspin_false_ram_rsp_in[XMAX-1][y][EAST]); 1368 clusters[XMAX-1][y]->p_dspin_ram_rsp_out[EAST] (signal_dspin_false_ram_rsp_out[XMAX-1][y][EAST]); 1369 } 1309 clusters[0][y]->p_dspin_ram_cmd_in[WEST] (signal_dspin_false_ram_cmd_in[0][y][WEST]); 1310 clusters[0][y]->p_dspin_ram_cmd_out[WEST] (signal_dspin_false_ram_cmd_out[0][y][WEST]); 1311 clusters[0][y]->p_dspin_ram_rsp_in[WEST] (signal_dspin_false_ram_rsp_in[0][y][WEST]); 1312 clusters[0][y]->p_dspin_ram_rsp_out[WEST] (signal_dspin_false_ram_rsp_out[0][y][WEST]); 1313 1314 clusters[XMAX-1][y]->p_dspin_ram_cmd_in[EAST] (signal_dspin_false_ram_cmd_in[XMAX-1][y][EAST]); 1315 clusters[XMAX-1][y]->p_dspin_ram_cmd_out[EAST] (signal_dspin_false_ram_cmd_out[XMAX-1][y][EAST]); 1316 clusters[XMAX-1][y]->p_dspin_ram_rsp_in[EAST] (signal_dspin_false_ram_rsp_in[XMAX-1][y][EAST]); 1317 clusters[XMAX-1][y]->p_dspin_ram_rsp_out[EAST] (signal_dspin_false_ram_rsp_out[XMAX-1][y][EAST]); 1370 1318 } 1371 1319 … … 1391 1339 } 1392 1340 1393 clusters[x][0]->p_dspin_ram_cmd_in[SOUTH] 1394 clusters[x][0]->p_dspin_ram_cmd_out[SOUTH] 1395 clusters[x][0]->p_dspin_ram_rsp_in[SOUTH] 1396 clusters[x][0]->p_dspin_ram_rsp_out[SOUTH] 1397 1398 clusters[x][YMAX-1]->p_dspin_ram_cmd_in[NORTH] 1399 clusters[x][YMAX-1]->p_dspin_ram_cmd_out[NORTH] 1400 clusters[x][YMAX-1]->p_dspin_ram_rsp_in[NORTH] 1401 clusters[x][YMAX-1]->p_dspin_ram_rsp_out[NORTH] 1341 clusters[x][0]->p_dspin_ram_cmd_in[SOUTH] (signal_dspin_false_ram_cmd_in[x][0][SOUTH]); 1342 clusters[x][0]->p_dspin_ram_cmd_out[SOUTH] (signal_dspin_false_ram_cmd_out[x][0][SOUTH]); 1343 clusters[x][0]->p_dspin_ram_rsp_in[SOUTH] (signal_dspin_false_ram_rsp_in[x][0][SOUTH]); 1344 clusters[x][0]->p_dspin_ram_rsp_out[SOUTH] (signal_dspin_false_ram_rsp_out[x][0][SOUTH]); 1345 1346 clusters[x][YMAX-1]->p_dspin_ram_cmd_in[NORTH] (signal_dspin_false_ram_cmd_in[x][YMAX-1][NORTH]); 1347 clusters[x][YMAX-1]->p_dspin_ram_cmd_out[NORTH] (signal_dspin_false_ram_cmd_out[x][YMAX-1][NORTH]); 1348 clusters[x][YMAX-1]->p_dspin_ram_rsp_in[NORTH] (signal_dspin_false_ram_rsp_in[x][YMAX-1][NORTH]); 1349 clusters[x][YMAX-1]->p_dspin_ram_rsp_out[NORTH] (signal_dspin_false_ram_rsp_out[x][YMAX-1][NORTH]); 1402 1350 } 1403 1351 … … 1411 1359 1412 1360 signal_resetn = false; 1413 1414 1361 signal_irq_false = false; 1415 1362 1416 // only one cluster case:1417 if ( cluster_iob0 == cluster_iob1 )1418 {1419 signal_vci_ini_iob1.cmdval = false;1420 signal_vci_ini_iob1.rspack = true;1421 signal_vci_tgt_iob1.cmdack = true;1422 signal_vci_tgt_iob1.rspval = false;1423 }1424 1425 1363 // network boundaries signals 1426 1364 for (size_t x = 0; x < XMAX ; x++) … … 1478 1416 uint64_t ms2 = (uint64_t) t2.tv_sec * 1000ULL + 1479 1417 (uint64_t) t2.tv_usec / 1000; 1480 std::cerr << "### cycle = " << n 1481 << " / frequency = " 1482 << (double) 5000000 / (double) (ms2 - ms1) << "Khz"1418 std::cerr << "### cycle = " << n 1419 << " / frequency = " 1420 << (double) 1000000 / (double) (ms2 - ms1) << "Khz" 1483 1421 << std::endl; 1484 1422 … … 1500 1438 std::cout << " ************************************************" << std::endl; 1501 1439 1502 // trace proc[debug_proc_id] 1440 // trace proc[debug_proc_id] 1503 1441 if ( debug_proc_id != 0xFFFFFFFF ) 1504 1442 { … … 1523 1461 // clusters[x][y]->signal_int_vci_tgt_mdma.print_trace(mdma_signame.str()); 1524 1462 1525 if( clusters[x][y]->signal_proc_it[l].read() ) 1463 if( clusters[x][y]->signal_proc_it[l].read() ) 1526 1464 std::cout << "### IRQ_PROC_" << std::dec 1527 1465 << x << "_" << y << "_" << l << " ACTIVE" << std::endl; 1528 } 1529 1530 // trace memc[debug_memc_id] 1466 } 1467 1468 // trace memc[debug_memc_id] 1531 1469 if ( debug_memc_id != 0xFFFFFFFF ) 1532 1470 { 1533 1471 size_t x = debug_memc_id >> 4; 1534 1472 size_t y = debug_memc_id & 0xF; 1535 1473 1536 1474 clusters[x][y]->memc->print_trace(0); 1537 1475 std::ostringstream smemc_tgt; … … 1554 1492 size_t x = debug_xram_id >> 4; 1555 1493 size_t y = debug_xram_id & 0xF; 1556 1494 1557 1495 clusters[x][y]->xram->print_trace(); 1558 1496 std::ostringstream sxram_tgt; … … 1563 1501 clusters[x][y]->ram_router_rsp->print_trace(); 1564 1502 } 1565 1566 // trace iob, iox and external peripherals 1503 1504 // trace iob, iox and external peripherals 1567 1505 if ( debug_iob ) 1568 1506 { 1569 1507 clusters[0][0]->iob->print_trace(); 1570 clusters[0][0]->signal_int_vci_tgt_iobx.print_trace( "[SIG]IOB0_INT_TGT"); 1571 clusters[0][0]->signal_int_vci_ini_iobx.print_trace( "[SIG]IOB0_INT_INI"); 1572 clusters[0][0]->signal_ram_vci_ini_iobx.print_trace( "[SIG]IOB0_RAM_INI"); 1508 clusters[XMAX-1][YMAX-1]->iob->print_trace(); 1509 // clusters[0][0]->signal_int_vci_tgt_iobx.print_trace( "[SIG]IOB0_INT_TGT"); 1510 // clusters[0][0]->signal_int_vci_ini_iobx.print_trace( "[SIG]IOB0_INT_INI"); 1511 // clusters[0][0]->signal_ram_vci_ini_iobx.print_trace( "[SIG]IOB0_RAM_INI"); 1573 1512 1574 1513 signal_vci_ini_iob0.print_trace("[SIG]IOB0_IOX_INI"); 1575 1514 signal_vci_tgt_iob0.print_trace("[SIG]IOB0_IOX_TGT"); 1576 1577 // signal_dspin_cmd_iob0_loopback.print_trace("[SIG]IOB0_CMD_LOOPBACK");1578 // signal_dspin_rsp_iob0_loopback.print_trace("[SIG]IOB0_RSP_LOOPBACK");1579 1515 1580 1516 // cdma->print_trace(); -
trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/metadata/tsar_iob_cluster.sd
r693 r718 59 59 flit_width = parameter.Reference('dspin_int_rsp_width')), 60 60 61 Uses('caba:dspin_local_crossbar', 62 flit_width = parameter.Reference('dspin_ram_cmd_width')), 63 64 Uses('caba:dspin_local_crossbar', 65 flit_width = parameter.Reference('dspin_ram_rsp_width')), 66 61 67 Uses('caba:vci_dspin_initiator_wrapper', 62 68 cell_size = parameter.Reference('vci_data_width_int'), … … 86 92 dspin_rsp_width = parameter.Reference('dspin_ram_rsp_width')), 87 93 88 Uses('caba:dspin_router _tsar',94 Uses('caba:dspin_router', 89 95 flit_width = parameter.Reference('dspin_ram_cmd_width')), 90 96 91 Uses('caba:dspin_router _tsar',97 Uses('caba:dspin_router', 92 98 flit_width = parameter.Reference('dspin_ram_rsp_width')), 93 99 -
trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/include/tsar_iob_cluster.h
r714 r718 26 26 #include "vci_dspin_initiator_wrapper.h" 27 27 #include "vci_dspin_target_wrapper.h" 28 #include "dspin_router _tsar.h"28 #include "dspin_router.h" 29 29 #include "virtual_dspin_router.h" 30 30 #include "vci_multi_dma.h" … … 57 57 soclib::caba::VciTarget<vci_param_ext>* p_vci_iob_iox_tgt; 58 58 59 // These ports are used to connect IOB to RAM network in top cell60 soclib::caba::DspinOutput<dspin_ram_cmd_width>* p_dspin_iob_cmd_out;61 soclib::caba::DspinInput<dspin_ram_rsp_width>* p_dspin_iob_rsp_in;62 63 59 // These arrays of ports are used to connect the INT & RAM networks in top cell 64 60 soclib::caba::DspinOutput<dspin_int_cmd_width>** p_dspin_int_cmd_out; … … 116 112 VciSignals<vci_param_ext> signal_ram_vci_tgt_xram; 117 113 118 // RAM network DSPIN signals between VCI/DSPIN wrappers and routers 114 // RAM network DSPIN signals between VCI/DSPIN wrappers, RAM dspin crossbar 115 // and routers 119 116 DspinSignals<dspin_ram_cmd_width> signal_ram_dspin_cmd_xram_t; 120 117 DspinSignals<dspin_ram_rsp_width> signal_ram_dspin_rsp_xram_t; 121 118 DspinSignals<dspin_ram_cmd_width> signal_ram_dspin_cmd_memc_i; 122 119 DspinSignals<dspin_ram_rsp_width> signal_ram_dspin_rsp_memc_i; 120 DspinSignals<dspin_ram_cmd_width> signal_ram_dspin_cmd_iob_i; 121 DspinSignals<dspin_ram_rsp_width> signal_ram_dspin_rsp_iob_i; 122 DspinSignals<dspin_ram_cmd_width> signal_ram_dspin_cmd_xbar; 123 DspinSignals<dspin_ram_rsp_width> signal_ram_dspin_rsp_xbar; 124 DspinSignals<dspin_ram_cmd_width> signal_ram_dspin_cmd_false; 125 DspinSignals<dspin_ram_rsp_width> signal_ram_dspin_rsp_false; 123 126 124 127 ////////////////////////////////////// … … 166 169 dspin_ram_rsp_width>* xram_ram_wt; 167 170 168 DspinRouterTsar<dspin_ram_cmd_width>* ram_router_cmd; 169 DspinRouterTsar<dspin_ram_rsp_width>* ram_router_rsp; 171 DspinRouter<dspin_ram_cmd_width>* ram_router_cmd; 172 DspinRouter<dspin_ram_rsp_width>* ram_router_rsp; 173 174 DspinLocalCrossbar<dspin_ram_cmd_width>* ram_xbar_cmd; 175 DspinLocalCrossbar<dspin_ram_rsp_width>* ram_xbar_rsp; 176 170 177 171 178 // IO Network Components (not instanciated in all clusters) … … 177 184 dspin_ram_cmd_width, 178 185 dspin_ram_rsp_width>* iob_ram_wi; 179 186 180 187 // cluster constructor 181 188 TsarIobCluster( sc_module_name insname, … … 195 202 size_t l_width, // l field bits 196 203 197 size_t int_memc_tgtid, 198 size_t int_xicu_tgtid, 199 size_t int_mdma_tgtid, 200 size_t int_iobx_tgtid, 201 202 size_t int_proc_srcid, 203 size_t int_mdma_srcid, 204 size_t int_iobx_srcid, 205 206 size_t ext_xram_tgtid, 207 208 size_t ext_memc_srcid, 209 size_t ext_iobx_srcid, 204 size_t int_memc_tgt_id, 205 size_t int_xicu_tgt_id, 206 size_t int_mdma_tgt_id, 207 size_t int_iobx_tgt_id, 208 size_t int_proc_ini_id, 209 size_t int_mdma_ini_id, 210 size_t int_iobx_ini_id, 211 212 size_t ram_xram_tgt_id, 213 size_t ram_memc_ini_id, 214 size_t ram_iobx_ini_id, 215 216 bool is_io, 217 size_t iox_iobx_tgt_id, 218 size_t iox_iobx_ini_id, 210 219 211 220 size_t memc_ways, … … 226 235 bool iob0_debug_ok ); 227 236 237 protected: 238 239 SC_HAS_PROCESS(TsarIobCluster); 240 241 void init(); 242 243 228 244 }; 229 245 … … 231 247 232 248 #endif 249 250 // Local Variables: 251 // tab-width: 3 252 // c-basic-offset: 3 253 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 254 // indent-tabs-mode: nil 255 // End: 256 257 // vim: filetype=cpp:expandtab:shiftwidth=3:tabstop=3:softtabstop=3 258 // -
trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/src/tsar_iob_cluster.cpp
r714 r718 15 15 #include "../include/tsar_iob_cluster.h" 16 16 17 #define tmpl(x) \ 18 template<typename vci_param_int , typename vci_param_ext,\ 19 size_t dspin_int_cmd_width, size_t dspin_int_rsp_width,\ 20 size_t dspin_ram_cmd_width, size_t dspin_ram_rsp_width>\ 21 x TsarIobCluster<\ 22 vci_param_int , vci_param_ext,\ 23 dspin_int_cmd_width, dspin_int_rsp_width,\ 24 dspin_ram_cmd_width, dspin_ram_rsp_width> 25 17 26 namespace soclib { namespace caba { 18 27 … … 20 29 // Constructor 21 30 ////////////////////////////////////////////////////////////////////////// 22 template<typename vci_param_int, 23 typename vci_param_ext, 24 size_t dspin_int_cmd_width, 25 size_t dspin_int_rsp_width, 26 size_t dspin_ram_cmd_width, 27 size_t dspin_ram_rsp_width> 28 TsarIobCluster<vci_param_int, 29 vci_param_ext, 30 dspin_int_cmd_width, 31 dspin_int_rsp_width, 32 dspin_ram_cmd_width, 33 dspin_ram_rsp_width>::TsarIobCluster( 31 tmpl(/**/)::TsarIobCluster( 34 32 ////////////////////////////////////////////////////////////////////////// 35 33 sc_module_name insname, … … 49 47 size_t l_width, 50 48 51 size_t memc_int_tgtid, // local index 52 size_t xicu_int_tgtid, // local index 53 size_t mdma_int_tgtid, // local index 54 size_t iobx_int_tgtid, // local index 55 56 size_t proc_int_srcid, // local index 57 size_t mdma_int_srcid, // local index 58 size_t iobx_int_srcid, // local index 59 60 size_t xram_ram_tgtid, // local index 61 62 size_t memc_ram_srcid, // local index 63 size_t iobx_ram_srcid, // local index 49 size_t int_memc_tgt_id, // local index 50 size_t int_xicu_tgt_id, // local index 51 size_t int_mdma_tgt_id, // local index 52 size_t int_iobx_tgt_id, // local index 53 54 size_t int_proc_ini_id, // local index 55 size_t int_mdma_ini_id, // local index 56 size_t int_iobx_ini_id, // local index 57 58 size_t ram_xram_tgt_id, // local index 59 size_t ram_memc_ini_id, // local index 60 size_t ram_iobx_ini_id, // local index 61 62 bool is_io, // is IO cluster (IOB)? 63 size_t iox_iobx_tgt_id, // local_index 64 size_t iox_iobx_ini_id, // local index 64 65 65 66 size_t memc_ways, … … 87 88 size_t cluster_id = (x_id<<4) + y_id; 88 89 89 size_t cluster_iob0 = 0; // South-West cluster90 size_t cluster_iob1 = ((xmax-1)<<4) + ymax-1; // North-East cluster91 92 90 // Vectors of DSPIN ports for inter-cluster communications 93 91 p_dspin_int_cmd_in = alloc_elems<DspinInput<dspin_int_cmd_width> >("p_int_cmd_in", 4, 3); … … 101 99 p_dspin_ram_rsp_out = alloc_elems<DspinOutput<dspin_ram_rsp_width> >("p_ext_rsp_out", 4); 102 100 103 // ports in cluster_iob0 and cluster_iob1 only 104 if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) ) 105 { 106 // VCI ports from IOB to IOX network 101 // VCI ports from IOB to IOX network (only in IO clusters) 102 if ( is_io ) 103 { 107 104 p_vci_iob_iox_ini = new soclib::caba::VciInitiator<vci_param_ext>; 108 105 p_vci_iob_iox_tgt = new soclib::caba::VciTarget<vci_param_ext>; 109 110 // DSPIN ports from IOB to RAM network111 p_dspin_iob_cmd_out = new soclib::caba::DspinOutput<dspin_ram_cmd_width>;112 p_dspin_iob_rsp_in = new soclib::caba::DspinInput<dspin_ram_rsp_width>;113 106 } 114 107 … … 135 128 8, // DTLB ways 136 129 8, // DTLB sets 137 l1_i_ways, l1_i_sets,16,// ICACHE size138 l1_d_ways, l1_d_sets,16,// DCACHE size130 l1_i_ways, l1_i_sets, 16, // ICACHE size 131 l1_d_ways, l1_d_sets, 16, // DCACHE size 139 132 4, // WBUF nlines 140 133 4, // WBUF nwords … … 154 147 dspin_int_cmd_width>( 155 148 s_memc.str().c_str(), 156 mt_int, // Mapping Table INT network157 mt_ram, // Mapping Table RAM network158 IntTab(cluster_id, memc_ram_srcid), // SRCID RAM network159 IntTab(cluster_id, memc_int_tgtid), // TGTID INT network160 x_width, // number of bits for x coordinate161 y_width, // number of bits for y coordinate162 memc_ways, memc_sets, 16, // CACHE SIZE163 3, // MAX NUMBER OF COPIES164 4096, // HEAP SIZE165 8, // TRANSACTION TABLE DEPTH166 8, // UPDATE TABLE DEPTH167 8, // INVALIDATE TABLE DEPTH149 mt_int, // Mapping Table INT network 150 mt_ram, // Mapping Table RAM network 151 IntTab(cluster_id, ram_memc_ini_id), // SRCID RAM network 152 IntTab(cluster_id, int_memc_tgt_id), // TGTID INT network 153 x_width, // number of bits for x coordinate 154 y_width, // number of bits for y coordinate 155 memc_ways, memc_sets, 16, // CACHE SIZE 156 3, // MAX NUMBER OF COPIES 157 4096, // HEAP SIZE 158 8, // TRANSACTION TABLE DEPTH 159 8, // UPDATE TABLE DEPTH 160 8, // INVALIDATE TABLE DEPTH 168 161 debug_start_cycle, 169 162 memc_debug_ok ); … … 182 175 xicu = new VciXicu<vci_param_int>( 183 176 s_xicu.str().c_str(), 184 mt_int, // mapping table INT network185 IntTab(cluster_id, xicu_int_tgtid), // TGTID direct space186 xcu_nb_inputs, // number of timer IRQs187 xcu_nb_inputs, // number of hard IRQs188 xcu_nb_inputs, // number of soft IRQs189 16); // number of output IRQs177 mt_int, // mapping table INT network 178 IntTab(cluster_id, int_xicu_tgt_id), // TGTID direct space 179 xcu_nb_inputs, // number of timer IRQs 180 xcu_nb_inputs, // number of hard IRQs 181 xcu_nb_inputs, // number of soft IRQs 182 16); // number of output IRQs 190 183 191 184 //////////// MDMA … … 196 189 mt_int, 197 190 IntTab(cluster_id, nb_procs), // SRCID 198 IntTab(cluster_id, mdma_int_tgtid),// TGTID191 IntTab(cluster_id, int_mdma_tgt_id), // TGTID 199 192 64, // burst size 200 193 nb_dmas); // number of IRQs 201 194 202 195 /////////// Direct LOCAL_XBAR(S) 203 size_t nb_direct_initiators = nb_procs + 1; 204 size_t nb_direct_targets = 3; 205 if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1) ) 206 { 207 nb_direct_initiators = nb_procs + 2; 208 nb_direct_targets = 4; 209 } 196 size_t nb_direct_initiators = is_io ? nb_procs + 2 : nb_procs + 1; 197 size_t nb_direct_targets = is_io ? 4 : 3; 210 198 211 199 std::ostringstream s_int_xbar_d; … … 304 292 xram = new VciSimpleRam<vci_param_ext>( 305 293 s_xram.str().c_str(), 306 IntTab(cluster_id, xram_ram_tgtid),294 IntTab(cluster_id, ram_xram_tgt_id), 307 295 mt_ram, 308 296 loader, … … 320 308 std::ostringstream s_ram_router_cmd; 321 309 s_ram_router_cmd << "ram_router_cmd_" << x_id << "_" << y_id; 322 size_t is_iob0 = (x_id == 0) and (y_id == 0); 323 size_t is_iob1 = (x_id == (xmax-1)) and (y_id == (ymax-1)); 324 ram_router_cmd = new DspinRouterTsar<dspin_ram_cmd_width>( 310 ram_router_cmd = new DspinRouter<dspin_ram_cmd_width>( 325 311 s_ram_router_cmd.str().c_str(), 326 312 x_id, y_id, // router coordinates in mesh 327 313 x_width, // x field width in first flit 328 314 y_width, // y field width in first flit 329 4, 4, // input & output fifo depths 330 is_iob0, // cluster contains IOB0 331 is_iob1, // cluster contains IOB1 332 false, // not a response router 333 l_width); // local field width in first flit 315 4, 4); // input & output fifo depths 334 316 335 317 std::ostringstream s_ram_router_rsp; 336 318 s_ram_router_rsp << "ram_router_rsp_" << x_id << "_" << y_id; 337 ram_router_rsp = new DspinRouter Tsar<dspin_ram_rsp_width>(319 ram_router_rsp = new DspinRouter<dspin_ram_rsp_width>( 338 320 s_ram_router_rsp.str().c_str(), 339 321 x_id, y_id, // coordinates in mesh 340 322 x_width, // x field width in first flit 341 323 y_width, // y field width in first flit 342 4, 4, // input & output fifo depths 343 is_iob0, // cluster contains IOB0 344 is_iob1, // cluster contains IOB1 345 true, // response router 346 l_width); // local field width in first flit 324 4, 4); // input & output fifo depths 347 325 348 326 349 327 ////////////////////// I/O CLUSTER ONLY /////////////////////// 350 if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1))328 if ( is_io ) 351 329 { 352 330 /////////// IO_BRIDGE 353 size_t iox_local_id;354 size_t global_id;355 if ( cluster_id == cluster_iob0 )356 {357 iox_local_id = 0;358 global_id = cluster_iob0;359 }360 else361 {362 iox_local_id = 1;363 global_id = cluster_iob1;364 }365 366 331 std::ostringstream s_iob; 367 332 s_iob << "iob_" << x_id << "_" << y_id; … … 369 334 vci_param_ext>( 370 335 s_iob.str().c_str(), 371 mt_ram, // EXT network maptab 372 mt_int, // INT network maptab 373 mt_iox, // IOX network maptab 374 IntTab( global_id, iobx_int_tgtid ), // INT TGTID 375 IntTab( global_id, iobx_int_srcid ), // INT SRCID 376 IntTab( global_id, iox_local_id ), // IOX TGTID 377 16, // cache line words 378 8, // IOTLB ways 379 8, // IOTLB sets 336 mt_ram, // EXT network maptab 337 mt_int, // INT network maptab 338 mt_iox, // IOX network maptab 339 IntTab( cluster_id, int_iobx_tgt_id ), // INT TGTID 340 IntTab( cluster_id, int_iobx_ini_id ), // INT SRCID 341 IntTab( 0 , iox_iobx_tgt_id ), // IOX TGTID 342 IntTab( 0 , iox_iobx_ini_id ), // IOX SRCID 343 16, // cache line words 344 8, // IOTLB ways 345 8, // IOTLB sets 380 346 debug_start_cycle, 381 347 iob_debug_ok ); … … 387 353 dspin_ram_rsp_width>( 388 354 s_iob_ram_wi.str().c_str(), 389 x_width + y_width + l_width); 355 vci_param_int::S); 356 357 std::ostringstream s_ram_xbar_cmd; 358 s_ram_xbar_cmd << "s_ram_xbar_cmd_" << x_id << "_" << y_id; 359 ram_xbar_cmd = new DspinLocalCrossbar<dspin_ram_cmd_width>( 360 s_ram_xbar_cmd.str().c_str(), // name 361 mt_ram, // mapping table 362 x_id, y_id, // x, y 363 x_width, y_width, l_width, // x_width, y_width, l_width 364 2, 0, // local inputs, local outputs 365 2, 2, // in fifo, out fifo depths 366 true, // is cmd ? 367 false, // use routing table ? 368 false); // support broadcast ? 369 370 std::ostringstream s_ram_xbar_rsp; 371 s_ram_xbar_rsp << "s_ram_xbar_rsp_" << x_id << "_" << y_id; 372 ram_xbar_rsp = new DspinLocalCrossbar<dspin_ram_rsp_width>( 373 s_ram_xbar_rsp.str().c_str(), // name 374 mt_ram, // mapping table 375 x_id, y_id, // x, y 376 x_width, y_width, l_width, // x_width, y_width, l_width 377 0, 2, // local inputs, local outputs 378 2, 2, // in fifo, out fifo depths 379 false, // is cmd ? 380 true, // use routing table ? 381 false); // support broadcast ? 390 382 } // end if IO 391 383 … … 396 388 // on coherence network : local srcid[proc] in [0...nb_procs-1] 397 389 // : local srcid[memc] = nb_procs 398 // In cluster_iob0, 32 HWI interrupts from external peripherals399 // are connected to the XICU ports p_hwi[0:31]400 // In other clusters, no HWI interrupts are connected to XICU401 390 402 391 //////////////////////// internal CMD & RSP routers … … 440 429 int_xbar_d->p_target_to_up (signal_int_vci_g2l); 441 430 442 int_xbar_d->p_to_target[ memc_int_tgtid](signal_int_vci_tgt_memc);443 int_xbar_d->p_to_target[ xicu_int_tgtid](signal_int_vci_tgt_xicu);444 int_xbar_d->p_to_target[ mdma_int_tgtid](signal_int_vci_tgt_mdma);445 int_xbar_d->p_to_initiator[ mdma_int_srcid](signal_int_vci_ini_mdma);431 int_xbar_d->p_to_target[int_memc_tgt_id] (signal_int_vci_tgt_memc); 432 int_xbar_d->p_to_target[int_xicu_tgt_id] (signal_int_vci_tgt_xicu); 433 int_xbar_d->p_to_target[int_mdma_tgt_id] (signal_int_vci_tgt_mdma); 434 int_xbar_d->p_to_initiator[int_mdma_ini_id] (signal_int_vci_ini_mdma); 446 435 for (size_t p = 0; p < nb_procs; p++) 447 int_xbar_d->p_to_initiator[ proc_int_srcid + p] (signal_int_vci_ini_proc[p]);448 449 if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1))450 { 451 int_xbar_d->p_to_target[i obx_int_tgtid] (signal_int_vci_tgt_iobx);452 int_xbar_d->p_to_initiator[i obx_int_srcid] (signal_int_vci_ini_iobx);436 int_xbar_d->p_to_initiator[int_proc_ini_id + p] (signal_int_vci_ini_proc[p]); 437 438 if ( is_io ) 439 { 440 int_xbar_d->p_to_target[int_iobx_tgt_id] (signal_int_vci_tgt_iobx); 441 int_xbar_d->p_to_initiator[int_iobx_ini_id] (signal_int_vci_ini_iobx); 453 442 } 454 443 … … 573 562 ram_router_rsp->p_in[n] (this->p_dspin_ram_rsp_in[n]); 574 563 } 564 575 565 ram_router_cmd->p_out[4] (signal_ram_dspin_cmd_xram_t); 576 ram_router_cmd->p_in[4] (signal_ram_dspin_cmd_memc_i);577 ram_router_rsp->p_out[4] (signal_ram_dspin_rsp_memc_i);578 566 ram_router_rsp->p_in[4] (signal_ram_dspin_rsp_xram_t); 567 568 if ( is_io ) 569 { 570 ram_router_cmd->p_in[4] (signal_ram_dspin_cmd_xbar); 571 ram_router_rsp->p_out[4] (signal_ram_dspin_rsp_xbar); 572 } 573 else 574 { 575 ram_router_cmd->p_in[4] (signal_ram_dspin_cmd_memc_i); 576 ram_router_rsp->p_out[4] (signal_ram_dspin_rsp_memc_i); 577 } 579 578 580 579 ///////////////////////// IOB exists only in cluster_iob0 & cluster_iob1. 581 if ( (cluster_id == cluster_iob0) or (cluster_id == cluster_iob1))580 if ( is_io ) 582 581 { 583 582 // IO bridge 584 iob->p_clk (this->p_clk);585 iob->p_resetn (this->p_resetn);586 iob->p_vci_ini_iox (*(this->p_vci_iob_iox_ini));587 iob->p_vci_tgt_iox (*(this->p_vci_iob_iox_tgt));588 iob->p_vci_tgt_int (signal_int_vci_tgt_iobx);589 iob->p_vci_ini_int (signal_int_vci_ini_iobx);590 iob->p_vci_ini_ram (signal_ram_vci_ini_iobx);583 iob->p_clk (this->p_clk); 584 iob->p_resetn (this->p_resetn); 585 iob->p_vci_ini_iox (*(this->p_vci_iob_iox_ini)); 586 iob->p_vci_tgt_iox (*(this->p_vci_iob_iox_tgt)); 587 iob->p_vci_tgt_int (signal_int_vci_tgt_iobx); 588 iob->p_vci_ini_int (signal_int_vci_ini_iobx); 589 iob->p_vci_ini_ram (signal_ram_vci_ini_iobx); 591 590 592 591 // initiator wrapper to RAM network 593 iob_ram_wi->p_clk (this->p_clk); 594 iob_ram_wi->p_resetn (this->p_resetn); 595 iob_ram_wi->p_dspin_cmd (*(this->p_dspin_iob_cmd_out)); 596 iob_ram_wi->p_dspin_rsp (*(this->p_dspin_iob_rsp_in)); 597 iob_ram_wi->p_vci (signal_ram_vci_ini_iobx); 598 } 599 592 iob_ram_wi->p_clk (this->p_clk); 593 iob_ram_wi->p_resetn (this->p_resetn); 594 iob_ram_wi->p_dspin_cmd (signal_ram_dspin_cmd_iob_i); 595 iob_ram_wi->p_dspin_rsp (signal_ram_dspin_rsp_iob_i); 596 iob_ram_wi->p_vci (signal_ram_vci_ini_iobx); 597 598 // crossbar between MEMC and IOB to RAM network 599 ram_xbar_cmd->p_clk (this->p_clk); 600 ram_xbar_cmd->p_resetn (this->p_resetn); 601 ram_xbar_cmd->p_global_out (signal_ram_dspin_cmd_xbar); 602 ram_xbar_cmd->p_global_in (signal_ram_dspin_cmd_false); 603 ram_xbar_cmd->p_local_in[ram_memc_ini_id] (signal_ram_dspin_cmd_memc_i); 604 ram_xbar_cmd->p_local_in[ram_iobx_ini_id] (signal_ram_dspin_cmd_iob_i); 605 606 ram_xbar_rsp->p_clk (this->p_clk); 607 ram_xbar_rsp->p_resetn (this->p_resetn); 608 ram_xbar_rsp->p_global_out (signal_ram_dspin_rsp_false); 609 ram_xbar_rsp->p_global_in (signal_ram_dspin_rsp_xbar); 610 ram_xbar_rsp->p_local_out[ram_memc_ini_id] (signal_ram_dspin_rsp_memc_i); 611 ram_xbar_rsp->p_local_out[ram_iobx_ini_id] (signal_ram_dspin_rsp_iob_i); 612 } 613 614 SC_METHOD(init); 600 615 } // end constructor 616 617 tmpl(void)::init() 618 { 619 signal_ram_dspin_cmd_false.write = false; 620 signal_ram_dspin_cmd_false.read = true; 621 signal_ram_dspin_rsp_false.write = false; 622 signal_ram_dspin_rsp_false.read = true; 623 } // end init 601 624 602 625 }} … … 612 635 // vim: filetype=cpp:expandtab:shiftwidth=3:tabstop=3:softtabstop=3 613 636 614 615
Note: See TracChangeset
for help on using the changeset viewer.