12 #ifndef TB_INTERMEDIATE_OUT_TESTBENCH_FILE_H
13 #define TB_INTERMEDIATE_OUT_TESTBENCH_FILE_H
26 int nb_transactions_received = 0;
28 int last_transaction_count[Ni];
29 for(
int i = 0; i < Ni; i++) last_transaction_count[i] = 0;
31 while(nb_transactions_received != NB_TRANSACTIONS_TO_SEND * Ni) {
34 sc_time timeout(Reconfiguration_manager::getMaximumSimulationTime() - sc_time_stamp() - sc_time(1, SC_US));
44 if(sc_time_stamp() == Reconfiguration_manager::getMaximumSimulationTime() - sc_time(1, SC_US)) {
46 cout <<
"CRITICAL WARNING: End of simulation reached but testbench thread is still waiting for transactions..." << endl;
47 cout <<
"Testbench name: " << tb_interface.
TB_IF_name();
48 cout <<
"Consider revising:" << endl;
49 cout <<
" - Testbench to wait for less transactions" << endl;
50 cout <<
" - Module algorithms to send data more often" << endl;
55 for(
int i = 0; i < Ni; i++) {
60 for(
int j = 0; j < 16; j++) {
61 if(data_ptr[j] != ((last_transaction_count[i] << 16) | j)) {
63 cout <<
"Socket " << i <<
", Transaction " << last_transaction_count[i] <<
", Data " << j <<
" -> " << hex << data_ptr[j] <<
" (expected " << ((last_transaction_count[i] << 16) | j) <<
")" << endl;
68 last_transaction_count[i]++;
74 nb_transactions_received++;
81 Simulation_controller::get_logfile() << endl <<
"==================================================" << endl;
82 Simulation_controller::get_logfile() <<
" CONGRATULATIONS: Simulation ended successfully " << endl;
83 Simulation_controller::get_logfile() <<
"==================================================" << endl << endl;
88 Simulation_controller::get_logfile() << endl <<
"==================================================" << endl;
89 Simulation_controller::get_logfile() <<
" Simulation failed with " << dec << nb_diff <<
" errors " << endl;
90 Simulation_controller::get_logfile() <<
"==================================================" << endl << endl;
92 exit(RECOSIM_TESTBENCH_CHECK_FAILED);
virtual const sc_event & TB_IF_transaction_received_event(void) const =0
Get the event launched when a transaction has been received.
Definition: testbench_in_interface.h:31
virtual void TB_IF_notify_simulation_controller(bool success)=0
Notifies simulation controller about success/failure of the simulation (e.g. data corruption)...
virtual const int TB_IF_get_nb_transactions_received_per_socket(int socketID) const =0
Get the number of transactions processed per socket.
virtual int * TB_IF_get_data_in_ptr(int socketID) const =0
Get incoming data pointer.
virtual const char * TB_IF_name(void) const =0
Get testbench full name.