Ignore:
Timestamp:
May 28, 2013, 11:02:08 AM (11 years ago)
Author:
alain
Message:

Major evolution of platform "tsar_generic_xbar"
to support 40 bits physical addresse, and 64 bits data
between mem_cache and external RAM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp

    r389 r396  
    1515// - Each processor has a private dma channel (vci_multi_dma)
    1616// - It uses the vci_xicu interrupt controller
    17 // - The peripherals MTTY, BDEV, FBUF, MNIC and BROM are in the cluster
    18 //   containing address 0xBFC00000.
     17// - The peripherals MTTY, BDEV, FBUF, MNIC and BROM are in cluster (0,0)
    1918// - The Multi-TTY component controls up to 15 terminals.
    2019// - Each Multi-DMA component controls up to 8 DMA channels.
     
    2625#include "../include/tsar_xbar_cluster.h"
    2726
    28 #define tmpl(x) template<\
    29    typename iss_t,int cmd_width, int rsp_width> \
    30    x TsarXbarCluster<\
    31    iss_t, cmd_width, rsp_width\
    32    >
    3327
    3428namespace soclib {
    3529namespace caba  {
    3630
    37 //////////////////////////////////////////////////////////////////////////
    38 //                 Constructor
    39 //////////////////////////////////////////////////////////////////////////
    40 tmpl(/**/)::TsarXbarCluster(
     31////////////////////////////////////////////////////////////////////////////////////
     32template<size_t dspin_cmd_width,
     33         size_t dspin_rsp_width,
     34         typename vci_param_int,
     35         typename vci_param_ext> TsarXbarCluster<dspin_cmd_width,
     36                                                 dspin_rsp_width,
     37                                                 vci_param_int,
     38                                                 vci_param_ext>::TsarXbarCluster(
     39////////////////////////////////////////////////////////////////////////////////////
    4140         sc_module_name                     insname,
    4241         size_t                             nb_procs,
     
    8685{
    8786    // Vectors of ports definition
    88 
    89     p_cmd_in        = alloc_elems<DspinInput<cmd_width> >("p_cmd_in", 2, 4);
    90     p_cmd_out       = alloc_elems<DspinOutput<cmd_width> >("p_cmd_out", 2, 4);
    91     p_rsp_in        = alloc_elems<DspinInput<rsp_width> >("p_rsp_in", 2, 4);
    92     p_rsp_out       = alloc_elems<DspinOutput<rsp_width> >("p_rsp_out", 2, 4);
    93 
     87    p_cmd_in        = alloc_elems<DspinInput<dspin_cmd_width> >("p_cmd_in", 2, 4);
     88    p_cmd_out       = alloc_elems<DspinOutput<dspin_cmd_width> >("p_cmd_out", 2, 4);
     89    p_rsp_in        = alloc_elems<DspinInput<dspin_rsp_width> >("p_rsp_in", 2, 4);
     90    p_rsp_out       = alloc_elems<DspinOutput<dspin_rsp_width> >("p_rsp_out", 2, 4);
     91
     92    /////////////////////////////////////////////////////////////////////////////
    9493    // Components definition
    95 
    96     // on direct network : local srcid[proc] in [0..nb_procs-1]
    97     // on direct network : local srcid[mdma] = nb_procs
    98     // on direct network : local srcid[bdev] = nb_procs + 1
    99 
    100     // on coherence network : local srcid[proc] in [0...nb_procs-1]
    101     // on coherence network : local srcid[memc] = nb_procs
    102 
    10394    /////////////////////////////////////////////////////////////////////////////
    10495    std::cout << "  - building proc_" << x_id << "_" << y_id << "-*" << std::endl;
     
    10798    {
    10899        std::ostringstream sproc;
    109         sproc << "proc_" << p;
    110         proc[p] = new VciCcVCacheWrapper<vci_param_d, cmd_width, rsp_width, iss_t>(
     100        sproc << "proc_" << x_id << "_" << y_id << "_" << p;
     101        proc[p] = new VciCcVCacheWrapper<vci_param_int,
     102                                         dspin_cmd_width,
     103                                         dspin_rsp_width,
     104                                         GdbServer<Mips32ElIss> >(
    111105                      sproc.str().c_str(),
    112106                      cluster_id*nb_procs + p,        // GLOBAL PROC_ID
     
    130124        std::ostringstream swip;
    131125        swip << "wi_proc_" << x_id << "_" << y_id << p;
    132         wi_proc[p] = new VciDspinInitiatorWrapper<vci_param_d,cmd_width,rsp_width>(
     126        wi_proc[p] = new VciDspinInitiatorWrapper<vci_param_int,
     127                                                  dspin_cmd_width,
     128                                                  dspin_rsp_width>(
    133129                     swip.str().c_str(),
    134130                     x_width + y_width + l_width);
     
    138134    std::cout << "  - building memc_" << x_id << "_" << y_id << std::endl;
    139135
    140     memc = new VciMemCache<vci_param_d, vci_param_x, rsp_width, cmd_width>(
    141                      "memc",
     136    std::ostringstream smemc;
     137    smemc << "memc_" << x_id << "_" << y_id;
     138    memc = new VciMemCache<vci_param_int,
     139                           vci_param_ext,
     140                           dspin_rsp_width,
     141                           dspin_cmd_width>(
     142                     smemc.str().c_str(),
    142143                     mtd,                                // Mapping Table direct space
    143144                     mtx,                                // Mapping Table external space
     
    153154                     memc_debug_ok );
    154155
    155     wt_memc = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>(
     156    wt_memc = new VciDspinTargetWrapper<vci_param_int,
     157                                        dspin_cmd_width,
     158                                        dspin_rsp_width>(
    156159                     "wt_memc",
    157160                     x_width + y_width + l_width);
     
    160163    std::cout << "  - building xram_" << x_id << "_" << y_id << std::endl;
    161164
    162     xram = new VciSimpleRam<vci_param_x>(
    163                      "xram",
     165    std::ostringstream sxram;
     166    sxram << "xram_" << x_id << "_" << y_id;
     167    xram = new VciSimpleRam<vci_param_ext>(
     168                     sxram.str().c_str(),
    164169                     IntTab(cluster_id),
    165170                     mtx,
     
    170175    std::cout << "  - building xicu_" << x_id << "_" << y_id << std::endl;
    171176
    172     xicu = new VciXicu<vci_param_d>(
    173                      "xicu",
     177    std::ostringstream sxicu;
     178    sxicu << "xicu_" << x_id << "_" << y_id;
     179    xicu = new VciXicu<vci_param_int>(
     180                     sxicu.str().c_str(),
    174181                     mtd,                               // mapping table
    175182                     IntTab(cluster_id, tgtid_xicu),    // TGTID_D
     
    179186                     nb_procs);                         // number of output IRQs
    180187
    181     wt_xicu = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>(
     188    wt_xicu = new VciDspinTargetWrapper<vci_param_int,
     189                                        dspin_cmd_width,
     190                                        dspin_rsp_width>(
    182191                     "wt_xicu",
    183192                     x_width + y_width + l_width);
     
    186195    std::cout << "  - building mdma_" << x_id << "_" << y_id << std::endl;
    187196
    188     mdma = new VciMultiDma<vci_param_d>(
    189                      "mdma",
     197    std::ostringstream smdma;
     198    smdma << "mdma_" << x_id << "_" << y_id;
     199    mdma = new VciMultiDma<vci_param_int>(
     200                     smdma.str().c_str(),
    190201                     mtd,
    191202                     IntTab(cluster_id, nb_procs),        // SRCID
     
    194205                     nb_dmas);                            // number of IRQs
    195206
    196     wt_mdma = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>(
     207    wt_mdma = new VciDspinTargetWrapper<vci_param_int,
     208                                        dspin_cmd_width,
     209                                        dspin_rsp_width>(
    197210                     "wt_mdma",
    198211                     x_width + y_width + l_width);
    199212
    200     wi_mdma = new VciDspinInitiatorWrapper<vci_param_d,cmd_width,rsp_width>(
     213    wi_mdma = new VciDspinInitiatorWrapper<vci_param_int,
     214                                           dspin_cmd_width,
     215                                           dspin_rsp_width>(
    201216                     "wi_mdma",
    202217                     x_width + y_width + l_width);
     
    213228    }
    214229
    215     xbar_cmd_d = new DspinLocalCrossbar<cmd_width>(
     230    xbar_cmd_d = new DspinLocalCrossbar<dspin_cmd_width>(
    216231                     "xbar_cmd_d",
    217232                     mtd,                          // mapping table
     
    227242    std::cout << "  - building xbar_rsp_d_" << x_id << "_" << y_id << std::endl;
    228243
    229     xbar_rsp_d = new DspinLocalCrossbar<rsp_width>(
     244    xbar_rsp_d = new DspinLocalCrossbar<dspin_rsp_width>(
    230245                     "xbar_rsp_d",
    231246                     mtd,                          // mapping table
     
    241256    std::cout << "  - building xbar_m2p_c" << x_id << "_" << y_id << std::endl;
    242257
    243     xbar_m2p_c = new DspinLocalCrossbar<cmd_width>(
     258    xbar_m2p_c = new DspinLocalCrossbar<dspin_cmd_width>(
    244259                     "xbar_m2p_c",
    245260                     mtd,                          // mapping table
     
    255270    std::cout << "  - building xbar_p2m_c_" << x_id << "_" << y_id << std::endl;
    256271
    257     xbar_p2m_c = new DspinLocalCrossbar<rsp_width>(
     272    xbar_p2m_c = new DspinLocalCrossbar<dspin_rsp_width>(
    258273                     "xbar_p2m_c",
    259274                     mtd,                          // mapping table
     
    269284    std::cout << "  - building router_cmd_" << x_id << "_" << y_id << std::endl;
    270285
    271     router_cmd = new VirtualDspinRouter<cmd_width>(
     286    router_cmd = new VirtualDspinRouter<dspin_cmd_width>(
    272287                     "router_cmd",
    273288                     x_id,y_id,                    // coordinate in the mesh
     
    278293    std::cout << "  - building router_rsp_" << x_id << "_" << y_id << std::endl;
    279294
    280     router_rsp = new VirtualDspinRouter<rsp_width>(
     295    router_rsp = new VirtualDspinRouter<dspin_rsp_width>(
    281296                     "router_rsp",
    282297                     x_id,y_id,                    // coordinates in mesh
     
    290305        std::cout << "  - building brom" << std::endl;
    291306
    292         brom = new VciSimpleRam<vci_param_d>(
    293                         "brom",
    294                         IntTab(cluster_id, tgtid_brom),
    295                         mtd,
    296                         loader);
    297 
    298         wt_brom = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>("wt_brom",
     307        brom = new VciSimpleRam<vci_param_int>(
     308                     "brom",
     309                     IntTab(cluster_id, tgtid_brom),
     310                     mtd,
     311                     loader);
     312
     313        wt_brom = new VciDspinTargetWrapper<vci_param_int,
     314                                            dspin_cmd_width,
     315                                            dspin_rsp_width>(
     316                     "wt_brom",
    299317                     x_width + y_width + l_width);
    300318
     
    302320        std::cout << "  - building fbuf" << std::endl;
    303321
    304         fbuf = new VciFrameBuffer<vci_param_d>(
    305                         "fbuf",
    306                         IntTab(cluster_id, tgtid_fbuf),
    307                         mtd,
    308                         xfb, yfb);
    309 
    310         wt_fbuf = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>("wt_fbuf",
     322        fbuf = new VciFrameBuffer<vci_param_int>(
     323                     "fbuf",
     324                     IntTab(cluster_id, tgtid_fbuf),
     325                     mtd,
     326                     xfb, yfb);
     327
     328        wt_fbuf = new VciDspinTargetWrapper<vci_param_int,
     329                                            dspin_cmd_width,
     330                                            dspin_rsp_width>(
     331                     "wt_fbuf",
    311332                     x_width + y_width + l_width);
    312333
     
    314335        std::cout << "  - building bdev" << std::endl;
    315336
    316         bdev = new VciBlockDeviceTsar<vci_param_d>(
    317                         "bdev",
    318                         mtd,
    319                         IntTab(cluster_id, nb_procs+1),
    320                         IntTab(cluster_id, tgtid_bdev),
    321                         disk_name,
    322                         block_size,
    323                         64);            // burst size
    324 
    325         wt_bdev = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>("wt_bdev",
    326                      x_width + y_width + l_width);
    327         wi_bdev = new VciDspinInitiatorWrapper<vci_param_d,cmd_width,rsp_width>("wi_bdev",
     337        bdev = new VciBlockDeviceTsar<vci_param_int>(
     338                     "bdev",
     339                     mtd,
     340                     IntTab(cluster_id, nb_procs+1),
     341                     IntTab(cluster_id, tgtid_bdev),
     342                     disk_name,
     343                     block_size,
     344                     64);            // burst size
     345
     346        wt_bdev = new VciDspinTargetWrapper<vci_param_int,
     347                                            dspin_cmd_width,
     348                                            dspin_rsp_width>(
     349                     "wt_bdev",
     350                     x_width + y_width + l_width);
     351
     352        wi_bdev = new VciDspinInitiatorWrapper<vci_param_int,
     353                                               dspin_cmd_width,
     354                                               dspin_rsp_width>(
     355                     "wi_bdev",
    328356                     x_width + y_width + l_width);
    329357
     
    331359        std::cout << "  - building mnic" << std::endl;
    332360
    333         mnic = new VciMultiNic<vci_param_d>(
    334                         "mnic",
    335                         IntTab(cluster_id, tgtid_mnic),
    336                         mtd,
    337                         nic_channels,
    338                         nic_rx_name,
    339                         nic_tx_name,
    340                         0,             // mac_4 address
    341                         0 );           // mac_2 address
    342 
    343         wt_mnic = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>("wt_mnic",
     361        mnic = new VciMultiNic<vci_param_int>(
     362                     "mnic",
     363                     IntTab(cluster_id, tgtid_mnic),
     364                     mtd,
     365                     nic_channels,
     366                     nic_rx_name,
     367                     nic_tx_name,
     368                     0,             // mac_4 address
     369                     0 );           // mac_2 address
     370
     371        wt_mnic = new VciDspinTargetWrapper<vci_param_int,
     372                                            dspin_cmd_width,
     373                                            dspin_rsp_width>(
     374                     "wt_mnic",
    344375                     x_width + y_width + l_width);
    345376
     
    354385            vect_names.push_back(term_name.str().c_str());
    355386        }
    356         mtty = new VciMultiTty<vci_param_d>(
    357                         "mtty",
    358                         IntTab(cluster_id, tgtid_mtty),
    359                         mtd,
    360                         vect_names);
    361 
    362         wt_mtty = new VciDspinTargetWrapper<vci_param_d,cmd_width,rsp_width>("wt_mtty",
    363                      x_width + y_width + l_width);
    364 
     387        mtty = new VciMultiTty<vci_param_int>(
     388                     "mtty",
     389                     IntTab(cluster_id, tgtid_mtty),
     390                     mtd,
     391                     vect_names);
     392
     393        wt_mtty = new VciDspinTargetWrapper<vci_param_int,
     394                                            dspin_cmd_width,
     395                                            dspin_rsp_width>(
     396                     "wt_mtty",
     397                     x_width + y_width + l_width);
    365398    }
    366399
     
    679712} // end constructor
    680713
    681 ///////////////////////////////////////////////////////////////////////////
    682 //    destructor
    683 ///////////////////////////////////////////////////////////////////////////
    684 tmpl(/**/)::~TsarXbarCluster() {}
    685 }
    686 }
    687 
     714}}
    688715
    689716// Local Variables:
Note: See TracChangeset for help on using the changeset viewer.