Ignore:
Timestamp:
Dec 23, 2010, 3:31:25 PM (13 years ago)
Author:
choichil
Message:

Synthetic Initiator before being change for multiple requests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp

    r115 r122  
    3232
    3333
    34 //#define DETERMINISM
     34#define DETERMINISTIC
    3535
    3636namespace soclib { namespace caba {
     
    140140  //////////////////////////////////
    141141  {
    142         std::cout << m_cpt_cycles << " cycles, " << m_npackets << " packets sent" << std::endl;
     142        std::cout << name() << " : "<< std::dec << m_cpt_cycles << " cycles, " << m_npackets << " packets sent" << std::endl;
     143        std::cout << ((double)m_latency1/(double)m_npackets) << " | " << ((double)m_latency2/(double)m_npackets) << std::endl;
     144        if(m_bc_period)
     145          std::cout << ((double)m_latency_bc/(double)m_nb_bc) << std::endl;
    143146  }
    144147
     
    150153    if ( ! p_resetn.read() ) {
    151154      // Initializing seed for random numbers generation
    152 #ifndef DETERMINISM
     155#ifndef DETERMINISTIC
    153156      srand(time(NULL));
    154157#endif
     
    160163      m_date_fifo.init();
    161164
     165      // Initializing the stats
     166      m_latency1 = 0 ;
     167      m_latency2 = 0 ;
    162168      // Activity counters
    163169      m_cpt_cycles              = 0;
    164170      m_npackets                = 0;
     171     
     172      m_start_latency_bc        = 0;
     173      m_latency_bc              = 0;
     174      m_nb_bc                   = 0;
    165175
    166176      r_broadcast_req           = false;
     
    172182    bool    date_fifo_get = false;
    173183
    174 //   if (m_cpt_cycles == 0) {
    175 //           m_rhos = 0.0 ;
    176 //   } else {
    177 //           m_rhos = static_cast<float>(m_npackets * m_length) / static_cast<float>(m_cpt_cycles) ;
    178 //   }
    179    
    180184
    181185
     
    193197            } else {
    194198              r_vci_fsm = VCI_SINGLE_SEND ;
    195 #ifdef DETERMINISM
     199#ifdef DETERMINISTIC
    196200              m_address_to_send = destAdress(&m_local_seed) << (vci_param::N)-(soclib::common::uint32_log2((uint32_t)m_xmesh)+soclib::common::uint32_log2((uint32_t)m_ymesh));
    197201#else
     
    222226        {
    223227          if (p_vci.rspval.read()) {
    224             m_start_latency1 = m_date_fifo.read();
    225             m_start_latency2 = m_cpt_cycles;
     228            m_latency1 = m_latency1 + (m_cpt_cycles - m_start_latency1);
     229            m_latency2 = m_latency2 + (m_cpt_cycles - m_start_latency2);
    226230            m_npackets++;
    227231            date_fifo_get = true;
     
    236240          if (p_vci.cmdack.read()) {
    237241            m_bc_nrsp = (m_xmax - m_xmin) * (m_ymax - m_ymin) ;
     242            m_start_latency_bc = m_cpt_cycles;
    238243            r_vci_fsm = VCI_BC_RECEIVE;
    239244            break;
     
    247252              r_broadcast_req = false;
    248253              m_address_to_send = 0;
     254              date_fifo_get = true;
     255              m_latency_bc = m_latency_bc + (m_cpt_cycles - m_start_latency_bc);
     256              m_nb_bc++;
    249257              r_vci_fsm = VCI_IDLE ;
    250258            } else {
     
    259267
    260268    /////////////////// Filling fifo
    261     if( ( (uint64_t)(m_rho*m_cpt_cycles) >= (uint64_t)(m_length*m_npackets*1000)) ){
     269    if( ( (uint64_t)(m_rho*m_cpt_cycles) > (uint64_t)(m_length*m_npackets*1000)) ){
    262270      if (m_date_fifo.wok()){
    263271        date_fifo_put = true ;
Note: See TracChangeset for help on using the changeset viewer.