void schedule_new_transaction(int chan_id) { int transaction_index; int next_slot_id; /* Then if the command bus(ses) are still open and idle, and something *could* be scheduled, * but isn't, then we can look to create a new transaction by looking in the biu for pending requests * FBDIMM : You check the up_bus * If Refresh enabled you check if you have a refresh waiting ... */ if(dram_system.dram_controller[chan_id].transaction_queue.transaction_count >= (dram_system.config.max_tq_size)){ if (get_transaction_debug()) fprintf(stdout,"[%llu] Transaction queue [%d] full. Cannot start new transaction.\n",dram_system.current_dram_time,chan_id); return ; } if((next_slot_id = get_next_request_from_biu(global_biu)) != MEM_STATE_INVALID){ /* If command bus is idle, see if there is another request in BIU that needs to be serviced. * We start by finding the request we want to service. * Specifically, we want the slot_id of the request * and either move it from VALID to MEM_STATE_SCHEDULED or from MEM_STATE_SCHEDULED to COMPLETED */ transaction_index = add_transaction(dram_system.current_dram_time, get_access_type(global_biu, next_slot_id), next_slot_id,&chan_id); if(transaction_index != MEM_STATE_INVALID){ set_last_transaction_type(global_biu, get_access_type(global_biu, next_slot_id)); set_biu_slot_status(global_biu, next_slot_id, MEM_STATE_SCHEDULED); if(get_transaction_debug()){ fprintf(stdout,"Start @ [%llu]: ",dram_system.current_dram_time); print_transaction(dram_system.current_dram_time,chan_id,dram_system.dram_controller[chan_id].transaction_queue.entry[transaction_index].transaction_id); } } else if (get_transaction_debug()){ fprintf(stdout,"Transaction queue full. Cannot start new transaction.\n"); } } }
void print_stats(const char *title, unsigned int length, unsigned int transactionFlag, GeneratorStatistics *gen, int numProc, int parallellism) { int i; char buf[10]; char name[MAXHOSTNAMELEN]; name[0] = 0; NdbHost_GetHostName(name); ndbout_c("\n------ %s ------",title); ndbout_c("Length : %d %s", length, transactionFlag ? "Transactions" : "sec"); ndbout_c("Processor : %s", name); ndbout_c("Number of Proc: %d",numProc); ndbout_c("Parallellism : %d", parallellism); ndbout_c("\n"); if( gen->totalTransactions == 0 ) { ndbout_c(" No Transactions for this test"); } else { for(i = 0; i < 5; i++) { sprintf(buf, "T%d",i+1); print_transaction(buf, gen->totalTransactions, &gen->transactions[i], i >= 2, i >= 3 ); } ndbout_c("\n"); ndbout_c(" Overall Statistics:"); ndbout_c(" Transactions: %d", gen->totalTransactions); ndbout_c(" Outer : %.0f TPS",gen->outerTps); ndbout_c("\n"); } }
std::ostream & Transaction::print_stream ( std::ostream &os ) const { for ( unsigned i = 0 ; i != m_modified.size() ; i++ ) print_transaction ( i , os ); return os; }