Changeset 135


Ignore:
Timestamp:
Jan 28, 2011, 2:16:55 PM (13 years ago)
Author:
choichil
Message:

Initiator with bug correction in latency computing

Location:
trunk/modules/vci_synthetic_initator/caba/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_synthetic_initator/caba/sources/include/vci_synthetic_initiator.h

    r132 r135  
    133133      const size_t                m_ymax;
    134134      const size_t                m_srcid;
    135       static const int            m_tab_size = 1 << vci_param::T;
     135      static const size_t         m_tab_size = 1 << vci_param::T;
    136136
    137137
  • trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp

    r132 r135  
    3434
    3535
    36 #define DETERMINISTIC
     36//#define DETERMINISTIC
    3737
    3838namespace soclib { namespace caba {
     
    6868    p_resetn("resetn"),
    6969    p_vci("vci_ini"),
    70 
     70    //  FIFOs
    7171    m_srcid( mt.indexForId(vci_index) ),
    72     //  FIFOs
    7372    m_length(length),
    7473    m_rho(rho),
     
    163162  {
    164163        std::cout << name() << " : "<< std::dec << r_cpt_cycles.read() << " cycles, " << r_nb_single.read() << " packets sent" << std::endl;
     164        if (m_rho)
     165        {
     166          std::cout << "Average latency : " << (double)(r_latency_single.read())/(double)(r_nb_single.read()) << std::endl;
     167        }
    165168        if(m_bc_period)
    166169        {
    167170          std::cout << "Number of broadcast sent and received : " << r_nb_bc.read() << std::endl;
    168           std::cout << ((double)r_latency_bc.read()/(double)r_nb_bc.read()) << std::endl;
     171          std::cout << "Average latency : " << ((double)r_latency_bc.read()/(double)r_nb_bc.read()) << std::endl;
    169172        }
    170173  }
     
    192195
    193196      // Initializing the instrumentation registers
    194       r_latency_single          = 0 ;
     197      r_latency_single          = 0;
    195198      r_nb_single               = 0;
    196       r_latency_bc              = 0 ;
     199      r_latency_bc              = 0;
    197200      r_nb_bc                   = 0;
    198201      r_cpt_cycles              = 0;
    199202      r_cpt_period              = 0;
    200203     
    201       r_cmd_seed        = (uint32_t)m_srcid;
     204      r_cmd_seed                = (uint32_t)m_srcid;
    202205
    203206      return;
     
    206209    bool    fifo_put = false;
    207210    bool    fifo_get = false;
    208     bool    fifo_bc;
    209 
     211    bool    fifo_bc  = false;
     212
     213
     214#ifdef DETERMINISTIC
    210215    uint32_t m_local_seed ;
     216#endif
    211217
    212218    //////////////////
     
    229235            {
    230236              int id = -1;
    231               for(int i = 1; i < m_tab_size; i++){      // ID 0 reserved for broadcast transactions
     237              for(size_t i = 1; i < m_tab_size; i++){   // ID 0 reserved for broadcast transactions
    232238                if(r_pending_fsm[i].read() == false)
    233239                {
    234                   id = i;
     240                  id = (int)i;
    235241                  break;
    236242                }
     
    259265            if (r_cmd_count.read() == m_length-1)
    260266            {
    261               r_nb_single = r_nb_single.read() + 1;
     267              //r_nb_single = r_nb_single.read() + 1;
    262268              r_cmd_fsm = VCI_SINGLE_REGISTER ;
    263269            }
Note: See TracChangeset for help on using the changeset viewer.