Changeset 122 for trunk/modules/vci_synthetic_initator
- Timestamp:
- Dec 23, 2010, 3:31:25 PM (14 years ago)
- 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
r115 r122 26 26 * 27 27 * Maintainers: christophe.choichillon@lip6.fr 28 */ 29 /* 30 TODO : Adding the broadcast latency 28 31 */ 29 32 … … 64 67 VCI_BC_RECEIVE 65 68 }; 66 enum gen_fsm_state_e{67 68 69 };69 // enum gen_fsm_state_e{ 70 // A_IDLE, 71 // A_DATA 72 // }; 70 73 71 uint 32_t m_cpt_cycles; // Counter of cycles74 uint64_t m_cpt_cycles; // Counter of cycles 72 75 73 76 … … 132 135 uint64_t m_start_latency1; // Start time of sending packet wanted 133 136 uint64_t m_start_latency2; // Start time of sending packet 134 // float m_rhos; // Effective Rho during the simulation 137 uint64_t m_latency1; // Average latency wanted 138 uint64_t m_latency2; // Average latency 135 139 size_t m_bc_nrsp; // Expected number of responses for a broadcast command 136 140 addr_t m_address_to_send; // Address to send the write command 137 141 uint32_t m_local_seed; 138 142 143 uint64_t m_start_latency_bc; 144 uint64_t m_latency_bc; 145 uint64_t m_nb_bc; 146 139 147 // Fifo transmitting date to the VCI FSM 140 148 GenericFifo<uint32_t> m_date_fifo; 141 149 150 //sc_signal<int> r_cmd_fsm; 142 151 sc_signal<int> r_vci_fsm; 152 153 sc_signal<int> r_bc_rsp_fsm; 143 154 144 155 sc_signal<size_t> r_index; -
trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp
r115 r122 32 32 33 33 34 //#define DETERMINISM 34 #define DETERMINISTIC 35 35 36 36 namespace soclib { namespace caba { … … 140 140 ////////////////////////////////// 141 141 { 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; 143 146 } 144 147 … … 150 153 if ( ! p_resetn.read() ) { 151 154 // Initializing seed for random numbers generation 152 #ifndef DETERMINIS M155 #ifndef DETERMINISTIC 153 156 srand(time(NULL)); 154 157 #endif … … 160 163 m_date_fifo.init(); 161 164 165 // Initializing the stats 166 m_latency1 = 0 ; 167 m_latency2 = 0 ; 162 168 // Activity counters 163 169 m_cpt_cycles = 0; 164 170 m_npackets = 0; 171 172 m_start_latency_bc = 0; 173 m_latency_bc = 0; 174 m_nb_bc = 0; 165 175 166 176 r_broadcast_req = false; … … 172 182 bool date_fifo_get = false; 173 183 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 180 184 181 185 … … 193 197 } else { 194 198 r_vci_fsm = VCI_SINGLE_SEND ; 195 #ifdef DETERMINIS M199 #ifdef DETERMINISTIC 196 200 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)); 197 201 #else … … 222 226 { 223 227 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); 226 230 m_npackets++; 227 231 date_fifo_get = true; … … 236 240 if (p_vci.cmdack.read()) { 237 241 m_bc_nrsp = (m_xmax - m_xmin) * (m_ymax - m_ymin) ; 242 m_start_latency_bc = m_cpt_cycles; 238 243 r_vci_fsm = VCI_BC_RECEIVE; 239 244 break; … … 247 252 r_broadcast_req = false; 248 253 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++; 249 257 r_vci_fsm = VCI_IDLE ; 250 258 } else { … … 259 267 260 268 /////////////////// 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)) ){ 262 270 if (m_date_fifo.wok()){ 263 271 date_fifo_put = true ;
Note: See TracChangeset
for help on using the changeset viewer.