Changeset 145 for trunk/modules/vci_synthetic_initator/caba/sources/src
- Timestamp:
- Apr 1, 2011, 12:20:28 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp
r135 r145 35 35 36 36 //#define DETERMINISTIC 37 #define RANDOM_PERIOD 37 38 38 39 namespace soclib { namespace caba { … … 133 134 } 134 135 135 136 ////////////////////////////////// 137 tmpl(double)::getLatencySingle() 138 ////////////////////////////////// 139 { 140 if (m_rho) 141 return (double)(r_latency_single.read())/(double)(r_nb_single.read()); 142 else 143 return 0; 144 145 } 146 147 ////////////////////////////////// 148 tmpl(double)::getLatencyBC() 149 ////////////////////////////////// 150 { 151 if(m_bc_period) 152 return ((double)r_latency_bc.read()/(double)r_nb_bc.read()); 153 else 154 return 0; 155 156 } 157 136 158 ////////////////////////////////// 137 159 tmpl(void)::print_trace() … … 151 173 << " Adresse to send : " << std::hex << r_cmd_address.read() 152 174 << " Number of broadcast to receive : " << std::dec << r_bc_nrsp.read() 153 << " Number of packets sent : " << std::dec << r_nb_single.read() << " " << r_cmd_trdid.read() << std::endl; 175 << " Number of packets sent : " << std::dec << r_nb_single.read() << " " << r_cmd_trdid.read() 176 << " Cycles to the next BC : " << r_cpt_period.read() << std::endl; 154 177 for(int i = 0; i < (1<<vci_param::T) ; i++){ 155 178 std::cout << "ID : " << i << " " << (uint64_t)(r_pending_date[i].read()) << std::endl; … … 322 345 // traffic regulator 323 346 //////////////////////// 347 #ifdef RANDOM_PERIOD 348 if ( m_bc_period && (r_cpt_period.read() == 0) ) 349 #else 324 350 if ( m_bc_period && (r_cpt_period.read() > m_bc_period) ) 351 #endif 325 352 { 326 353 fifo_put = true ; … … 329 356 { 330 357 r_nb_bc = r_nb_bc.read() + 1; 358 #ifdef RANDOM_PERIOD 359 r_cpt_period = (uint64_t) (rand()%(2*m_bc_period)); 360 #else 331 361 r_cpt_period = 0; 362 #endif 332 363 } 333 364 } … … 339 370 } 340 371 372 #ifdef RANDOM_PERIOD 373 if ( m_bc_period && (r_cpt_period.read() == 0) && r_date_fifo.wok() ) 374 r_cpt_period = (uint64_t) (rand()%(2*m_bc_period)); 375 else 376 r_cpt_period = r_cpt_period.read() - 1; 377 #else 341 378 if ( m_bc_period && (r_cpt_period.read() > m_bc_period) && r_date_fifo.wok() ) 342 379 r_cpt_period = 0; 343 380 else 344 381 r_cpt_period = r_cpt_period.read() + 1; 382 #endif 345 383 346 384 ////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.