16#ifndef SIMICS_SYSTEMC_IFACE_TRANSACTION_POOL_H
17#define SIMICS_SYSTEMC_IFACE_TRANSACTION_POOL_H
35 typedef tlm::tlm_generic_payload gp_t;
47 static struct :
public tlm::tlm_mm_interface {
48 virtual void free(tlm::tlm_generic_payload *gp) {
53 for (std::set<gp_t *>::iterator it = all_payloads_.begin();
54 it != all_payloads_.end(); ++it) {
55 if ((*it)->get_ref_count() == 0) {
58 (*it)->set_mm(&deleter);
71 all_payloads_.insert(gp);
83 void free(gp_t *transaction_ptr) {
85 transaction_ptr->reset();
86 simics::systemc::utility::reset_payload(transaction_ptr);
87 pool_.push_back(transaction_ptr);
89 assert(active_cnt_ >= 0 &&
"Active number of GP becomes negative");
102 std::deque<gp_t *> pool_;
103 std::set<gp_t *> all_payloads_;
Definition: transaction_extension.h:54
A memory manager that implements the tlm::tlm_mm_interface providing a pool of transaction objects.
Definition: transaction_pool.h:34
int active_cnt() const
Definition: transaction_pool.h:96
void free(gp_t *transaction_ptr)
Definition: transaction_pool.h:83
unsigned PoolSize() const
Definition: transaction_pool.h:92
TransactionPool()
Definition: transaction_pool.h:38
~TransactionPool()
Definition: transaction_pool.h:42
Transaction acquire()
Definition: transaction_pool.h:63
Class that encapsulates a generic_payload and returns it to the TransactionPool when the Transaction ...
Definition: transaction.h:31
Definition: pci_bus_interface.h:24