Changeset 379


Ignore:
Timestamp:
Apr 20, 2013, 6:32:32 PM (11 years ago)
Author:
alain
Message:

Code polishing

Location:
trunk/platforms/tsar_generic_xbar
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/tsar_generic_xbar/soclib.conf

    r378 r379  
    1 config.default.toolchain.set("cflags", config.default.toolchain.cflags + ['-DI_WANT_ILLEGAL_VCI'])
    21
    3 config.addDescPath("/dsk/l1/misc/joannou/tsar/trunk/")
     2config.addDescPath("/Users/alain/soc/tsar-trunk-svn-2013/")
  • trunk/platforms/tsar_generic_xbar/top.cpp

    r378 r379  
    1616// - It uses the vci_mem_cache
    1717// - It contains one vci_xicu and one vci_multi_dma per cluster.
     18// - It contains one vci_simple ram per cluster to model the L3 cache.
    1819//
    1920// All clusters are identical, but the cluster containing address
     
    2728// It is build with one single component implementing a cluster:
    2829// The Tsarv4ClusterMmu component is defined in files
    29 // tsarv4_cluster_mmu.* (with * = cpp, h, sd)
     30// tsar_xbar_cluster.* (with * = cpp, h, sd)
    3031//
    3132// The IRQs are connected to XICUs as follow:
     
    157158#define BDEV_IMAGE_NAME       "giet_vm/display/images.raw"
    158159
    159 #define NIC_RX_NAME           "giet_vm/nic/rx_data.txt"
    160 #define NIC_TX_NAME           "giet_vm/nic/tx_data.txt"
     160#define NIC_RX_NAME           "giet_vm/nic/rx_packets.txt"
     161#define NIC_TX_NAME           "giet_vm/nic/tx_packets.txt"
    161162#define NIC_TIMEOUT           10000
    162163
     
    426427   }
    427428   std::cout << maptabd << std::endl;
    428 
    429 /*
    430    WE DONT NEED any COHERENCE MAPPING TABLE, AS THE DIRECT NETWORK
    431    USES DIRECT ADRESSING (XID,YID,LID)
    432 
    433    // coherence network
    434    // - tgtid_c_proc = srcid_c_proc = local procid
    435    // - tgtid_c_memc = srcid_c_memc = NB_PROCS_MAX
    436    MappingTable maptabc(address_width,
    437          IntTab(x_width + y_width, srcid_width - x_width - y_width),
    438          IntTab(x_width + y_width, srcid_width - x_width - y_width),
    439          0x00FF0000);
    440 
    441    for (size_t x = 0; x < CLUSTER_X; x++)
    442    {
    443       for (size_t y = 0; y < CLUSTER_Y; y++)
    444       {
    445          sc_uint<address_width> offset  = cluster(x,y) << (address_width-x_width-y_width);
    446 
    447          // cleanup requests must be routed to the memory cache
    448          std::ostringstream sh;
    449          sh << "c_seg_memc_" << x << "_" << y;
    450          maptabc.add(Segment(sh.str(), (NB_PROCS_MAX << (address_width - srcid_width)) + offset,
    451                      0x10, IntTab(cluster(x,y), NB_PROCS_MAX), false));
    452 
    453          // update & invalidate requests must be routed to the proper processor
    454          for ( size_t p = 0 ; p < NB_PROCS_MAX ; p++)
    455          {
    456             std::ostringstream sp;
    457             sp << "c_seg_proc_" << x << "_" << y << "_" << p;
    458             maptabc.add( Segment( sp.str() , (p << (address_width - srcid_width)) + offset ,
    459                          0x10 , IntTab(cluster(x,y), p) , false));
    460          }
    461       }
    462    }
    463    std::cout << maptabc << std::endl;
    464 
    465 */
    466429
    467430   // external network
     
    601564            );
    602565
     566            std::cout << std::endl;
    603567            std::cout << "cluster_" << x << "_" << y << " constructed" << std::endl;
     568            std::cout << std::endl;
     569
    604570#if USE_OPENMP
    605571            } // end critical
     
    796762         clusters[1][1]->signal_dspin_rsp_brom_t.print_trace("DIRECT rsp_out_brom_1_1");
    797763*/
     764        // trace proc[debug_proc_id]
     765        if ( debug_proc_id < (CLUSTER_X * CLUSTER_Y * NB_PROCS_MAX) )
     766        {
     767            size_t l = debug_proc_id % (CLUSTER_X * CLUSTER_Y) ;
     768            size_t y = (debug_proc_id / NB_PROCS_MAX) % CLUSTER_Y ;
     769            size_t x = debug_proc_id / (CLUSTER_Y * NB_PROCS_MAX) ;
     770
     771            std::ostringstream signame;
     772            signame << "VCI signal PROC_" << x << "_" << y << "_" << l;
     773
     774            clusters[x][y]->proc[l]->print_trace();
     775            clusters[x][y]->signal_vci_ini_proc[l].print_trace("signame");
     776        }
    798777/*
    799          // trace proc[debug_proc_id]
    800          if ( debug_proc_id < (CLUSTER_X * CLUSTER_Y * NB_PROCS_MAX) )
    801          {
    802              size_t proc_x = debug_proc_id / CLUSTER_Y;
    803              size_t proc_y = debug_proc_id % CLUSTER_Y;
    804 
    805              clusters[proc_x][proc_y]->proc[0]->print_trace();
    806              clusters[proc_x][proc_y]->signal_vci_ini_proc[0].print_trace("proc_0");
    807          }
    808 
    809          // trace memc[debug_memc_id]
    810          if ( debug_memc_id < (CLUSTER_X * CLUSTER_Y) )
    811          {
    812              size_t memc_x = debug_memc_id / CLUSTER_Y;
    813              size_t memc_y = debug_memc_id % CLUSTER_Y;
    814 
    815              clusters[memc_x][memc_y]->memc->print_trace();
    816              clusters[memc_x][memc_y]->signal_vci_tgt_memc.print_trace("memc");
    817          }
     778        // trace memc[debug_memc_id]
     779        if ( debug_memc_id < (CLUSTER_X * CLUSTER_Y) )
     780        {
     781            size_t x = debug_memc_id / CLUSTER_Y;
     782            size_t y = debug_memc_id % CLUSTER_Y;
     783
     784            std::ostringstream signame;
     785            signame << "VCI signal MEMC_" << x << "_" << y;
     786
     787            clusters[memc_x][memc_y]->memc->print_trace();
     788            clusters[memc_x][memc_y]->signal_vci_tgt_memc.print_trace("signame");
     789        }
    818790*/
    819 // clusters[0][0]->signal_vci_tgt_xicu.print_trace("xicu_0_0");
    820 // clusters[0][1]->signal_vci_tgt_xicu.print_trace("xicu_0_1");
    821 // clusters[1][0]->signal_vci_tgt_xicu.print_trace("xicu_1_0");
    822 // clusters[1][1]->signal_vci_tgt_xicu.print_trace("xicu_1_1");
    823 
    824 // if ( clusters[1][1]->signal_irq_mdma[0].read() )
    825 //    std::cout << std::endl << " IRQ_DMA_1_1 activated" << std::endl;
    826 // if ( clusters[1][1]->signal_proc_it[0].read() )
    827 //    std::cout <<  " IRQ_PROC_1_1 activated" << std::endl << std::endl;
    828 
    829 // trace ioc component
    830 // size_t io_x   = cluster_io_id / CLUSTER_Y;
    831 // size_t io_y   = cluster_io_id % CLUSTER_Y;
    832 // clusters[io_x][io_y]->bdev->print_trace();
    833 // clusters[io_x][io_y]->signal_vci_tgt_bdev.print_trace("bdev_tgt  ");
    834 // clusters[io_x][io_y]->signal_vci_ini_bdev.print_trace("bdev_ini  ");
    835 
    836 // clusters[1][1]->mdma->print_trace();
    837 // clusters[1][1]->signal_vci_tgt_mdma.print_trace("mdma_1_1_tgt  ");
    838 // clusters[1][1]->signal_vci_ini_mdma.print_trace("mdma_1_1_ini  ");
    839 
     791        // trace external peripherals
     792        size_t io_x   = cluster_io_id / CLUSTER_Y;
     793        size_t io_y   = cluster_io_id % CLUSTER_Y;
     794       
     795        clusters[io_x][io_y]->signal_vci_tgt_mtty.print_trace("VCI signal TTY");
     796/*
     797        clusters[io_x][io_y]->bdev->print_trace();
     798        clusters[io_x][io_y]->signal_vci_tgt_bdev.print_trace("VCI signal BDEV_TGT");
     799        clusters[io_x][io_y]->signal_vci_ini_bdev.print_trace("VCI signal BDEV_INI");
     800*/
    840801      }
    841802
  • trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp

    r378 r379  
    102102    {
    103103        std::ostringstream sproc;
    104         sproc << "proc_" << x_id << "_" << y_id << "_" << p;
     104        sproc << "proc_" << p;
    105105        proc[p] = new VciCcVCacheWrapper<vci_param, iss_t>(
    106106                      sproc.str().c_str(),
     
    133133    std::cout << "  - building memc_" << x_id << "_" << y_id << std::endl;
    134134
    135     std::ostringstream smemc;
    136     smemc << "memc_" << x_id << "_" << y_id;
    137135    memc = new VciMemCache<vci_param>(
    138                      smemc.str().c_str(),
     136                     "memc",
    139137                     mtd,                                // Mapping Table direct space
    140138                     mtx,                                // Mapping Table external space
     
    150148                     memc_debug_ok );
    151149
    152     std::ostringstream swtm;
    153     swtm << "wt_memc_" << x_id << "_" << y_id;
    154150    wt_memc = new VciDspinTargetWrapper<vci_param,cmd_width,rsp_width>(
    155                      swtm.str().c_str(),
     151                     "wt_memc",
    156152                     x_width + y_width + l_width);
    157153
     
    159155    std::cout << "  - building xram_" << x_id << "_" << y_id << std::endl;
    160156
    161     std::ostringstream sxram;
    162     sxram << "xram_" << x_id << "_" << y_id;
    163157    xram = new VciSimpleRam<vci_param>(
    164                      sxram.str().c_str(),
     158                     "xram",
    165159                     IntTab(cluster_id),
    166160                     mtx,
    167161                     loader,
    168162                     xram_latency);
    169 /*
    170     std::ostringstream swtx;
    171     swtx << "wt_xram_" << x_id << "_" << y_id;
    172     wt_xram = new VciDspinTargetWrapper<vci_param,cmd_width,rsp_width>(
    173                      swtx.str().c_str(),
    174                      x_width + y_width );
    175 */
     163
    176164    /////////////////////////////////////////////////////////////////////////////
    177165    std::cout << "  - building xicu_" << x_id << "_" << y_id << std::endl;
    178166
    179     std::ostringstream sicu;
    180     sicu << "xicu_" << x_id << "_" << y_id;
    181167    xicu = new VciXicu<vci_param>(
    182                      sicu.str().c_str(),
     168                     "xicu",
    183169                     mtd,                               // mapping table
    184170                     IntTab(cluster_id, tgtid_xicu),    // TGTID_D
     
    188174                     nb_procs);                         // number of output IRQs
    189175
    190     std::ostringstream swtu;
    191     swtu << "wt_xicu_" << x_id << "_" << y_id;
    192176    wt_xicu = new VciDspinTargetWrapper<vci_param,cmd_width,rsp_width>(
    193                      swtu.str().c_str(),
     177                     "wt_xicu",
    194178                     x_width + y_width + l_width);
    195179
     
    197181    std::cout << "  - building mdma_" << x_id << "_" << y_id << std::endl;
    198182
    199     std::ostringstream sdma;
    200     sdma << "dma_" << x_id << "_" << y_id;
    201183    mdma = new VciMultiDma<vci_param>(
    202                      sdma.str().c_str(),
     184                     "mdma",
    203185                     mtd,
    204186                     IntTab(cluster_id, nb_procs),        // SRCID
    205187                     IntTab(cluster_id, tgtid_mdma),      // TGTID
    206188                     64,                                  // burst size
    207                      nb_dmas);                           // number of IRQs
    208 
    209     std::ostringstream swta;
    210     swta << "wt_mdma_" << x_id << "_" << y_id;
     189                     nb_dmas);                            // number of IRQs
     190
    211191    wt_mdma = new VciDspinTargetWrapper<vci_param,cmd_width,rsp_width>(
    212                      swtu.str().c_str(),
    213                      x_width + y_width + l_width);
    214 
    215     std::ostringstream swia;
    216     swia << "wi_mdma_" << x_id << "_" << y_id;
     192                     "wt_mdma",
     193                     x_width + y_width + l_width);
     194
    217195    wi_mdma = new VciDspinInitiatorWrapper<vci_param,cmd_width,rsp_width>(
    218                      swtu.str().c_str(),
     196                     "wi_mdma",
    219197                     x_width + y_width + l_width);
    220198
     
    230208    }
    231209
    232     std::ostringstream sdcmd;
    233     sdcmd << "xbar_cmd_d_" << x_id << "_" << y_id;
    234210    xbar_cmd_d = new DspinLocalCrossbar<cmd_width>(
    235                      sdcmd.str().c_str(),
     211                     "xbar_cmd_d",
    236212                     mtd,                          // mapping table
    237213                     x_id, y_id,                   // cluster coordinates
     
    246222    std::cout << "  - building xbar_rsp_d_" << x_id << "_" << y_id << std::endl;
    247223
    248     std::ostringstream sdrsp;
    249     sdrsp << "xbar_rsp_d_" << x_id << "_" << y_id;
    250224    xbar_rsp_d = new DspinLocalCrossbar<rsp_width>(
    251                      sdrsp.str().c_str(),
     225                     "xbar_rsp_d",
    252226                     mtd,                          // mapping table
    253227                     x_id, y_id,                   // cluster coordinates
     
    262236    std::cout << "  - building xbar_m2p_c" << x_id << "_" << y_id << std::endl;
    263237
    264     std::ostringstream sccmd;
    265     sccmd << "xbar_m2p_c_" << x_id << "_" << y_id;
    266238    xbar_m2p_c = new DspinLocalCrossbar<cmd_width>(
    267                      sccmd.str().c_str(),
     239                     "xbar_m2p_c",
    268240                     mtd,                          // mapping table
    269241                     x_id, y_id,                   // cluster coordinates
     
    278250    std::cout << "  - building xbar_p2m_c_" << x_id << "_" << y_id << std::endl;
    279251
    280     std::ostringstream scrsp;
    281     scrsp << "xbar_p2m_c_" << x_id << "_" << y_id;
    282252    xbar_p2m_c = new DspinLocalCrossbar<rsp_width>(
    283                      scrsp.str().c_str(),
     253                     "xbar_p2m_c",
    284254                     mtd,                          // mapping table
    285255                     x_id, y_id,                   // cluster coordinates
    286                      x_width, y_width, 0,          // l_width unused on the network going from proc to memc (only X and Y identifie the cluster)
     256                     x_width, y_width, 0,          // l_width unused on p2m network
    287257                     nb_procs,                     // number of local sources
    288258                     1,                            // number of local dests
    289259                     2, 2,                         // fifo depths 
    290260                     false,                        // don't use local routing table
    291                      false );                      // no broacast
     261                     false );                      // no broacast 
    292262
    293263    /////////////////////////////////////////////////////////////////////////////
    294264    std::cout << "  - building router_cmd_" << x_id << "_" << y_id << std::endl;
    295265
    296     std::ostringstream scmdr;
    297     scmdr << "router_cmd_" << x_id << "_" << y_id;
    298266    router_cmd = new VirtualDspinRouter<cmd_width>(
    299                      scmdr.str().c_str(),
     267                     "router_cmd",
    300268                     x_id,y_id,                    // coordinate in the mesh
    301269                     x_width, y_width,             // x & y fields width
     
    305273    std::cout << "  - building router_rsp_" << x_id << "_" << y_id << std::endl;
    306274
    307     std::ostringstream srspr;
    308     srspr << "router_rsp_" << x_id << "_" << y_id;
    309275    router_rsp = new VirtualDspinRouter<rsp_width>(
    310                      srspr.str().c_str(),
     276                     "router_rsp",
    311277                     x_id,y_id,                    // coordinates in mesh
    312278                     x_width, y_width,             // x & y fields width
Note: See TracChangeset for help on using the changeset viewer.