Changeset 146 for trunk/modules/vci_synthetic_initator
- Timestamp:
- Apr 9, 2011, 5:48:37 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
r145 r146 152 152 153 153 // Broadcast FSM 154 sc_signal<uint32_t> r_bc_nrsp; // Expected number of responses for a broadcast command 154 sc_signal<uint32_t> r_bc_nrsp; // Expected number of responses for a broadcast command 155 sc_signal<uint32_t> r_time_to_next_bc; // Time to wait between 2 BC 155 156 156 157 // Pending transaction FSMs -
trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp
r145 r146 94 94 r_latency_single("r_latency_single"), 95 95 r_nb_bc("r_nb_bc"), 96 r_latency_bc("r_latency_bc") 96 r_latency_bc("r_latency_bc"), 97 r_time_to_next_bc("r_time_to_next_bc") 97 98 { 98 99 … … 172 173 << " : state_rsp_fsm = " << state_bc_rsp_str[r_pending_fsm[0].read()] 173 174 << " Adresse to send : " << std::hex << r_cmd_address.read() 174 << " Number of broadcastto receive : " << std::dec << r_bc_nrsp.read()175 << " Number of BC_RSP to receive : " << std::dec << r_bc_nrsp.read() 175 176 << " 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; 177 << " Number of BC sent : " << r_nb_bc.read() 178 << " Cycles to the next BC : " << r_time_to_next_bc.read() << std::endl; 177 179 for(int i = 0; i < (1<<vci_param::T) ; i++){ 178 180 std::cout << "ID : " << i << " " << (uint64_t)(r_pending_date[i].read()) << std::endl; … … 226 228 227 229 r_cmd_seed = (uint32_t)m_srcid; 230 231 #ifndef RANDOM_PERIOD 232 r_time_to_next_bc = m_bc_period; 233 #endif 228 234 229 235 return; … … 345 351 // traffic regulator 346 352 //////////////////////// 347 #ifdef RANDOM_PERIOD 348 if ( m_bc_period && (r_cpt_period.read() == 0) ) 349 #else 350 if ( m_bc_period && (r_cpt_period.read() > m_bc_period) ) 351 #endif 353 if ( m_bc_period && (r_cpt_period.read() > r_time_to_next_bc.read()) ) 352 354 { 353 355 fifo_put = true ; … … 356 358 { 357 359 r_nb_bc = r_nb_bc.read() + 1; 358 #ifdef RANDOM_PERIOD359 r_cpt_period = (uint64_t) (rand()%(2*m_bc_period));360 #else361 360 r_cpt_period = 0; 362 #endif363 361 } 364 362 } … … 370 368 } 371 369 370 if ( m_bc_period && (r_cpt_period.read() > r_time_to_next_bc.read()) && r_date_fifo.wok() ) 371 { 372 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 378 if ( m_bc_period && (r_cpt_period.read() > m_bc_period) && r_date_fifo.wok() ) 373 r_time_to_next_bc = (uint32_t)(rand()%(2*m_bc_period)); 374 #endif 379 375 r_cpt_period = 0; 376 } 380 377 else 381 378 r_cpt_period = r_cpt_period.read() + 1; 382 #endif383 379 384 380 ////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.