45 lines
759 B
C++
45 lines
759 B
C++
/*
|
|
* ThreadLoad.h
|
|
*
|
|
* Created on: Apr 9, 2014
|
|
* Author: robert
|
|
*/
|
|
|
|
#ifndef THREADLOAD_H_
|
|
#define THREADLOAD_H_
|
|
#include <map>
|
|
#include <tlm.h>
|
|
#include "../common/dramExtension.h"
|
|
|
|
namespace scheduler {
|
|
|
|
typedef tlm::tlm_generic_payload gp;
|
|
|
|
class ThreadLoad
|
|
{
|
|
public:
|
|
ThreadLoad();
|
|
virtual ~ThreadLoad();
|
|
|
|
unsigned int getMaxBankLoad() const;
|
|
unsigned int getTotalLoad() const;
|
|
|
|
void addTransaction(gp* payload);
|
|
std::vector<gp*> getTransactions();
|
|
|
|
private:
|
|
std::map<Bank,std::vector<gp*>> load;
|
|
};
|
|
|
|
bool operator< (const ThreadLoad &lhs, const ThreadLoad &rhs);
|
|
|
|
struct LoadPointerComparer {
|
|
bool operator()(const ThreadLoad* l, const ThreadLoad* r) {
|
|
return *l < *r;
|
|
}
|
|
};
|
|
|
|
} /* namespace scheduler */
|
|
|
|
#endif /* THREADLOAD_H_ */
|