void BlockchainDB::pop_block(block& blk, std::vector<transaction>& txs) { blk = get_top_block(); remove_block(); for (const auto& h : boost::adaptors::reverse(blk.tx_hashes)) { txs.push_back(get_tx(h)); remove_transaction(h); } remove_transaction(get_transaction_hash(blk.miner_tx)); }
/** * Delete l'opération courante, teste le type de page pour choisir. * * \param * * \return * */ void gsb_data_mix_delete_current_transaction ( void ) { gint current_page; current_page = gsb_gui_navigation_get_current_page ( ); if ( current_page == GSB_ACCOUNT_PAGE ) remove_transaction (); else if ( current_page == GSB_SCHEDULER_PAGE ) gsb_scheduler_list_delete_scheduled_transaction ( 0, TRUE ); }
void retire_transactions() { /* retire the transaction, and return the status to the bus queue slot */ /* The out of order completion of the transaction is possible because the later transaction may hit an open page, where as the earlier transaction may be delayed by a PRECHARGE + RAS or just RAS. Check to see if transaction ordering is strictly enforced. This option is current disabled as of 9/20/2002. Problem with Mase generation non-unique req_id's. out of order data return creates havoc there. This should be investigated and fixed. */ int i; transaction_t * this_t = NULL; int chan_id; if(dram_system.config.strict_ordering_flag == TRUE){ /* if strict ordering is set, check only transaction #0 */ for (chan_id=0;chan_id < dram_system.config.channel_count;chan_id++) { this_t = &dram_system.dram_controller[chan_id].transaction_queue.entry[0]; chan_id = this_t->next_c->chan_id; if((this_t->status == MEM_STATE_COMPLETED) && (this_t->completion_time <= dram_system.current_dram_time)){ /* If this is a refresh or auto precharge transaction, just ignore it. Else... */ set_critical_word_ready(global_biu, this_t->slot_id); set_biu_slot_status(global_biu, this_t->slot_id, MEM_STATE_COMPLETED); int trans_sel_policy = get_transaction_selection_policy(global_biu); if (trans_sel_policy == MOST_PENDING || trans_sel_policy == LEAST_PENDING) del_trans_pending_queue(chan_id,0); /*---------------------small stat counter----------------------*/ switch (this_t->transaction_type) { case (MEMORY_IFETCH_COMMAND): dram_system.tq_info.num_ifetch_tran++; break; case (MEMORY_READ_COMMAND): dram_system.tq_info.num_read_tran++; break; case (MEMORY_PREFETCH): dram_system.tq_info.num_prefetch_tran++; break; case (MEMORY_WRITE_COMMAND): dram_system.tq_info.num_write_tran++; break; default: fprintf(stderr, "unknown transaction type %d\n",this_t->transaction_type); break; } /*---------------------end small stat counter----------------------*/ // Do the update on bank conflict count and bank hit count if (!this_t->issued_ras && this_t->issued_cas) { dram_system.dram_controller[chan_id].rank[this_t->address.rank_id].bank[this_t->address.bank_id].bank_hit++; } else if (this_t->issued_ras && this_t->issued_cas) { dram_system.dram_controller[chan_id].rank[this_t->address.rank_id].bank[this_t->address.bank_id].bank_conflict++; } remove_transaction(chan_id,0); //if (dram_system.config.row_buffer_management_policy == OPEN_PAGE) //update_tran_for_refresh(chan_id); } else if((this_t->critical_word_ready == TRUE) && (this_t->critical_word_ready_time <= dram_system.current_dram_time)){ set_critical_word_ready(global_biu, this_t->slot_id); } } } else { for (chan_id=0;chan_id < dram_system.config.channel_count;chan_id++) { for(i=0;i<dram_system.dram_controller[chan_id].transaction_queue.transaction_count;i++){ this_t = &dram_system.dram_controller[chan_id].transaction_queue.entry[i]; chan_id = this_t->next_c->chan_id; if((this_t->status == MEM_STATE_COMPLETED) && (this_t->completion_time <= dram_system.current_dram_time)){ if((get_biu_slot_status(global_biu, this_t->slot_id) != MEM_STATE_COMPLETED)){ /* If this is a refresh or auto precharge transaction, just ignore it. Else... */ set_critical_word_ready(global_biu, this_t->slot_id); set_biu_slot_status(global_biu, this_t->slot_id, MEM_STATE_COMPLETED); } int trans_sel_policy = get_transaction_selection_policy(global_biu); if (trans_sel_policy == MOST_PENDING || trans_sel_policy == LEAST_PENDING) del_trans_pending_queue(chan_id,i); /*---------------------small stat counter----------------------*/ switch (this_t->transaction_type) { case (MEMORY_IFETCH_COMMAND): dram_system.tq_info.num_ifetch_tran++; break; case (MEMORY_READ_COMMAND): dram_system.tq_info.num_read_tran++; break; case (MEMORY_PREFETCH): dram_system.tq_info.num_prefetch_tran++; break; case (MEMORY_WRITE_COMMAND): dram_system.tq_info.num_write_tran++; break; default: fprintf(stderr, "unknown transaction type %d ID %d\n",this_t->transaction_type, this_t->transaction_id); break; } /*---------------------end small stat counter----------------------*/ // Do the update on bank conflict count and bank hit count if (!this_t->issued_ras && this_t->issued_cas) { dram_system.dram_controller[chan_id].rank[this_t->address.rank_id].bank[this_t->address.bank_id].bank_hit++; } else if (this_t->issued_ras && this_t->issued_cas) { dram_system.dram_controller[chan_id].rank[this_t->address.rank_id].bank[this_t->address.bank_id].bank_conflict++; } remove_transaction(chan_id,i); } else if((this_t->critical_word_ready == TRUE) && (this_t->critical_word_ready_time <= dram_system.current_dram_time)){ set_critical_word_ready(global_biu, this_t->slot_id); } } } } }