Ignore:
Timestamp:
Jun 24, 2014, 10:15:26 AM (10 years ago)
Author:
cfuguet
Message:

tsar_generic_iob:

  • Replacing "ad-hoc" dspin_tsar router by standard dspin_router on the RAM interconnect. To do so, in IO clusters (clusters with IOB) two crossbars are implemented:

+ One for commands which interconnects MEMC and IOB to the

local interface of RAM CMD dspin_router.

+ One for responses which interconnects local interface of RAM

RSP dspin_router to MEMC and IOB.

  • Introducing modified vci_io_bridge component
  • Modifying IOX memory segments used by IOX network for routing:

+ bugfix: all segments of IOX interconnect must have

global id = 0.

+ Adding XICU segments with special attribute. This

attribute is used by IOB to determine if a command coming
from external DMA peripheral should be routed
through INT or RAM networks.

+ Using bit 32 of physical address to determine if an

external DMA command should be routed through IOB0
or IOB1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/tsar_generic_iob/top.cpp

    r714 r718  
    11///////////////////////////////////////////////////////////////////////////////
    22// File: top.cpp  (for tsar_generic_iob platform)
    3 // Author: Alain Greiner 
     3// Author: Alain Greiner
    44// Copyright: UPMC/LIP6
    55// Date : august 2013
    66// This program is released under the GNU public license
    77///////////////////////////////////////////////////////////////////////////////
    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
    99// an external bus (i.e. Hypertransport) to access 7 external peripherals:
    1010//
     
    2525//
    2626// 1) the "INT" network supports Read/Write transactions
    27 //    between processors and L2 caches or peripherals. 
     27//    between processors and L2 caches or peripherals.
    2828//    (VCI ADDDRESS = 40 bits / VCI DATA width = 32 bits)
    2929//    It supports also coherence transactions between L1 & L2 caches.
    30 // 3) the "RAM" network is emulating the 3D network between L2 caches
     30// 3) the "RAM" network emulates the 3D network between L2 caches
    3131//    and L3 caches, and is implemented as a 2D mesh between the L2 caches,
    3232//    the two IO bridges and the physical RAMs disributed in all clusters.
     
    3535//    7 external peripheral controllers.
    3636//    (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
    3939// 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.
    4141// The total number of channels for the external peripherals (MTTY, MNIC, CDMA
    4242// IOC or HBA) is limited by the IOPIC 32 HWI inputs:..
    4343// - 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]
    4545// - IOPIC HWI[7:4]     connected to IRQ_CMA_TX[3:0]]
    4646// - IOPIC HWI[8]       connected to IRQ_BDEV
     
    5252// and one multi channels DMA component.
    5353// 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:
    5555// - IRQ_IN[0] : MMC
    5656// - IRQ_IN[1] : DMA channel 0
     
    5858// - IRQ_IN[3] : DMA channel 2
    5959// - IRQ_IN[4] : DMA channel 3
    60 // 
     60//
    6161// All clusters are identical, but cluster(0,0) and cluster(XMAX-1,YMAX-1)
    6262// contain an extra IO bridge component. These IOB0 & IOB1 components are
    6363// connected to the three networks (INT, RAM, IOX).
    64 // 
     64//
    6565// - It uses two dspin_local_crossbar per cluster to implement the
    66 //   local interconnect correponding to the INT network. 
    67 // - It uses two dspin_local_crossbar per cluster to implement the
    68 //   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.
    6969// - It uses two virtual_dspin_router per cluster to implement
    7070//   the INT network (routing both the direct and coherence trafic).
     
    7979//
    8080// 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
    8282// - Y_SIZE           : number of clusters in a column
    8383// - NB_PROCS_MAX     : number of processors per cluster (power of 2)
     
    8888// - FBUF_Y_SIZE      : heigth of frame buffer (lines)
    8989// - XCU_NB_INPUTS    : number of HWIs = number of WTIs = number of PTIs
    90 // 
     90//
    9191// Some secondary hardware parameters must be defined in this top.cpp file:
    92 // - XRAM_LATENCY     : external ram latency 
     92// - XRAM_LATENCY     : external ram latency
    9393// - MEMC_WAYS        : L2 cache number of ways
    9494// - 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
    100100// - NIC_RX_NAME      : file pathname for NIC received packets
    101101// - NIC_TX_NAME      : file pathname for NIC transmited packets
     
    104104// General policy for 40 bits physical address decoding:
    105105// 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)
    107107// The (x_width + y_width) MSB bits (left aligned) define
    108108// the cluster index, and the LADR bits define the local index:
     
    159159
    160160///////////////////////////////////////////////////////////
    161 //          DSPIN parameters           
     161//          DSPIN parameters
    162162///////////////////////////////////////////////////////////
    163163
     
    169169
    170170///////////////////////////////////////////////////////////
    171 //         VCI fields width  for the 3 VCI networks         
     171//         VCI fields width  for the 3 VCI networks
    172172///////////////////////////////////////////////////////////
    173173
     
    186186
    187187////////////////////////////////////////////////////////////
    188 //    Main Hardware Parameters values         
     188//    Main Hardware Parameters values
    189189//////////////////////i/////////////////////////////////////
    190190
     
    192192
    193193////////////////////////////////////////////////////////////
    194 //    Secondary Hardware Parameters values         
     194//    Secondary Hardware Parameters values
    195195//////////////////////i/////////////////////////////////////
    196196
     
    223223
    224224////////////////////////////////////////////////////////////
    225 //    Software to be loaded in ROM & RAM         
     225//    Software to be loaded in ROM & RAM
    226226//////////////////////i/////////////////////////////////////
    227227
     
    229229
    230230////////////////////////////////////////////////////////////
    231 //     DEBUG Parameters default values         
     231//     DEBUG Parameters default values
    232232//////////////////////i/////////////////////////////////////
    233233
     
    238238/////////////////////////////////////////////////////////
    239239
    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
    267241//     offset  = cluster(x,y) << (address_width-x_width-y_width);
    268242
    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
    283245
    284246////////////////////////////////////////////////////////////////////////
     
    289251// - The 10 MSB bits define the cluster index (left aligned)
    290252// - 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:
    293255// - Internal initiators (procs, mdma) are replicated in all clusters,
    294256//   and each initiator has one single SRCID.
    295257// - 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.
    297259//   They have the same local index, but two different cluster indexes.
    298260//
    299261// 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.
    301263// Consequence: For a local interconnect, the INI_ID port index
    302264// 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
    304266////////////////////////////////////////////////////////////////////////
    305267
     
    308270#define IOBX_LOCAL_SRCID             0x9
    309271#define MEMC_LOCAL_SRCID             0xA
     272#define CDMA_LOCAL_SRCID             0xB
     273#define BDEV_LOCAL_SRCID             0xC
    310274#define IOPI_LOCAL_SRCID             0xD
    311 #define CDMA_LOCAL_SRCID             0xE    // hard-coded in dspin_tsar
    312 #define BDEV_LOCAL_SRCID             0xF    // hard-coded in dspin_tsar
    313275
    314276///////////////////////////////////////////////////////////////////////
     
    338300///////////////////////////////////////////////////////////////////////
    339301
    340 #define IOX_IOB0_TGT_ID              0    // don't change this value
    341 #define IOX_IOB1_TGT_ID              1    // don't change this value
    342 #define IOX_FBUF_TGT_ID              2
    343 #define IOX_BDEV_TGT_ID              3
    344 #define IOX_MNIC_TGT_ID              4
    345 #define IOX_CDMA_TGT_ID              5
    346 #define IOX_BROM_TGT_ID              6
    347 #define IOX_MTTY_TGT_ID              7
    348 #define IOX_IOPI_TGT_ID              8
    349 
    350 #define IOX_IOB0_INI_ID              0    // Don't change this value
    351 #define IOX_IOB1_INI_ID              1    // Don't change this value
    352 #define IOX_BDEV_INI_ID              2     
    353 #define IOX_CDMA_INI_ID              3 
    354 #define IOX_IOPI_INI_ID              4
     302#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
    355317
    356318////////////////////////////////////////////////////////////////////////
     
    371333   bool     debug_ok         = false;                      // trace activated
    372334   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
    376338   bool     debug_iob        = false;                      // trace iob0 & iob1 when true
    377339   uint32_t debug_from       = 0;                          // trace start cycle
     
    384346   assert( (X_WIDTH == 4) and (Y_WIDTH == 4) and
    385347   "ERROR: we must have X_WIDTH == Y_WIDTH == 4");
    386  
     348
    387349   ////////////// command line arguments //////////////////////
    388350   if (argc > 1)
     
    536498                                   vci_plen_width,
    537499                                   vci_address_width,
    538                                    vci_rerror_width, 
     500                                   vci_rerror_width,
    539501                                   vci_clen_width,
    540502                                   vci_rflag_width,
     
    551513   // - 4 local targets (MEMC, XICU, MDMA, IOBX) per cluster
    552514   /////////////////////////////////////////////////////////////////////
    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),
    556518                            0x00FF000000);
    557519
     
    560522      for (size_t y = 0; y < YMAX; y++)
    561523      {
    562          uint64_t offset = ((uint64_t)cluster(x,y)) 
     524         uint64_t offset = ((uint64_t)cluster(x,y))
    563525                              << (vci_address_width-x_width-y_width);
    564526         bool config    = true;
     
    569531         std::ostringstream    smemc_conf;
    570532         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 ));
    573535
    574536         std::ostringstream    smemc_xram;
    575537         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));
    578540
    579541         std::ostringstream    sxicu;
    580542         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));
    583545
    584546         std::ostringstream    smdma;
    585547         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));
    588550
    589551         // the following segments are only defined in cluster_iob0 or in cluster_iob1
    590552
    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) )
    592554         {
    593555            std::ostringstream    siobx;
    594556            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,
    596558                        IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable, config ));
    597559
    598560            std::ostringstream    stty;
    599561            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,
    601563                        IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable));
    602564
    603565            std::ostringstream    sfbf;
    604566            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,
    606568                        IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable));
    607569
    608570            std::ostringstream    sbdv;
    609571            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,
    611573                        IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable));
    612574
    613575            std::ostringstream    snic;
    614576            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,
    616578                        IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable));
    617579
    618580            std::ostringstream    srom;
    619581            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,
    621583                        IntTab(cluster(x,y), INT_IOBX_TGT_ID), cacheable ));
    622584
    623585            std::ostringstream    sdma;
    624586            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,
    626588                        IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable));
    627589
    628590            std::ostringstream    spic;
    629591            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,
    631593                        IntTab(cluster(x,y), INT_IOBX_TGT_ID), not cacheable));
    632594         }
     
    635597         // and the port index on the local interconnect.
    636598
    637          maptab_int.srcid_map( IntTab( cluster(x,y), MDMA_LOCAL_SRCID ), 
     599         maptab_int.srcid_map( IntTab( cluster(x,y), MDMA_LOCAL_SRCID ),
    638600                               IntTab( cluster(x,y), INT_MDMA_INI_ID ) );
    639601
     
    645607
    646608         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 ),
    648610                               IntTab( cluster(x,y), INT_PROC_INI_ID+p ) );
    649611      }
     
    652614
    653615    /////////////////////////////////////////////////////////////////////////
    654     // RAM network mapping table 
     616    // RAM network mapping table
    655617    // - two levels address decoding for commands
    656618    // - two levels srcid decoding for responses
    657     // - 2 local initiators (MEMC, IOBX) per cluster 
     619    // - 2 local initiators (MEMC, IOBX) per cluster
    658620    //   (IOBX component only in cluster_iob0 and cluster_iob1)
    659621    // - 1 local target (XRAM) per cluster
    660622    ////////////////////////////////////////////////////////////////////////
    661623    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),
    664626                             0x00FF000000);
    665627
     
    667629    {
    668630        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))
    671633                                << (vci_address_width-x_width-y_width);
    672634
    673635            std::ostringstream sxram;
    674636            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));
    677639        }
    678640    }
     
    680642    // This define the mapping between the initiators SRCID
    681643    // 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 ),
    685647                          IntTab( cluster_iob0, RAM_IOBX_INI_ID ) );
    686648
    687     maptab_ram.srcid_map( IntTab( cluster_iob1, CDMA_LOCAL_SRCID ), 
     649    maptab_ram.srcid_map( IntTab( cluster_iob1, CDMA_LOCAL_SRCID ),
    688650                          IntTab( cluster_iob1, RAM_IOBX_INI_ID ) );
    689651
     
    694656                          IntTab( cluster_iob1, RAM_IOBX_INI_ID ) );
    695657
    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 ),
    697668                          IntTab( cluster_iob1, RAM_MEMC_INI_ID ) );
    698669
     
    700671
    701672    ///////////////////////////////////////////////////////////////////////
    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
    704675    // - two levels srcid decoding for responses
    705676    // - 5 initiators (IOB0, IOB1, BDEV, CDMA, IOPI)
    706677    // - 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.
    707681    ///////////////////////////////////////////////////////////////////////
    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);
    716687
    717688    // External peripherals segments
    718     // WHen there is more than one cluster, external peripherals can be accessed
     689    // When there is more than one cluster, external peripherals can be accessed
    719690    // 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
    735710    if ( cluster_iob0 != cluster_iob1 )
    736711    {
    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));
    751729    }
    752730
    753     // If there is more than one cluster, external peripherals 
     731    // If there is more than one cluster, external peripherals
    754732    // can access RAM through two segments (IOB0 / IOB1).
    755733    // As IOMMU is not activated, addresses are 40 bits (physical addresses),
    756     // and the choice depends on address bit A[39].
     734    // and the choice depends on address bit A[32].
    757735    for (size_t x = 0; x < XMAX; x++)
    758736    {
    759737        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
    765748            {
     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
    766766                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));
    777770            }
    778771        }
     
    781774    // This define the mapping between the external initiators (SRCID)
    782775    // 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  ) );
    791785
    792786    if ( cluster_iob0 != cluster_iob1 )
    793787    {
    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 ) );
    829790    }
    830791
     
    844805    sc_signal<bool>                   signal_irq_mnic_tx[NB_NIC_CHANNELS];
    845806    sc_signal<bool>                   signal_irq_cdma[NB_CMA_CHANNELS];
    846 
    847     // DSPIN signals for loopback in cluster_iob0 & cluster_iob1
    848     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;
    852807
    853808    // VCI signals for IOX network
     
    868823    VciSignals<vci_param_ext>         signal_vci_tgt_iopi("signal_vci_ini_iopi");
    869824
    870    // Horizontal inter-clusters INT network DSPIN 
     825   // Horizontal inter-clusters INT network DSPIN
    871826   DspinSignals<dspin_int_cmd_width>*** signal_dspin_int_cmd_h_inc =
    872827      alloc_elems<DspinSignals<dspin_int_cmd_width> >("signal_dspin_int_cmd_h_inc", XMAX-1, YMAX, 3);
     
    888843      alloc_elems<DspinSignals<dspin_int_rsp_width> >("signal_dspin_int_rsp_v_dec", XMAX, YMAX-1, 2);
    889844
    890    // Mesh boundaries INT network DSPIN 
     845   // Mesh boundaries INT network DSPIN
    891846   DspinSignals<dspin_int_cmd_width>**** signal_dspin_false_int_cmd_in =
    892847      alloc_elems<DspinSignals<dspin_int_cmd_width> >("signal_dspin_false_int_cmd_in", XMAX, YMAX, 4, 3);
     
    899854
    900855
    901    // Horizontal inter-clusters RAM network DSPIN 
     856   // Horizontal inter-clusters RAM network DSPIN
    902857   DspinSignals<dspin_ram_cmd_width>** signal_dspin_ram_cmd_h_inc =
    903858      alloc_elems<DspinSignals<dspin_ram_cmd_width> >("signal_dspin_ram_cmd_h_inc", XMAX-1, YMAX);
     
    919874      alloc_elems<DspinSignals<dspin_ram_rsp_width> >("signal_dspin_ram_rsp_v_dec", XMAX, YMAX-1);
    920875
    921    // Mesh boundaries RAM network DSPIN 
     876   // Mesh boundaries RAM network DSPIN
    922877   DspinSignals<dspin_ram_cmd_width>*** signal_dspin_false_ram_cmd_in =
    923878      alloc_elems<DspinSignals<dspin_ram_cmd_width> >("signal_dspin_false_ram_cmd_in", XMAX, YMAX, 4);
     
    930885
    931886   ////////////////////////////
    932    //      Loader   
     887   //      Loader
    933888   ////////////////////////////
    934889
     
    950905   std::cout << std::endl << "External Bus and Peripherals" << std::endl << std::endl;
    951906
     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
    952910   // IOX network
    953911   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",
    955913                                                   maptab_iox,
    956                                                    9,        // number of targets
    957                                                    5 );      // number of initiators
     914                                                   nb_iox_targets,
     915                                                   nb_iox_initiators );
    958916   // boot ROM
    959917   VciSimpleRom<vci_param_ext>*  brom;
     
    991949                                                  disk_name,
    992950                                                  512,        // block size
    993                                                   64,         // burst size (bytes) 
    994                                                   0 );        // disk latency 
     951                                                  64,         // burst size (bytes)
     952                                                  0 );        // disk latency
    995953
    996954   // Chained Buffer DMA controller
     
    1013971      mtty = new VciMultiTty<vci_param_ext>( "mtty",
    1014972                                             IntTab(0, IOX_MTTY_TGT_ID),
    1015                                              maptab_iox, 
     973                                             maptab_iox,
    1016974                                             vect_names);
    1017975
     
    1022980                                       IntTab(0, IOPI_LOCAL_SRCID),
    1023981                                       IntTab(0, IOX_IOPI_TGT_ID),
    1024                                        32 );        // number of input HWI             
    1025    // Clusters 
     982                                       32 );        // number of input HWI
     983   // Clusters
    1026984   TsarIobCluster<vci_param_int,
    1027985                  vci_param_ext,
     
    10481006            std::cout << "Cluster_" << std::dec << x << "_" << y << std::endl;
    10491007            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 ;
    10501019
    10511020            std::ostringstream sc;
     
    10881057                RAM_IOBX_INI_ID,
    10891058
     1059                is_io_cluster,
     1060                iox_iob_tgt_id,
     1061                iox_iob_ini_id,
     1062
    10901063                MEMC_WAYS,
    10911064                MEMC_SETS,
     
    11171090
    11181091    ///////////////////////////////////////////////////////////////////////////////
    1119     //     Net-list 
     1092    //     Net-list
    11201093    ///////////////////////////////////////////////////////////////////////////////
    11211094
     
    11241097    iox_network->p_resetn                                (signal_resetn);
    11251098    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);
    11271099    iox_network->p_to_ini[IOX_BDEV_INI_ID]               (signal_vci_ini_bdev);
    11281100    iox_network->p_to_ini[IOX_CDMA_INI_ID]               (signal_vci_ini_cdma);
     
    11301102
    11311103    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);
    11331104    iox_network->p_to_tgt[IOX_MTTY_TGT_ID]               (signal_vci_tgt_mtty);
    11341105    iox_network->p_to_tgt[IOX_FBUF_TGT_ID]               (signal_vci_tgt_fbuf);
     
    11391110    iox_network->p_to_tgt[IOX_IOPI_TGT_ID]               (signal_vci_tgt_iopi);
    11401111
     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
    11411118    // BDEV connexion
    1142         bdev->p_clk                                          (signal_clk);
     1119    bdev->p_clk                                          (signal_clk);
    11431120    bdev->p_resetn                                       (signal_resetn);
    11441121    bdev->p_irq                                          (signal_irq_bdev);
     
    11781155    mtty->p_resetn                                       (signal_resetn);
    11791156    mtty->p_vci                                          (signal_vci_tgt_mtty);
    1180     mtty->p_irq[0]                                              (signal_irq_mtty_rx);
     1157    mtty->p_irq[0]                                       (signal_irq_mtty_rx);
    11811158
    11821159    std::cout << "  - MTTY connected" << std::endl;
    11831160
    11841161    // CDMA connexion
    1185     cdma->p_clk                                         (signal_clk);
    1186     cdma->p_resetn                                      (signal_resetn);
    1187     cdma->p_vci_target                                  (signal_vci_tgt_cdma);
    1188     cdma->p_vci_initiator                               (signal_vci_ini_cdma);
     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);
    11891166    for ( size_t i=0 ; i<(NB_NIC_CHANNELS*2) ; i++)
    11901167    {
    1191         cdma->p_irq[i]                                 (signal_irq_cdma[i]);
     1168        cdma->p_irq[i]                                   (signal_irq_cdma[i]);
    11921169    }
    11931170
     
    11951172
    11961173    // IOPI connexion
    1197     iopi->p_clk                                         (signal_clk);
    1198     iopi->p_resetn                                      (signal_resetn);
    1199     iopi->p_vci_target                                  (signal_vci_tgt_iopi);
    1200     iopi->p_vci_initiator                               (signal_vci_ini_iopi);
     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);
    12011178    for ( size_t i=0 ; i<32 ; i++)
    12021179    {
     
    12141191    std::cout << "  - IOPIC connected" << std::endl;
    12151192
    1216    
     1193
    12171194    // IOB0 cluster connexion to IOX network
    1218     (*clusters[0][0]->p_vci_iob_iox_ini)               (signal_vci_ini_iob0);
    1219     (*clusters[0][0]->p_vci_iob_iox_tgt)               (signal_vci_tgt_iob0);
    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
    12221199    // (only when there is more than 1 cluster)
    12231200    if ( cluster_iob0 != cluster_iob1 )
     
    12721249   }
    12731250
    1274    std::cout << std::endl << "Horizontal connections established" << std::endl;   
     1251   std::cout << std::endl << "Horizontal connections established" << std::endl;
    12751252
    12761253   // Inter Clusters vertical connections
    1277    if (YMAX > 1) 
     1254   if (YMAX > 1)
    12781255   {
    12791256      for (size_t y = 0; y < (YMAX-1); y++)
     
    13301307      }
    13311308
    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]);
    13701318   }
    13711319
     
    13911339      }
    13921340
    1393       clusters[x][0]->p_dspin_ram_cmd_in[SOUTH]               (signal_dspin_false_ram_cmd_in[x][0][SOUTH]);
    1394       clusters[x][0]->p_dspin_ram_cmd_out[SOUTH]              (signal_dspin_false_ram_cmd_out[x][0][SOUTH]);
    1395       clusters[x][0]->p_dspin_ram_rsp_in[SOUTH]               (signal_dspin_false_ram_rsp_in[x][0][SOUTH]);
    1396       clusters[x][0]->p_dspin_ram_rsp_out[SOUTH]              (signal_dspin_false_ram_rsp_out[x][0][SOUTH]);
    1397 
    1398       clusters[x][YMAX-1]->p_dspin_ram_cmd_in[NORTH]          (signal_dspin_false_ram_cmd_in[x][YMAX-1][NORTH]);
    1399       clusters[x][YMAX-1]->p_dspin_ram_cmd_out[NORTH]         (signal_dspin_false_ram_cmd_out[x][YMAX-1][NORTH]);
    1400       clusters[x][YMAX-1]->p_dspin_ram_rsp_in[NORTH]          (signal_dspin_false_ram_rsp_in[x][YMAX-1][NORTH]);
    1401       clusters[x][YMAX-1]->p_dspin_ram_rsp_out[NORTH]         (signal_dspin_false_ram_rsp_out[x][YMAX-1][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]);
    14021350   }
    14031351
     
    14111359
    14121360   signal_resetn = false;
    1413 
    14141361   signal_irq_false = false;
    14151362
    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      
    14251363   // network boundaries signals
    14261364   for (size_t x = 0; x < XMAX ; x++)
     
    14781416            uint64_t ms2 = (uint64_t) t2.tv_sec  * 1000ULL +
    14791417                           (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"
    14831421                      << std::endl;
    14841422
     
    15001438            std::cout << " ************************************************" << std::endl;
    15011439
    1502             // trace proc[debug_proc_id] 
     1440            // trace proc[debug_proc_id]
    15031441            if ( debug_proc_id != 0xFFFFFFFF )
    15041442            {
     
    15231461//              clusters[x][y]->signal_int_vci_tgt_mdma.print_trace(mdma_signame.str());
    15241462
    1525                 if( clusters[x][y]->signal_proc_it[l].read() ) 
     1463                if( clusters[x][y]->signal_proc_it[l].read() )
    15261464                    std::cout << "### IRQ_PROC_" << std::dec
    15271465                              << x << "_" << y << "_" << l << " ACTIVE" << std::endl;
    1528             }   
    1529 
    1530             // trace memc[debug_memc_id] 
     1466            }
     1467
     1468            // trace memc[debug_memc_id]
    15311469            if ( debug_memc_id != 0xFFFFFFFF )
    15321470            {
    15331471                size_t x = debug_memc_id >> 4;
    15341472                size_t y = debug_memc_id & 0xF;
    1535            
     1473
    15361474                clusters[x][y]->memc->print_trace(0);
    15371475                std::ostringstream smemc_tgt;
     
    15541492                size_t x = debug_xram_id >> 4;
    15551493                size_t y = debug_xram_id & 0xF;
    1556            
     1494
    15571495                clusters[x][y]->xram->print_trace();
    15581496                std::ostringstream sxram_tgt;
     
    15631501                clusters[x][y]->ram_router_rsp->print_trace();
    15641502            }
    1565        
    1566             // trace iob, iox and external peripherals 
     1503
     1504            // trace iob, iox and external peripherals
    15671505            if ( debug_iob )
    15681506            {
    15691507                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");
    15731512
    15741513                signal_vci_ini_iob0.print_trace("[SIG]IOB0_IOX_INI");
    15751514                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");
    15791515
    15801516//              cdma->print_trace();
Note: See TracChangeset for help on using the changeset viewer.