Ignore:
Timestamp:
Aug 30, 2013, 6:28:10 PM (11 years ago)
Author:
meunier
Message:
  • Added activity counters to the vci_mem_cache
  • Modified the print_trace function accordingly
  • Refactored code in vci_mem_cache because there was a mix of 2-space and 4-space indentation
  • Modified topcell to factorize ALMOS specifications
Location:
trunk/platforms/tsar_generic_xbar
Files:
4 edited

Legend:

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

    r486 r504  
    11
    2 config.addDescPath("/Users/alain/soc/tsar-trunk-svn-2013/")
  • trunk/platforms/tsar_generic_xbar/top.cpp

    r493 r504  
    9898///////////////////////////////////////////////////
    9999
    100 //#define USE_ALMOS
    101 #define USE_GIET
     100#define USE_ALMOS 1
     101//#define USE_GIET
    102102
    103103#ifdef USE_ALMOS
     
    116116//               Parallelisation
    117117///////////////////////////////////////////////////
    118 #define USE_OPENMP               0
     118#define USE_OPENMP 0
    119119
    120120#if USE_OPENMP
     
    123123
    124124//  cluster index (computed from x,y coordinates)
    125 #define cluster(x,y)   (y + YMAX*x)
     125#define cluster(x,y)   (y + YMAX * x)
    126126
    127127///////////////////////////////////////////////////////////
     
    139139#define vci_cell_width_ext    8
    140140
     141#ifdef USE_ALMOS
     142#define vci_address_width     32
     143#endif
     144#ifdef USE_GIET
     145#define vci_address_width     40
     146#endif
    141147#define vci_plen_width        8
    142 #define vci_address_width     40
    143148#define vci_rerror_width      1
    144149#define vci_clen_width        1
     
    224229//////////////////////i/////////////////////////////////////
    225230
    226 #define MAX_FROZEN_CYCLES     10000
     231#define MAX_FROZEN_CYCLES     100000
    227232
    228233/////////////////////////////////////////////////////////
     
    240245
    241246#define FBUF_BASE       0x00B2000000     
    242 #define FBUF_SIZE       FBUF_X_SIZE * FBUF_Y_SIZE * 2
     247#define FBUF_SIZE       (FBUF_X_SIZE * FBUF_Y_SIZE * 2)
    243248
    244249#define BDEV_BASE       0x00B3000000     
     
    260265#define MEMC_SIZE       0x0010000000   // 256 Mbytes per cluster
    261266
    262 #define XICU_BASE       0x00B0000000     
     267#ifdef USE_ALMOS
     268   #define XICU_BASE    0x0030000000
     269#endif
     270#ifdef USE_GIET
     271   #define XICU_BASE    0x00B0000000
     272#endif
    263273#define XICU_SIZE       0x0000001000   // 4 Kbytes
    264274
    265 #define MDMA_BASE       0x00B1000000     
     275#ifdef USE_ALMOS
     276   #define MDMA_BASE    0x0031000000
     277#endif
     278#ifdef USE_GIET
     279   #define MDMA_BASE    0x00B1000000
     280#endif
    266281#define MDMA_SIZE       0x0000001000 * NB_DMA_CHANNELS  // 4 Kbytes per channel 
    267282
     
    281296#define CDMA_TGTID      8
    282297
     298bool stop_called = false;
     299
    283300/////////////////////////////////
    284301int _main(int argc, char *argv[])
     
    291308   char     soft_name[256]   = soft_pathname;      // pathname to binary code
    292309#endif
    293    uint64_t ncycles          = 1000000000;        // simulated cycles
     310   uint64_t ncycles          = 0xFFFFFFFFFFFFFFFF; // simulated cycles
    294311   char     disk_name[256]   = BDEV_IMAGE_NAME;    // pathname to the disk image
    295312   char     nic_rx_name[256] = NIC_RX_NAME;        // pathname to the rx packets file
     
    302319   uint32_t debug_from       = 0;                  // trace start cycle
    303320   uint32_t frozen_cycles    = MAX_FROZEN_CYCLES;  // monitoring frozen processor
    304    size_t   cluster_io_id    = 0;                  // index of cluster containing IOs
     321   size_t   cluster_io_id;                         // index of cluster containing IOs
    305322   struct   timeval t1,t2;
    306323   uint64_t ms1,ms2;
     
    311328      for (int n = 1; n < argc; n = n + 2)
    312329      {
    313          if ((strcmp(argv[n],"-NCYCLES") == 0) && (n+1<argc))
    314          {
    315             ncycles = atoi(argv[n+1]);
    316          }
    317          else if ((strcmp(argv[n],"-SOFT") == 0) && (n+1<argc) )
     330         if ((strcmp(argv[n], "-NCYCLES") == 0) && (n + 1 < argc))
     331         {
     332            ncycles = atoi(argv[n + 1]);
     333         }
     334         else if ((strcmp(argv[n], "-SOFT") == 0) && (n + 1 < argc))
    318335         {
    319336#ifdef USE_ALMOS
     
    321338#endif
    322339#ifdef USE_GIET
    323             strcpy(soft_name, argv[n+1]);
    324 #endif
    325          }
    326          else if ((strcmp(argv[n],"-DISK") == 0) && (n+1<argc) )
    327          {
    328             strcpy(disk_name, argv[n+1]);
    329          }
    330          else if ((strcmp(argv[n],"-DEBUG") == 0) && (n+1<argc) )
     340            strcpy(soft_name, argv[n + 1]);
     341#endif
     342         }
     343         else if ((strcmp(argv[n],"-DISK") == 0) && (n + 1 < argc))
     344         {
     345            strcpy(disk_name, argv[n + 1]);
     346         }
     347         else if ((strcmp(argv[n],"-DEBUG") == 0) && (n + 1 < argc))
    331348         {
    332349            debug_ok = true;
    333             debug_from = atoi(argv[n+1]);
    334          }
    335          else if ((strcmp(argv[n],"-MEMCID") == 0) && (n+1<argc) )
    336          {
    337             debug_memc_id = atoi(argv[n+1]);
    338             assert( (debug_memc_id < (XMAX*YMAX) ) &&
     350            debug_from = atoi(argv[n + 1]);
     351         }
     352         else if ((strcmp(argv[n], "-MEMCID") == 0) && (n + 1 < argc))
     353         {
     354            debug_memc_id = atoi(argv[n + 1]);
     355            assert((debug_memc_id < (XMAX * YMAX)) &&
    339356                   "debug_memc_id larger than XMAX * YMAX" );
    340357         }
    341          else if ((strcmp(argv[n],"-PROCID") == 0) && (n+1<argc) )
    342          {
    343             debug_proc_id = atoi(argv[n+1]);
    344             assert( (debug_proc_id < (XMAX * YMAX * NB_PROCS_MAX) ) &&
    345                    "debug_proc_id larger than XMAX * YMAX * NB_PROCS" );
    346          }
    347          else if ((strcmp(argv[n], "-THREADS") == 0) && ((n+1) < argc))
    348          {
    349             threads_nr = atoi(argv[n+1]);
     358         else if ((strcmp(argv[n], "-PROCID") == 0) && (n + 1 < argc))
     359         {
     360            debug_proc_id = atoi(argv[n + 1]);
     361            assert((debug_proc_id < (XMAX * YMAX * NB_PROCS_MAX)) &&
     362                   "debug_proc_id larger than XMAX * YMAX * NB_PROCS");
     363         }
     364         else if ((strcmp(argv[n], "-THREADS") == 0) && ((n + 1) < argc))
     365         {
     366            threads_nr = atoi(argv[n + 1]);
    350367            threads_nr = (threads_nr < 1) ? 1 : threads_nr;
    351368         }
    352          else if ((strcmp(argv[n], "-FROZEN") == 0) && (n+1 < argc))
    353          {
    354             frozen_cycles = atoi(argv[n+1]);
    355          }
    356          else if ((strcmp(argv[n], "-PERIOD") == 0) && (n+1 < argc))
    357          {
    358             debug_period = atoi(argv[n+1]);
     369         else if ((strcmp(argv[n], "-FROZEN") == 0) && (n + 1 < argc))
     370         {
     371            frozen_cycles = atoi(argv[n + 1]);
     372         }
     373         else if ((strcmp(argv[n], "-PERIOD") == 0) && (n + 1 < argc))
     374         {
     375            debug_period = atoi(argv[n + 1]);
    359376         }
    360377         else
     
    401418#ifdef USE_GIET
    402419    assert( (vci_address_width == 40) and
    403             "VCI address width must be 40 bits" );
    404 #endif
     420            "VCI address width with the GIET must be 40 bits" );
     421#endif
     422
     423#ifdef USE_ALMOS
     424    assert( (vci_address_width == 32) and
     425            "VCI address width with ALMOS must be 32 bits" );
     426#endif
     427
    405428
    406429    std::cout << std::endl;
     
    454477   else if (XMAX <= 4) x_width = 2;
    455478   else if (XMAX <= 8) x_width = 3;
    456    else                     x_width = 4;
     479   else                x_width = 4;
    457480
    458481   if      (YMAX == 1) y_width = 0;
     
    460483   else if (YMAX <= 4) y_width = 2;
    461484   else if (YMAX <= 8) y_width = 3;
    462    else                     y_width = 4;
     485   else                y_width = 4;
     486
     487
     488#ifdef USE_ALMOS
     489   cluster_io_id = 0xbfc00000 >> (vci_address_width - x_width - y_width); // index of cluster containing IOs
     490#else
     491   cluster_io_id = 0;
     492#endif
    463493
    464494   /////////////////////
     
    808838   }
    809839
    810    for (uint64_t n = 1; n < ncycles; n++)
     840   for (uint64_t n = 1; n < ncycles && !stop_called; n++)
    811841   {
    812842      // Monitor a specific address for L1 & L2 caches
     
    823853         }
    824854
    825          ms1 = (uint64_t)t1.tv_sec * 1000ULL + (uint64_t)t1.tv_usec / 1000;
    826          ms2 = (uint64_t)t2.tv_sec * 1000ULL + (uint64_t)t2.tv_usec / 1000;
    827          std::cerr << "platform clock frequency " << (double)5000000 / (double)(ms2 - ms1) << "Khz" << std::endl;
     855         ms1 = (uint64_t) t1.tv_sec * 1000ULL + (uint64_t) t1.tv_usec / 1000;
     856         ms2 = (uint64_t) t2.tv_sec * 1000ULL + (uint64_t) t2.tv_usec / 1000;
     857         std::cerr << "platform clock frequency " << (double) 5000000 / (double) (ms2 - ms1) << "Khz" << std::endl;
    828858
    829859         if (gettimeofday(&t1, NULL) != 0)
     
    919949      sc_start(sc_core::sc_time(1, SC_NS));
    920950   }
     951
     952   
     953   for (size_t i = 0; i  < (XMAX * YMAX); i++)
     954   {
     955      size_t x = i / YMAX;
     956      size_t y = i % YMAX;
     957      delete clusters[x][y];
     958   }
     959
    921960   return EXIT_SUCCESS;
    922961}
    923962
     963
     964void handler(int dummy = 0) {
     965   stop_called = true;
     966   sc_stop();
     967}
     968
     969
    924970int sc_main (int argc, char *argv[])
    925971{
     972   signal(SIGINT, handler);
     973
    926974   try {
    927975      return _main(argc, argv);
  • trunk/platforms/tsar_generic_xbar/top.desc

    r438 r504  
    77
    88vci_plen_size       = 8
    9 vci_addr_size       = 40
     9vci_addr_size       = 32
    1010vci_rerror_size     = 1
    1111vci_clen_size       = 1
  • trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp

    r485 r504  
    145145                     IntTab(cluster_id, tgtid_memc),     // TGTID direct space
    146146                     (cluster_id << l_width) + nb_procs, // CC_GLOBAL_ID
     147                     x_width,                            // Number of x bits in platform
     148                     y_width,                            // Number of y bits in platform
    147149                     memc_ways, memc_sets, 16,           // CACHE SIZE
    148150                     3,                                  // MAX NUMBER OF COPIES
Note: See TracChangeset for help on using the changeset viewer.