Changeset 972 for trunk/platforms


Ignore:
Timestamp:
Apr 11, 2015, 8:26:46 PM (9 years ago)
Author:
alain
Message:

Modify the tsar_generic_iob platform:
The vci_multi_dma component replicated in all cluster is replaced by a vci_mwmr_dma component.
This new component supports all hardware coprocessors respection the "coproc" interface.
Amongst the available coprocessors (defined in the SocLib? "coprocessor_components" directory)
the MWR_CPY coprocessor provide an improved memory copy service throughput x 2).

Location:
trunk/platforms/tsar_generic_iob
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/tsar_generic_iob/arch.py

    r966 r972  
    1919#
    2020#  All clusters contain (nb_procs) processors, one L2 cache, one XCU, and
    21 #  one DMA controller.
     21#  one optional hardware coprocessor connected to a MWMR_DMA controller.
    2222#
    2323#  The "constructor" parameters (defined in Makefile) are:
     
    2727#  - nb_ttys        : number of TTY channels
    2828#  - fbf_width      : frame_buffer width = frame_buffer heigth
    29 #  - ioc_type       : can be 'BDV','HBA','SDC', but not 'RDK'
    30 #
    31 #  The other hardware parameters (defined below) are:
     29#  - ioc_type       : can be 'BDV','HBA','SDC', but not 'RDK'
     30#   
     31#
     32#  The other hardware parameters (defined in this script) are:
    3233#  - nb_nics        : number of NIC channels
    3334#  - nb_cmas        : number of CMA channels
     
    4041#  - use_ramdisk    : use a ramdisk when True
    4142#  - vseg_increment : address increment for replicated vsegs
     43#  - mwr_type       : coprocessor type / can be 'GCD','DCT','NOPE'
     44#  - use_dma        : one single channel DMA per cluster if non zero
    4245#
    4346#  Regarding the boot and kernel vsegs mapping :
     
    5962          nb_ttys   = 1,
    6063          fbf_width = 128,
    61           ioc_type  = 'BDV' ):
     64          ioc_type  = 'HBA' ):
    6265
    6366    ### define architecture constants
     
    7174    p_width         = 4
    7275    paddr_width     = 40
    73     irq_per_proc    = 4          # NetBSD constraint
     76    irq_per_proc    = 4         
    7477    peri_increment  = 0x10000 
    75 
    76     ### parameters checking
     78    mwr_type        = 'CPY'
     79
     80    ### constructor parameters checking
    7781
    7882    assert( nb_procs <= (1 << p_width) )
     
    9094
    9195    assert( ioc_type in [ 'BDV' , 'HBA' , 'SDC' ] )
     96
     97    assert( mwr_type in [ 'GCD' , 'DCT' , 'CPY' , 'NONE' ] )
    9298 
    9399    ### define platform name
     
    104110    xcu_size = 0x1000                      # 4 Kbytes
    105111
    106     dma_base = 0x00B1000000
    107     dma_size = 0x1000                      # 4 Kbytes
     112    mwr_base = 0x00B1000000
     113    mwr_size = 0x1000                      # 4 Kbytes
    108114
    109115    mmc_base = 0x00B2000000
     
    207213
    208214            ### components replicated in all clusters
    209             ram = mapping.addRam( 'RAM', base = ram_base + offset,
     215            mapping.addRam( 'RAM', base = ram_base + offset,
    210216                                  size = ram_size )
    211 
    212             mmc = mapping.addPeriph( 'MMC', base = mmc_base + offset,
    213                                      size = mmc_size, ptype = 'MMC' )
    214 
    215             dma = mapping.addPeriph( 'DMA', base = dma_base + offset,
    216                                      size = dma_size, ptype = 'DMA',
    217                                      channels = nb_procs )
    218217
    219218            xcu = mapping.addPeriph( 'XCU', base = xcu_base + offset,
     
    223222
    224223            mapping.addIrq( xcu, index = 0, isrtype = 'ISR_MMC' )
    225 
    226             for i in xrange ( dma.channels ):
    227                 mapping.addIrq( xcu, index = 1+i, isrtype = 'ISR_DMA',
    228                                 channel = i )
     224            mapping.addIrq( xcu, index = 1, isrtype = 'ISR_MWR' )
     225
     226            mapping.addPeriph( 'MMC', base = mmc_base + offset,
     227                                     size = mmc_size, ptype = 'MMC' )
     228
     229            if ( mwr_type == 'GCD' ):
     230                mapping.addPeriph( 'MWR', base = mwr_base + offset,
     231                                   size = mwr_size, ptype = 'MWR', subtype = 'GCD',
     232                                   arg0 = 2, arg1 = 1, arg2 = 1, arg3 = 0 ) 
     233
     234            if ( mwr_type == 'DCT' ):
     235                mapping.addPeriph( 'MWR', base = mwr_base + offset,
     236                                   size = mwr_size, ptype = 'MWR', subtype = 'DCT',
     237                                   arg0 = 1, arg1 = 1, arg2 = 1, arg3 = 0 ) 
     238
     239            if ( mwr_type == 'CPY' ):
     240                mapping.addPeriph( 'MWR', base = mwr_base + offset,
     241                                   size = mwr_size, ptype = 'MWR', subtype = 'CPY',
     242                                   arg0 = 1, arg1 = 1, arg2 = 1, arg3 = 0 ) 
    229243
    230244            for p in xrange ( nb_procs ):
    231                 mapping.addProc( x, y, p )
     245                mapping.addProc( x , y , p )
    232246
    233247            ### external peripherals in cluster_io
     
    406420                               local = False, big = False )
    407421
    408             mapping.addGlobal( 'seg_dma_%d_%d' %(x,y), dma_base + offset, dma_size,
    409                                '__W_', vtype = 'PERI' , x = x , y = y , pseg = 'DMA',
    410                                local = False, big = False )
    411 
    412422            mapping.addGlobal( 'seg_mmc_%d_%d' %(x,y), mmc_base + offset, mmc_size,
    413423                               '__W_', vtype = 'PERI' , x = x , y = y , pseg = 'MMC',
    414424                               local = False, big = False )
     425
     426            if ( mwr_type != 'NONE' ):
     427                mapping.addGlobal( 'seg_mwr_%d_%d' %(x,y), mwr_base + offset, mwr_size,
     428                                   '__W_', vtype = 'PERI' , x = x , y = y , pseg = 'MWR',
     429                                   local = False, big = False )
    415430
    416431    return mapping
  • trunk/platforms/tsar_generic_iob/top.cpp

    r966 r972  
    4848// - IOPIC HWI[31:16]   connected to IRQ_TTY_RX[15:0]
    4949//
    50 // Besides the external peripherals, each cluster contains one XICU component,
    51 // and one multi channels DMA component.
    52 // The XICU component is mainly used to handle WTI IRQs, as only
    53 // 1 + NB_PROCS_MAX HWI IRQs are connected to XICU in each cluster:
     50// Each cluster contains the following component:
     51// - From 1 to 8 MIP32 processors
     52// - One L2 cache controller
     53// - One XICU component,
     54// - One - optional - single channel DMA controler,
     55// - One - optional - hardware coprocessor
     56// The XICU component is mainly used to handle WTI IRQs, as at most
     57// 2 HWI IRQs are connected to XICU in each cluster:
    5458// - IRQ_IN[0]            : MMC
    55 // - IRQ_IN[1]            : DMA channel 0
    56 // - IRQ_IN[2]            : DMA channel 1
    57 // - ...                    ...   
    58 // - IRQ_IN[NB_PROCS_MAX] : DMA channel NB_PROCS_MAX
     59// - IRQ_IN[1]            : MWR
    5960//
    6061// All clusters are identical, but cluster(0,0) and cluster(XMAX-1,YMAX-1)
     
    131132#include "mapping_table.h"
    132133
     134
     135
    133136#include "tsar_iob_cluster.h"
    134137#include "vci_chbuf_dma.h"
     
    144147#include "alloc_elems.h"
    145148
    146 ///////////////////////////////////////////////////
    147 //      OS
    148 ///////////////////////////////////////////////////
     149
     150//////////////////////////////////////////////////////////////////
     151//    Coprocessor type (must be replicated in tsar_iob_cluster)
     152//////////////////////////////////////////////////////////////////
     153
     154#define MWR_COPROC_CPY  0
     155#define MWR_COPROC_DCT  1
     156#define MWR_COPROC_GCD  2
     157
     158//////////////////////////////////////////////////////////////////
     159//      For ALMOS
     160//////////////////////////////////////////////////////////////////
     161
    149162#define USE_ALMOS 0
    150163
     
    153166#define almos_archinfo_pathname   "arch-info.bin@0xBFC08000:D"
    154167
    155 ///////////////////////////////////////////////////
    156 //               Parallelisation
    157 ///////////////////////////////////////////////////
     168//////////////////////////////////////////////////////////////////
     169//        Parallelisation
     170//////////////////////////////////////////////////////////////////
    158171
    159172#define USING_OPENMP           0
     
    163176#endif
    164177
    165 ///////////////////////////////////////////////////////////
     178//////////////////////////////////////////////////////////////////
    166179//          DSPIN parameters
    167 ///////////////////////////////////////////////////////////
     180//////////////////////////////////////////////////////////////////
    168181
    169182#define dspin_int_cmd_width   39
     
    173186#define dspin_ram_rsp_width   64
    174187
    175 ///////////////////////////////////////////////////////////
     188//////////////////////////////////////////////////////////////////
    176189//         VCI fields width  for the 3 VCI networks
    177 ///////////////////////////////////////////////////////////
     190//////////////////////////////////////////////////////////////////
    178191
    179192#define vci_cell_width_int    4
     
    214227#define L1_DSETS              64
    215228
     229#if BOOT_DEBUG_ELF
     230_printf("\n[DEBUG BOOT_ELF] P[%d,%d,%d] copy segment %d :\n"
     231        "  vaddr = %x / size = %x / paddr = %l\n",
     232        x , y , p , seg_id , seg_vaddr , seg_memsz , seg_paddr );
     233#endif
    216234#define DISK_IMAGE_NAME       "../../../giet_vm/hdd/virt_hdd.dmg"
    217235
     
    249267// Two different initiators cannot have the same SRCID, but a given
    250268// initiator can have two alias SRCIDs:
    251 // - Internal initiators (procs, mdma) are replicated in all clusters,
     269// - Internal initiators (procs, mwmr) are replicated in all clusters,
    252270//   and each initiator has one single SRCID.
    253271// - External initiators (disk, cdma) are not replicated, but can be
     
    263281
    264282#define PROC_LOCAL_SRCID             0x0    // from 0 to 7
    265 #define MDMA_LOCAL_SRCID             0x8
     283#define MWMR_LOCAL_SRCID             0x8
    266284#define IOBX_LOCAL_SRCID             0x9
    267285#define MEMC_LOCAL_SRCID             0xA
     
    276294#define INT_MEMC_TGT_ID              0
    277295#define INT_XICU_TGT_ID              1
    278 #define INT_MDMA_TGT_ID              2
     296#define INT_MWMR_TGT_ID              2
    279297#define INT_IOBX_TGT_ID              3
    280298
    281299#define INT_PROC_INI_ID              0   // from 0 to (NB_PROCS_MAX-1)
    282 #define INT_MDMA_INI_ID              (NB_PROCS_MAX)
     300#define INT_MWMR_INI_ID              (NB_PROCS_MAX)
    283301#define INT_IOBX_INI_ID              (NB_PROCS_MAX+1)
    284302
     
    439457   // checking hardware parameters
    440458   assert( (XMAX <= 16) and
    441            "The XMAX parameter cannot be larger than 16" );
     459   "Error in tsar_generic_iob : XMAX parameter cannot be larger than 16" );
    442460
    443461   assert( (YMAX <= 16) and
    444            "The YMAX parameter cannot be larger than 16" );
     462   "Error in tsar_generic_iob : YMAX parameter cannot be larger than 16" );
    445463
    446464   assert( (NB_PROCS_MAX <= 8) and
    447            "NB_PROCS_MAX parameter cannot be larger than 8" );
     465   "Error in tsar_generic_iob : NB_PROCS_MAX parameter cannot be larger than 8" );
    448466
    449467   assert( (XCU_NB_HWI > NB_PROCS_MAX) and
    450            "XCU_NB_HWI must be larger than NB_PROCS_MAX" );
     468   "Error in tsar_generic_iob : XCU_NB_HWI must be larger than NB_PROCS_MAX" );
    451469
    452470   assert( (XCU_NB_PTI >= NB_PROCS_MAX) and
    453            "XCU_NB_PTI cannot be smaller than NB_PROCS_MAX" );
     471   "Error in tsar_generic_iob : XCU_NB_PTI cannot be smaller than NB_PROCS_MAX" );
    454472
    455473   assert( (XCU_NB_WTI >= 4*NB_PROCS_MAX) and
    456            "XCU_NB_WTI cannot be smaller than 4*NB_PROCS_MAX" );
     474   "Error in tsar_generic_iob : XCU_NB_WTI cannot be smaller than 4*NB_PROCS_MAX" );
    457475
    458476   assert( (XCU_NB_OUT >= 4*NB_PROCS_MAX) and
    459            "XCU_NB_OUT cannot be smaller than 4*NB_PROCS_MAX" );
     477   "Error in tsar_generic_iob : XCU_NB_OUT cannot be smaller than 4*NB_PROCS_MAX" );
    460478   
    461    assert( (NB_DMA_CHANNELS >= NB_PROCS_MAX) and
    462            "The NB_DMA_CHANNELS parameter cannot be larger than 8" );
    463 
    464479   assert( (NB_TTY_CHANNELS >= 1) and (NB_TTY_CHANNELS <= 16) and
    465            "The NB_TTY_CHANNELS parameter cannot be larger than 16" );
     480   "Error in tsar_generic_iob : NB_TTY_CHANNELS parameter cannot be larger than 16" );
    466481
    467482   assert( (NB_NIC_CHANNELS <= 2) and
    468            "The NB_NIC_CHANNELS parameter cannot be larger than 2" );
     483   "Error in tsar_generic_iob : NB_NIC_CHANNELS parameter cannot be larger than 2" );
    469484
    470485   assert( (NB_CMA_CHANNELS <= 4) and
    471            "The NB_CMA_CHANNELS parameter cannot be larger than 4" );
     486   "Error in tsar_generic_iob : NB_CMA_CHANNELS parameter cannot be larger than 4" );
    472487
    473488   assert( (X_WIDTH == 4) and (Y_WIDTH == 4) and
    474            "You must have X_WIDTH == Y_WIDTH == 4");
     489   "Error in tsar_generic_iob : You must have X_WIDTH == Y_WIDTH == 4");
     490
     491   assert(  ((USE_MWR_CPY + USE_MWR_GCD + USE_MWR_DCT) == 1) and
     492   "Error in tsar_generic_iob : No MWR coprocessor found in hard_config.h");
     493
     494   assert(  ((USE_IOC_HBA + USE_IOC_BDV + USE_IOC_SDC) == 1) and
     495   "Error in tsar_generic_iob : NoIOC controller found in hard_config.h");
    475496
    476497   std::cout << std::endl << std::dec
     
    478499             << " - YMAX            = " << YMAX << std::endl
    479500             << " - NB_PROCS_MAX    = " << NB_PROCS_MAX << std::endl
    480              << " - NB_DMA_CHANNELS = " << NB_DMA_CHANNELS <<  std::endl
    481501             << " - NB_TTY_CHANNELS = " << NB_TTY_CHANNELS <<  std::endl
    482502             << " - NB_NIC_CHANNELS = " << NB_NIC_CHANNELS <<  std::endl
     
    492512             << " - DEBUG_PROCID    = " << debug_proc_id << std::endl
    493513             << " - DEBUG_MEMCID    = " << debug_memc_id << std::endl
     514             << " - DEBUG_XRAMID    = " << debug_xram_id << std::endl
    494515             << " - DEBUG_XRAMID    = " << debug_xram_id << std::endl;
    495516
     
    529550   // - two levels address decoding for commands
    530551   // - two levels srcid decoding for responses
    531    // - NB_PROCS_MAX + 2 (MDMA, IOBX) local initiators per cluster
    532    // - 4 local targets (MEMC, XICU, MDMA, IOBX) per cluster
     552   // - NB_PROCS_MAX + 2 (MWMR, IOBX) local initiators per cluster
     553   // - 4 local targets (MEMC, XICU, MWMR, IOBX) per cluster
    533554   /////////////////////////////////////////////////////////////////////
    534555   MappingTable maptab_int( vci_address_width,
     
    563584                     IntTab(cluster(x,y), INT_XICU_TGT_ID), not cacheable));
    564585
    565          std::ostringstream    smdma;
    566          smdma << "int_seg_mdma_" << x << "_" << y;
    567          maptab_int.add(Segment(smdma.str(), SEG_DMA_BASE+offset, SEG_DMA_SIZE,
    568                      IntTab(cluster(x,y), INT_MDMA_TGT_ID), not cacheable));
     586         std::ostringstream    smwmr;
     587         smwmr << "int_seg_mwmr_" << x << "_" << y;
     588         maptab_int.add(Segment(smwmr.str(), SEG_MWR_BASE+offset, SEG_MWR_SIZE,
     589                     IntTab(cluster(x,y), INT_MWMR_TGT_ID), not cacheable));
    569590
    570591         // the following segments are only defined in cluster_iob0 or in cluster_iob1
     
    616637         // and the port index on the local interconnect.
    617638
    618          maptab_int.srcid_map( IntTab( cluster(x,y), MDMA_LOCAL_SRCID ),
    619                                IntTab( cluster(x,y), INT_MDMA_INI_ID ) );
     639         maptab_int.srcid_map( IntTab( cluster(x,y), MWMR_LOCAL_SRCID ),
     640                               IntTab( cluster(x,y), INT_MWMR_INI_ID ) );
    620641
    621642         maptab_int.srcid_map( IntTab( cluster(x,y), IOBX_LOCAL_SRCID ),
     
    10221043                   dspin_ram_rsp_width>* clusters[XMAX][YMAX];
    10231044
     1045    unsigned int coproc_type;
     1046    if ( USE_MWR_CPY ) coproc_type = MWR_COPROC_CPY;
     1047    if ( USE_MWR_DCT ) coproc_type = MWR_COPROC_DCT;
     1048    if ( USE_MWR_GCD ) coproc_type = MWR_COPROC_GCD;
     1049
    10241050#if USING_OPENMP
    10251051#pragma omp parallel
     
    10501076                IOX_IOB0_TGT_ID :
    10511077                IOX_IOB1_TGT_ID ;
     1078
    10521079
    10531080            std::ostringstream sc;
     
    10621089                sc.str().c_str(),
    10631090                NB_PROCS_MAX,
    1064                 NB_DMA_CHANNELS,
    10651091                x,
    10661092                y,
     
    10791105                INT_MEMC_TGT_ID,
    10801106                INT_XICU_TGT_ID,
    1081                 INT_MDMA_TGT_ID,
     1107                INT_MWMR_TGT_ID,
    10821108                INT_IOBX_TGT_ID,
    10831109
    10841110                INT_PROC_INI_ID,
    1085                 INT_MDMA_INI_ID,
     1111                INT_MWMR_INI_ID,
    10861112                INT_IOBX_INI_ID,
    10871113
     
    11061132                XCU_NB_WTI,
    11071133                XCU_NB_OUT,
     1134
     1135                coproc_type,
    11081136
    11091137                loader,
     
    15011529                clusters[x][y]->signal_int_vci_tgt_xicu.print_trace(xicu_signame.str());
    15021530
    1503 //              clusters[x][y]->mdma->print_trace();
    1504 //              std::ostringstream mdma_tgt_signame;
    1505 //              mdma_tgt_signame << "[SIG]MDMA_TGT_" << x << "_" << y;
    1506 //              clusters[x][y]->signal_int_vci_tgt_mdma.print_trace(mdma_tgt_signame.str());
    1507 //              std::ostringstream mdma_ini_signame;
    1508 //              mdma_ini_signame << "[SIG]MDMA_INI_" << x << "_" << y;
    1509 //              clusters[x][y]->signal_int_vci_ini_mdma.print_trace(mdma_ini_signame.str());
     1531                // coprocessor in cluster(x,y)
     1532                clusters[x][y]->mwmr->print_trace();
     1533                std::ostringstream mwmr_tgt_signame;
     1534                mwmr_tgt_signame << "[SIG]MWMR_TGT_" << x << "_" << y;
     1535                clusters[x][y]->signal_int_vci_tgt_mwmr.print_trace(mwmr_tgt_signame.str());
     1536                std::ostringstream mwmr_ini_signame;
     1537                mwmr_ini_signame << "[SIG]MWMR_INI_" << x << "_" << y;
     1538                clusters[x][y]->signal_int_vci_ini_mwmr.print_trace(mwmr_ini_signame.str());
     1539                if ( USE_MWR_CPY ) clusters[x][y]->cpy->print_trace();
     1540                if ( USE_MWR_DCT ) clusters[x][y]->dct->print_trace();
     1541                if ( USE_MWR_GCD ) clusters[x][y]->gcd->print_trace();
    15101542
    15111543                // local interrupts in cluster(x,y)
     
    15141546                          << " ACTIVE" << std::endl;
    15151547
    1516                 for ( size_t c = 0 ; c < NB_DMA_CHANNELS ; c++ )
    1517                 {
    1518                     if( clusters[x][y]->signal_irq_mdma[c].read() )
    1519                     std::cout << "### IRQ_DMA_" << std::dec << x << "_" << y << "_" << c
    1520                               << " ACTIVE" << std::endl;
    1521                 }
     1548                if( clusters[x][y]->signal_irq_mwmr.read() )
     1549                std::cout << "### IRQ_MWR_" << std::dec << x << "_" << y
     1550                          << " ACTIVE" << std::endl;
    15221551
    15231552                for ( size_t c = 0 ; c < NB_PROCS_MAX ; c++ )
  • trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/metadata/tsar_iob_cluster.sd

    r836 r972  
    2929        Uses('common:iss2'),
    3030        Uses('common:elf_file_loader'),
     31        Uses('caba:coproc_signals'),
    3132
    3233        # internal network components
     
    4748              cell_size          = parameter.Reference('vci_data_width_int')),
    4849
    49         Uses('caba:vci_multi_dma',
     50        Uses('caba:vci_mwmr_dma',
    5051              cell_size          = parameter.Reference('vci_data_width_int')),
     52
     53        Uses('caba:coproc_gcd'),
     54        Uses('caba:coproc_dct'),
     55        Uses('caba:coproc_cpy'),
    5156
    5257        Uses('caba:vci_local_crossbar',
  • trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/include/tsar_iob_cluster.h

    r959 r972  
    2828#include "dspin_router.h"
    2929#include "virtual_dspin_router.h"
    30 #include "vci_multi_dma.h"
     30#include "vci_mwmr_dma.h"
    3131#include "vci_mem_cache.h"
    3232#include "vci_cc_vcache_wrapper.h"
    3333#include "vci_io_bridge.h"
     34#include "coproc_signals.h"
     35#include "coproc_gcd.h"
     36#include "coproc_dct.h"
     37#include "coproc_cpy.h"
    3438
    3539namespace soclib { namespace caba   {
     
    7175    sc_signal<bool>                       signal_false;
    7276    sc_signal<bool>                       signal_proc_it[32];
    73     sc_signal<bool>                       signal_irq_mdma[8];
     77    sc_signal<bool>                       signal_irq_mwmr;
    7478    sc_signal<bool>                       signal_irq_memc;
    7579   
     80    // Coprocessor signals
     81    CoprocSignals<uint32_t,uint8_t>       signal_to_coproc[8];
     82    CoprocSignals<uint32_t,uint8_t>       signal_from_coproc[8];
     83    sc_signal<uint32_t>                   signal_config_coproc[8];
     84    sc_signal<uint32_t>                   signal_status_coproc[8];
     85
    7686    // INT network DSPIN signals between DSPIN routers and DSPIN local_crossbars
    7787    DspinSignals<dspin_int_cmd_width>     signal_int_dspin_cmd_l2g_d;
     
    8898    // INT network VCI signals between VCI components and VCI local crossbar
    8999    VciSignals<vci_param_int>             signal_int_vci_ini_proc[8];
    90     VciSignals<vci_param_int>             signal_int_vci_ini_mdma;
     100    VciSignals<vci_param_int>             signal_int_vci_ini_mwmr;
    91101    VciSignals<vci_param_int>             signal_int_vci_ini_iobx;
    92102
    93103    VciSignals<vci_param_int>             signal_int_vci_tgt_memc;
    94104    VciSignals<vci_param_int>             signal_int_vci_tgt_xicu;
    95     VciSignals<vci_param_int>             signal_int_vci_tgt_mdma;
     105    VciSignals<vci_param_int>             signal_int_vci_tgt_mwmr;
    96106    VciSignals<vci_param_int>             signal_int_vci_tgt_iobx;
    97107
     
    144154    VciXicu<vci_param_int>*                           xicu;
    145155
    146     VciMultiDma<vci_param_int>*                       mdma;
     156    VciMwmrDma<vci_param_int>*                        mwmr;
     157
     158    CoprocGcd*                                        gcd;
     159    CoprocDct*                                        dct;
     160    CoprocCpy*                                        cpy;
    147161
    148162    VciLocalCrossbar<vci_param_int>*                  int_xbar_d;
     
    188202    TsarIobCluster( sc_module_name                     insname,
    189203                    size_t                             nb_procs,   
    190                     size_t                             nb_dmas, 
    191204                    size_t                             x,             // x coordinate
    192205                    size_t                             y,             // y coordinate
     
    205218                    size_t                             int_memc_tgt_id,
    206219                    size_t                             int_xicu_tgt_id,
    207                     size_t                             int_mdma_tgt_id,
     220                    size_t                             int_mwmr_tgt_id,
    208221                    size_t                             int_iobx_tgt_id,
    209222                    size_t                             int_proc_ini_id,
    210                     size_t                             int_mdma_ini_id,
     223                    size_t                             int_mwmr_ini_id,
    211224                    size_t                             int_iobx_ini_id,
    212225
     
    231244                    size_t                             xcu_nb_irq,
    232245
     246                    size_t                             coproc_type,
     247
    233248                    const Loader                       &loader,  // loader for XRAM
    234249
     
    245260    void init();
    246261 
    247 
    248262};
    249263
  • trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/src/tsar_iob_cluster.cpp

    r959 r972  
    1515#include "../include/tsar_iob_cluster.h"
    1616
     17#define MWR_COPROC_CPY  0
     18#define MWR_COPROC_DCT  1
     19#define MWR_COPROC_GCD  2
     20
    1721#define tmpl(x) \
    1822   template<typename vci_param_int      , typename vci_param_ext,\
     
    2630namespace soclib { namespace caba  {
    2731
    28 //////////////////////////////////////////////////////////////////////////
    29 //                 Constructor
    30 //////////////////////////////////////////////////////////////////////////
     32/////////////////////////////////////////////////////////////////////////////
    3133tmpl(/**/)::TsarIobCluster(
    32 //////////////////////////////////////////////////////////////////////////
     34/////////////////////////////////////////////////////////////////////////////
    3335                    sc_module_name                     insname,
    3436                    size_t                             nb_procs,
    35                     size_t                             nb_dmas,
    3637                    size_t                             x_id,
    3738                    size_t                             y_id,
     
    5051                    size_t                             int_memc_tgt_id, // local index
    5152                    size_t                             int_xicu_tgt_id, // local index
    52                     size_t                             int_mdma_tgt_id, // local index
     53                    size_t                             int_mwmr_tgt_id, // local index
    5354                    size_t                             int_iobx_tgt_id, // local index
    5455
    5556                    size_t                             int_proc_ini_id, // local index
    56                     size_t                             int_mdma_ini_id, // local index
     57                    size_t                             int_mwmr_ini_id, // local index
    5758                    size_t                             int_iobx_ini_id, // local index
    5859
     
    7778                    size_t                             xcu_nb_out,
    7879
     80                    size_t                             coproc_type,
     81
    7982                    const Loader                      &loader,
    8083
     
    8891      p_resetn("resetn")
    8992{
    90     assert( (x_id < xmax) and (y_id < ymax) and "Illegal cluster coordinates");
     93    assert( (x_id < xmax) and (y_id < ymax) and
     94    "Error in tsar_iob_cluster : Illegal cluster coordinates");
    9195
    9296    size_t cluster_id = (x_id<<4) + y_id;
     
    186190                     xcu_nb_out);                         // number of output IRQs
    187191
    188     ////////////  MDMA
    189     std::ostringstream s_mdma;
    190     s_mdma << "mdma_" << x_id << "_" << y_id;
    191     mdma = new VciMultiDma<vci_param_int>(
    192                      s_mdma.str().c_str(),
     192    ////////////  MWMR controller and coprocessor
     193    std::ostringstream s_mwmr;
     194    std::ostringstream s_copro;
     195    s_mwmr << "mwmr_" << x_id << "_" << y_id;
     196
     197    if ( coproc_type ==  MWR_COPROC_CPY)
     198    {
     199        s_copro << "cpy_" << x_id << "_" << y_id;
     200        cpy = new CoprocCpy( s_copro.str().c_str(), 64 );       // burst size
     201
     202        mwmr = new VciMwmrDma<vci_param_int>(
     203                     s_mwmr.str().c_str(),
    193204                     mt_int,
    194                      IntTab(cluster_id, nb_procs),        // SRCID
    195                      IntTab(cluster_id, int_mdma_tgt_id), // TGTID
    196                      64,                                  // burst size
    197                      nb_dmas);                            // number of IRQs
     205                     IntTab(cluster_id, int_mwmr_ini_id), // SRCID
     206                     IntTab(cluster_id, int_mwmr_tgt_id), // TGTID
     207                     1,                                   // nb to_coproc ports
     208                     1,                                   // nb from_coproc ports
     209                     1,                                   // nb config registers
     210                     0,                                   // nb status registers
     211                     64 );                                // burst size (bytes)
     212    }
     213    if ( coproc_type == MWR_COPROC_DCT )
     214    {
     215        s_copro << "dct_" << x_id << "_" << y_id;
     216        dct = new CoprocDct( s_copro.str().c_str(), 64 , 16 );  // burst size / latency
     217
     218        mwmr = new VciMwmrDma<vci_param_int>(
     219                     s_mwmr.str().c_str(),
     220                     mt_int,
     221                     IntTab(cluster_id, int_mwmr_ini_id), // SRCID
     222                     IntTab(cluster_id, int_mwmr_tgt_id), // TGTID
     223                     1,                                   // nb to_coproc ports
     224                     1,                                   // nb from_coproc ports
     225                     1,                                   // nb config registers
     226                     0,                                   // nb status registers
     227                     64 );                                // burst size (bytes)
     228    }
     229    if ( coproc_type == MWR_COPROC_GCD )
     230    {
     231        s_copro << "gcd_" << x_id << "_" << y_id;
     232        gcd = new CoprocGcd( s_copro.str().c_str(), 64 );       // burst size
     233
     234        mwmr = new VciMwmrDma<vci_param_int>(
     235                     s_mwmr.str().c_str(),
     236                     mt_int,
     237                     IntTab(cluster_id, int_mwmr_ini_id), // SRCID
     238                     IntTab(cluster_id, int_mwmr_tgt_id), // TGTID
     239                     2,                                   // nb to_coproc ports
     240                     1,                                   // nb from_coproc ports
     241                     1,                                   // nb config registers
     242                     0,                                   // nb status registers
     243                     64 );                                // burst size (bytes)
     244    }
    198245
    199246    ///////////  Direct LOCAL_XBAR(S)
     
    435482    int_xbar_d->p_to_target[int_memc_tgt_id]          (signal_int_vci_tgt_memc);
    436483    int_xbar_d->p_to_target[int_xicu_tgt_id]          (signal_int_vci_tgt_xicu);
    437     int_xbar_d->p_to_target[int_mdma_tgt_id]          (signal_int_vci_tgt_mdma);
    438     int_xbar_d->p_to_initiator[int_mdma_ini_id]       (signal_int_vci_ini_mdma);
     484    int_xbar_d->p_to_target[int_mwmr_tgt_id]          (signal_int_vci_tgt_mwmr);
     485    int_xbar_d->p_to_initiator[int_mwmr_ini_id]       (signal_int_vci_ini_mwmr);
    439486    for (size_t p = 0; p < nb_procs; p++)
    440487       int_xbar_d->p_to_initiator[int_proc_ini_id + p] (signal_int_vci_ini_proc[p]);
     
    513560    {
    514561        if      ( i == 0 )       xicu->p_hwi[i]  (signal_irq_memc);
    515         else if ( i <= nb_dmas ) xicu->p_hwi[i]  (signal_irq_mdma[i-1]);
     562        else if ( i == 1 )       xicu->p_hwi[i]  (signal_irq_mwmr);
    516563        else                     xicu->p_hwi[i]  (signal_false);
    517564    }
     
    546593    xram_ram_wt->p_vci                           (signal_ram_vci_tgt_xram);
    547594
    548     /////////////////////////////////// MDMA
    549     mdma->p_clk                                  (this->p_clk);
    550     mdma->p_resetn                               (this->p_resetn);
    551     mdma->p_vci_target                           (signal_int_vci_tgt_mdma);
    552     mdma->p_vci_initiator                        (signal_int_vci_ini_mdma);
    553     for (size_t i=0 ; i<nb_dmas ; i++)
    554         mdma->p_irq[i]                           (signal_irq_mdma[i]);
     595    /////////////////////////////////// GCD coprocessor
     596    if ( coproc_type == MWR_COPROC_GCD )
     597    {
     598        gcd->p_clk                               (this->p_clk);
     599        gcd->p_resetn                            (this->p_resetn);
     600        gcd->p_opa                               (signal_to_coproc[0]);
     601        gcd->p_opb                               (signal_to_coproc[1]);
     602        gcd->p_res                               (signal_from_coproc[0]);
     603        gcd->p_config                            (signal_config_coproc[0]);
     604
     605        mwmr->p_clk                              (this->p_clk);
     606        mwmr->p_resetn                           (this->p_resetn);
     607        mwmr->p_vci_target                       (signal_int_vci_tgt_mwmr);
     608        mwmr->p_vci_initiator                    (signal_int_vci_ini_mwmr);
     609        mwmr->p_to_coproc[0]                     (signal_to_coproc[0]);
     610        mwmr->p_to_coproc[1]                     (signal_to_coproc[1]);
     611        mwmr->p_from_coproc[0]                   (signal_from_coproc[0]);
     612        mwmr->p_config[0]                        (signal_config_coproc[0]);
     613        mwmr->p_irq                              (signal_irq_mwmr);
     614    }
     615
     616    /////////////////////////////////// DCT coprocessor
     617    if ( coproc_type == MWR_COPROC_DCT )
     618    {
     619        dct->p_clk                               (this->p_clk);
     620        dct->p_resetn                            (this->p_resetn);
     621        dct->p_in                                (signal_to_coproc[0]);
     622        dct->p_out                               (signal_from_coproc[0]);
     623        dct->p_config                            (signal_config_coproc[0]);
     624
     625        mwmr->p_clk                              (this->p_clk);
     626        mwmr->p_resetn                           (this->p_resetn);
     627        mwmr->p_vci_target                       (signal_int_vci_tgt_mwmr);
     628        mwmr->p_vci_initiator                    (signal_int_vci_ini_mwmr);
     629        mwmr->p_to_coproc[0]                     (signal_to_coproc[0]);
     630        mwmr->p_from_coproc[0]                   (signal_from_coproc[0]);
     631        mwmr->p_config[0]                        (signal_config_coproc[0]);
     632        mwmr->p_irq                              (signal_irq_mwmr);
     633    }
     634
     635    /////////////////////////////////// CPY coprocessor
     636    if ( coproc_type == MWR_COPROC_CPY )
     637    {
     638        cpy->p_clk                               (this->p_clk);
     639        cpy->p_resetn                            (this->p_resetn);
     640        cpy->p_load                              (signal_to_coproc[0]);
     641        cpy->p_store                             (signal_from_coproc[0]);
     642        cpy->p_config                            (signal_config_coproc[0]);
     643
     644        mwmr->p_clk                              (this->p_clk);
     645        mwmr->p_resetn                           (this->p_resetn);
     646        mwmr->p_vci_target                       (signal_int_vci_tgt_mwmr);
     647        mwmr->p_vci_initiator                    (signal_int_vci_ini_mwmr);
     648        mwmr->p_to_coproc[0]                     (signal_to_coproc[0]);
     649        mwmr->p_from_coproc[0]                   (signal_from_coproc[0]);
     650        mwmr->p_config[0]                        (signal_config_coproc[0]);
     651        mwmr->p_irq                              (signal_irq_mwmr);
     652    }
    555653
    556654    //////////////////////////// RAM network CMD & RSP routers
     
    624722   signal_ram_dspin_cmd_false.write = false;
    625723   signal_ram_dspin_rsp_false.read  = true;
    626 } // end init
     724}
    627725
    628726}}
Note: See TracChangeset for help on using the changeset viewer.