Changeset 180
- Timestamp:
- Oct 18, 2011, 10:11:36 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp
r146 r180 150 150 ////////////////////////////////// 151 151 { 152 double latency = (double)r_latency_bc.read(); 153 double nb = (double)r_nb_bc.read(); 154 std::cout << "Latency BC : " <<std::dec << latency << " nb_bc : " << nb << std::endl; 152 155 if(m_bc_period) 153 return ( (double)r_latency_bc.read()/(double)r_nb_bc.read());156 return (latency/nb); 154 157 else 155 158 return 0; … … 176 179 << " Number of packets sent : " << std::dec << r_nb_single.read() << " " << r_cmd_trdid.read() 177 180 << " Number of BC sent : " << r_nb_bc.read() 178 << " Cycles to the next BC : " << r_time_to_next_bc.read() << std::endl; 181 << " Cycles to the next BC : " << r_time_to_next_bc.read() 182 << " FIFO status : " << r_date_fifo.filled_status() << std::endl; 179 183 for(int i = 0; i < (1<<vci_param::T) ; i++){ 180 184 std::cout << "ID : " << i << " " << (uint64_t)(r_pending_date[i].read()) << std::endl; … … 207 211 // Initializing seed for random numbers generation 208 212 209 #ifndef DETERMINISTIC210 srand(time(NULL));211 #endif213 //#ifndef DETERMINISTIC 214 // srand(time(NULL)); 215 //#endif 212 216 213 217 // Initializing FSMs … … 228 232 229 233 r_cmd_seed = (uint32_t)m_srcid; 230 231 #ifndef RANDOM_PERIOD 232 r_time_to_next_bc = m_bc_period; 233 #endif 234 235 //std::cout << name() << " " << std::dec << m_bc_period << std::endl; 236 237 if (m_bc_period){ 238 uint32_t a = (uint32_t)(rand()%(2*m_bc_period)); 239 //std::cout << name() << " " << std::dec << a << std::endl; 240 r_time_to_next_bc = a; 241 } else { 242 //std::cout << "c'est 0 " << std::endl; 243 r_time_to_next_bc = 0; 244 } 234 245 235 246 return; … … 257 268 if ( r_pending_fsm[0].read() == false ) // no current broadcast 258 269 { 270 //std::cout << name() << "SENDING BC" << std::endl; 259 271 r_cmd_fsm = VCI_BC_SEND ; 260 272 r_cmd_address = 0x3 | (0x7c1f << vci_param::N-20) ; … … 311 323 if (p_vci.cmdack.read()) 312 324 { 325 //std::cout << std::dec << r_cpt_cycles.read() << "ns " << name() << " BC SEND " << r_nb_bc.read() << " " << r_time_to_next_bc.read() << std::endl; 313 326 r_bc_nrsp = (m_xmax - m_xmin) * (m_ymax - m_ymin) ; 314 327 r_pending_fsm[0] = true; … … 336 349 r_pending_fsm[0] = false; 337 350 r_latency_bc = r_latency_bc.read() + (r_cpt_cycles.read() - r_pending_date[0].read()); 351 //std::cout << std::dec << r_cpt_cycles.read() << "ns " << name() << " BC done " << std::endl; 338 352 } 339 353 } … … 358 372 { 359 373 r_nb_bc = r_nb_bc.read() + 1; 360 r_cpt_period = 0; 374 // r_cpt_period = 0; 375 //#ifdef RANDOM_PERIOD 376 // r_time_to_next_bc = (uint32_t)(rand()%(2*m_bc_period)); 377 //#endif 361 378 } 362 379 }
Note: See TracChangeset
for help on using the changeset viewer.