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)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.