Changeset 752 for trunk/platforms


Ignore:
Timestamp:
Jul 18, 2014, 11:38:54 AM (10 years ago)
Author:
meunier
Message:
  • Added initialization to some components in order to avoid valgrind errors
  • Corrected two bugs which caused the simulations to be non-deterministic:
    • one in the memcache (possibly uninitialized paddr variable used for cache access, modifying LRU bits)
    • one in the run_simus.py script (replacing a file with an identical file in a hdd image does modify its size)
Location:
trunk/platforms
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/almos-tsar-mipsel/top.cpp

    r614 r752  
    201201/////////////////////////////////////////////////////////
    202202// There is 3 segments replicated in all clusters
    203 // and 5 specific segments in the "IO" cluster 
     203// and 5 specific segments in the "IO" cluster
    204204// (containing address 0xBF000000)
    205205/////////////////////////////////////////////////////////
    206206// Physical Address Decoding: 8 GID + 8 LID + 16 offset.
    207207/////////////////////////////////////////////////////////
    208 #define RAM_BASE        0x00000000     
     208#define RAM_BASE        0x00000000
    209209#define RAM_SIZE        0x00C00000
    210210
    211 #define BROM_BASE       0xBFC00000     
     211#define BROM_BASE       0xBFC00000
    212212#define BROM_SIZE       0x00100000
    213213
    214 #define FBUF_BASE       0xBFD00000     
     214#define FBUF_BASE       0xBFD00000
    215215#define FBUF_SIZE       0x00200000
    216216
    217 #define XICU_BASE       0x00F00000     
     217#define XICU_BASE       0x00F00000
    218218#define XICU_SIZE       0x00002000
    219219
     
    221221#define BDEV_SIZE       0x00000100
    222222
    223 #define MTTY_BASE       0xBFF20000     
     223#define MTTY_BASE       0xBFF20000
    224224#define MTTY_SIZE       0x00000100
    225225
     
    227227#define MDMA_SIZE       0x00001000 * NB_DMA_CHANNELS  // 4 Kbytes per channel
    228228
    229 #define MEMC_BASE       0x00F40000     
     229#define MEMC_BASE       0x00F40000
    230230#define MEMC_SIZE       0x00001000
    231231
     
    233233#define SIMH_SIZE       0x00001000
    234234
    235 #define CDMA_BASE       0xBFF60000     
     235#define CDMA_BASE       0xBFF60000
    236236#define CDMA_SIZE       0x00000100
    237237
     
    255255   bool     debug_ok         = false;              // trace activated
    256256   size_t   debug_period     = 1;                  // trace period
    257    size_t   debug_memc_id    = 0;                  // index of memc to be traced 
     257   size_t   debug_memc_id    = 0;                  // index of memc to be traced
    258258   size_t   debug_proc_id    = 0;                  // index of proc to be traced
    259259   uint32_t debug_from       = 0;                  // trace start cycle
     
    596596   {
    597597      for (size_t y = 0; y < ymax ; y++)
    598       { 
     598      {
    599599
    600600         sc_uint<vci_address_width> offset;
     
    781781      }
    782782   }
    783    std::cout << std::endl << "Horizontal connections established" << std::endl;   
     783   std::cout << std::endl << "Horizontal connections established" << std::endl;
    784784
    785785   // Inter Clusters vertical connections
  • trunk/platforms/tsar_generic_xbar/scripts/run_simus.py

    r749 r752  
    44import os
    55import sys
     6import shutil
    67
    78#TODO: recopier les fichiers d'entrees dans le script en fonction de l'appli selectionnee
     
    1415
    1516nb_procs = [ 4 ]
    16 #nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
     17#nb_procs = [ 16, 32, 64, 128, 256 ]
    1718rerun_stats = True
    1819use_omp = False
     
    2526# to come: 'barnes', 'fmm', 'ocean', 'raytrace', 'radiosity', 'waters', 'watern'
    2627
    27 apps = [ 'histogram', 'pca' ]
     28apps = [ 'cholesky' ]
    2829
    2930
     
    155156      os.symlink(target, link_name)
    156157
    157    target = hdd_img_name
    158    link_name = 'hdd-img.bin'
    159    if not os.path.isfile(link_name):
    160       print "ln -s", target, link_name
    161       os.symlink(target, link_name)
     158   copied_hdd = 'hdd-img.bin'
     159   print "cp", hdd_img_name, copied_hdd
     160   shutil.copy(hdd_img_name, copied_hdd)
    162161
    163162   os.chdir(old_path)
     
    255254      shrc = "exec -p 0 /bin/lu -n%(nproc)d -m512\n" % dict(nproc = nprocs)
    256255   elif (app_name == "radix"):
    257       shrc = "exec -p 0 /bin/radix -n%(nproc)d -k2097152\n" % dict(nproc = nprocs) # test : 1024 ; simu : 2097152
     256      shrc = "exec -p 0 /bin/radix -n%(nproc)d -k1024\n" % dict(nproc = nprocs) # test : 1024 ; simu : 2097152
    258257   elif (app_name == "radix_ga"):
    259258      shrc = "exec -p 0 /bin/radix_ga -n%(nproc)d -k2097152\n" % dict(nproc = nprocs) # p = proc, n = num_keys
  • trunk/platforms/tsar_generic_xbar/top.cpp

    r749 r752  
    632632   {
    633633      for (size_t y = 0; y < Y_SIZE ; y++)
    634       { 
     634      {
    635635
    636636         sc_uint<vci_address_width> offset;
     
    676676   // Mesh boundaries DSPIN signals
    677677   DspinSignals<dspin_cmd_width>**** signal_dspin_false_cmd_in =
    678       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_in" , X_SIZE, Y_SIZE, 4, 3);
     678         alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_in" , X_SIZE, Y_SIZE, 4, 3);
    679679   DspinSignals<dspin_cmd_width>**** signal_dspin_false_cmd_out =
    680       alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_out", X_SIZE, Y_SIZE, 4, 3);
     680         alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_out", X_SIZE, Y_SIZE, 4, 3);
    681681   DspinSignals<dspin_rsp_width>**** signal_dspin_false_rsp_in =
    682       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_in" , X_SIZE, Y_SIZE, 4, 2);
     682         alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_in" , X_SIZE, Y_SIZE, 4, 2);
    683683   DspinSignals<dspin_rsp_width>**** signal_dspin_false_rsp_out =
    684       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_out", X_SIZE, Y_SIZE, 4, 2);
    685 
     684         alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_out", X_SIZE, Y_SIZE, 4, 2);
    686685
    687686   ////////////////////////////
     
    730729                sc.str().c_str(),
    731730                NB_PROCS_MAX,
    732                 NB_TTY_CHANNELS, 
    733                 NB_DMA_CHANNELS, 
     731                NB_TTY_CHANNELS,
     732                NB_DMA_CHANNELS,
    734733                x,
    735734                y,
     
    772771                debug_from,
    773772                debug_ok and (cluster(x,y) == debug_memc_id),
    774                 debug_ok and (cluster(x,y) == debug_proc_id) 
     773                debug_ok and (cluster(x,y) == debug_proc_id)
    775774            );
    776775
     
    815814      }
    816815   }
    817    std::cout << std::endl << "Horizontal connections established" << std::endl;   
     816   std::cout << std::endl << "Horizontal connections established" << std::endl;
    818817
    819818   // Inter Clusters vertical connections
     
    844843      for (size_t k = 0; k < 3; k++)
    845844      {
    846          clusters[0][y]->p_cmd_in[WEST][k]        (signal_dspin_false_cmd_in[0][y][WEST][k]);
     845         clusters[0][y]->p_cmd_in[WEST][k]        (signal_dspin_false_cmd_in [0][y][WEST][k]);
    847846         clusters[0][y]->p_cmd_out[WEST][k]       (signal_dspin_false_cmd_out[0][y][WEST][k]);
    848          clusters[X_SIZE-1][y]->p_cmd_in[EAST][k]   (signal_dspin_false_cmd_in[X_SIZE-1][y][EAST][k]);
    849          clusters[X_SIZE-1][y]->p_cmd_out[EAST][k]  (signal_dspin_false_cmd_out[X_SIZE-1][y][EAST][k]);
     847         clusters[X_SIZE-1][y]->p_cmd_in[EAST][k] (signal_dspin_false_cmd_in [X_SIZE-1][y][EAST][k]);
     848         clusters[X_SIZE-1][y]->p_cmd_out[EAST][k](signal_dspin_false_cmd_out[X_SIZE-1][y][EAST][k]);
    850849      }
    851850
    852851      for (size_t k = 0; k < 2; k++)
    853852      {
    854          clusters[0][y]->p_rsp_in[WEST][k]        (signal_dspin_false_rsp_in[0][y][WEST][k]);
     853         clusters[0][y]->p_rsp_in[WEST][k]        (signal_dspin_false_rsp_in [0][y][WEST][k]);
    855854         clusters[0][y]->p_rsp_out[WEST][k]       (signal_dspin_false_rsp_out[0][y][WEST][k]);
    856          clusters[X_SIZE-1][y]->p_rsp_in[EAST][k]   (signal_dspin_false_rsp_in[X_SIZE-1][y][EAST][k]);
    857          clusters[X_SIZE-1][y]->p_rsp_out[EAST][k]  (signal_dspin_false_rsp_out[X_SIZE-1][y][EAST][k]);
     855         clusters[X_SIZE-1][y]->p_rsp_in[EAST][k] (signal_dspin_false_rsp_in [X_SIZE-1][y][EAST][k]);
     856         clusters[X_SIZE-1][y]->p_rsp_out[EAST][k](signal_dspin_false_rsp_out[X_SIZE-1][y][EAST][k]);
    858857      }
    859858   }
     
    864863      for (size_t k = 0; k < 3; k++)
    865864      {
    866          clusters[x][0]->p_cmd_in[SOUTH][k]       (signal_dspin_false_cmd_in[x][0][SOUTH][k]);
    867          clusters[x][0]->p_cmd_out[SOUTH][k]      (signal_dspin_false_cmd_out[x][0][SOUTH][k]);
    868          clusters[x][Y_SIZE-1]->p_cmd_in[NORTH][k]  (signal_dspin_false_cmd_in[x][Y_SIZE-1][NORTH][k]);
    869          clusters[x][Y_SIZE-1]->p_cmd_out[NORTH][k] (signal_dspin_false_cmd_out[x][Y_SIZE-1][NORTH][k]);
     865         clusters[x][0]->p_cmd_in[SOUTH][k]        (signal_dspin_false_cmd_in [x][0][SOUTH][k]);
     866         clusters[x][0]->p_cmd_out[SOUTH][k]       (signal_dspin_false_cmd_out[x][0][SOUTH][k]);
     867         clusters[x][Y_SIZE-1]->p_cmd_in[NORTH][k] (signal_dspin_false_cmd_in [x][Y_SIZE-1][NORTH][k]);
     868         clusters[x][Y_SIZE-1]->p_cmd_out[NORTH][k](signal_dspin_false_cmd_out[x][Y_SIZE-1][NORTH][k]);
    870869      }
    871870
    872871      for (size_t k = 0; k < 2; k++)
    873872      {
    874          clusters[x][0]->p_rsp_in[SOUTH][k]       (signal_dspin_false_rsp_in[x][0][SOUTH][k]);
    875          clusters[x][0]->p_rsp_out[SOUTH][k]      (signal_dspin_false_rsp_out[x][0][SOUTH][k]);
    876          clusters[x][Y_SIZE-1]->p_rsp_in[NORTH][k]  (signal_dspin_false_rsp_in[x][Y_SIZE-1][NORTH][k]);
    877          clusters[x][Y_SIZE-1]->p_rsp_out[NORTH][k] (signal_dspin_false_rsp_out[x][Y_SIZE-1][NORTH][k]);
     873         clusters[x][0]->p_rsp_in[SOUTH][k]        (signal_dspin_false_rsp_in [x][0][SOUTH][k]);
     874         clusters[x][0]->p_rsp_out[SOUTH][k]       (signal_dspin_false_rsp_out[x][0][SOUTH][k]);
     875         clusters[x][Y_SIZE-1]->p_rsp_in[NORTH][k] (signal_dspin_false_rsp_in [x][Y_SIZE-1][NORTH][k]);
     876         clusters[x][Y_SIZE-1]->p_rsp_out[NORTH][k](signal_dspin_false_rsp_out[x][Y_SIZE-1][NORTH][k]);
    878877      }
    879878   }
     
    899898               signal_dspin_false_cmd_out[x][y][a][k].read  = true;
    900899            }
    901 
    902900            for (size_t k = 0; k < 2; k++){
    903901               signal_dspin_false_rsp_in [x][y][a][k].write = false;
     
    913911   signal_resetn = true;
    914912
     913#define SC_TRACE
     914#ifdef SC_TRACE
     915   sc_trace_file * tf = sc_create_vcd_trace_file("my_trace_file");
     916
     917   if (X_SIZE > 1){
     918      for (size_t x = 0; x < (X_SIZE-1); x++){
     919         for (size_t y = 0; y < Y_SIZE; y++){
     920            for (size_t k = 0; k < 3; k++){
     921               signal_dspin_h_cmd_inc[x][y][k].trace(tf, "dspin_h_cmd_inc");
     922               signal_dspin_h_cmd_dec[x][y][k].trace(tf, "dspin_h_cmd_dec");
     923            }
     924
     925            for (size_t k = 0; k < 2; k++){
     926               signal_dspin_h_rsp_inc[x][y][k].trace(tf, "dspin_h_rsp_inc");
     927               signal_dspin_h_rsp_dec[x][y][k].trace(tf, "dspin_h_rsp_dec");
     928            }
     929         }
     930      }
     931   }
     932
     933   if (Y_SIZE > 1) {
     934      for (size_t y = 0; y < (Y_SIZE-1); y++){
     935         for (size_t x = 0; x < X_SIZE; x++){
     936            for (size_t k = 0; k < 3; k++){
     937               signal_dspin_v_cmd_inc[x][y][k].trace(tf, "dspin_v_cmd_inc");
     938               signal_dspin_v_cmd_dec[x][y][k].trace(tf, "dspin_v_cmd_dec");
     939            }
     940
     941            for (size_t k = 0; k < 2; k++){
     942               signal_dspin_v_rsp_inc[x][y][k].trace(tf, "dspin_v_rsp_inc");
     943               signal_dspin_v_rsp_dec[x][y][k].trace(tf, "dspin_v_rsp_dec");
     944            }
     945         }
     946      }
     947   }
     948
     949   for (size_t x = 0; x < (X_SIZE); x++){
     950      for (size_t y = 0; y < Y_SIZE; y++){
     951         std::ostringstream signame;
     952         signame << "cluster" << x << "_" << y;
     953         clusters[x][y]->trace(tf, signame.str());
     954      }
     955   }
     956#endif
     957
    915958   if (debug_ok) {
    916959      #if USE_OPENMP
     
    932975         {
    933976
    934             if (gettimeofday(&t2, NULL) != 0) 
     977            if (gettimeofday(&t2, NULL) != 0)
    935978            {
    936979               perror("gettimeofday");
     
    942985            std::cerr << "platform clock frequency " << (double) 5000000 / (double) (ms2 - ms1) << "Khz" << std::endl;
    943986
    944             if (gettimeofday(&t1, NULL) != 0) 
     987            if (gettimeofday(&t1, NULL) != 0)
    945988            {
    946989               perror("gettimeofday");
     
    9661009         }
    9671010
    968          if (debug_ok and (n > debug_from) and (n % debug_period == 0))
     1011         if ((n > debug_from) and (n % debug_period == 0))
    9691012         {
    9701013            std::cout << "****************** cycle " << std::dec << n ;
    9711014            std::cout << " ************************************************" << std::endl;
    9721015
    973             // trace proc[debug_proc_id] 
     1016            // trace proc[debug_proc_id]
    9741017            size_t l = debug_proc_id % NB_PROCS_MAX ;
    9751018            size_t y = (debug_proc_id / NB_PROCS_MAX) % Y_SIZE ;
     
    9921035            //clusters[x][y]->signal_dspin_rsp_g2l_d.print_trace("[SIG]G2L RSP");
    9931036
    994             // trace memc[debug_memc_id] 
     1037            // trace memc[debug_memc_id]
    9951038            x = debug_memc_id / Y_SIZE;
    9961039            y = debug_memc_id % Y_SIZE;
  • trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/include/tsar_xbar_cluster.h

    r706 r752  
    211211
    212212    ~TsarXbarCluster();
     213    void trace(sc_trace_file * tf, const std::string & name);
    213214
    214215};
  • trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp

    r706 r752  
    669669
    670670
     671template<size_t dspin_cmd_width,
     672         size_t dspin_rsp_width,
     673         typename vci_param_int,
     674         typename vci_param_ext>
     675void TsarXbarCluster<dspin_cmd_width,
     676                     dspin_rsp_width,
     677                     vci_param_int,
     678                     vci_param_ext>::trace(sc_core::sc_trace_file * tf, const std::string & name) {
     679
     680#define __trace(x) sc_core::sc_trace(tf, x, name + "_" + #x)
     681    __trace(signal_vci_l2g_d);
     682    __trace(signal_vci_g2l_d);
     683    __trace(signal_vci_tgt_memc);
     684    __trace(signal_vci_tgt_xicu);
     685    __trace(signal_vci_tgt_mdma);
     686    __trace(signal_vci_ini_mdma);
     687
     688    for (size_t p = 0; p < n_procs; p++) {
     689        std::ostringstream signame;
     690        signame << "vci_ini_proc_" << p;
     691        sc_core::sc_trace(tf, signal_vci_ini_proc[p], signame.str());
     692    }
     693    __trace(signal_vci_tgt_mtty);
     694    __trace(signal_vci_tgt_brom);
     695    __trace(signal_vci_tgt_bdev);
     696    __trace(signal_vci_tgt_fbuf);
     697    __trace(signal_vci_tgt_simh);
     698    __trace(signal_vci_ini_bdev);
     699    __trace(signal_vci_tgt_memc);
     700    __trace(signal_vci_xram);
     701#undef trace
     702
     703}                       
     704                                   
     705
     706
     707
    671708}}
    672709
     
    680717// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
    681718
    682 
    683 
Note: See TracChangeset for help on using the changeset viewer.