#include <vector>
#include <list>
+
+#include "base/str.hh"
#include "cpu/inorder/resource.hh"
#include "cpu/inorder/cpu.hh"
using namespace std;
ResourceRequest::ResourceRequest(Resource *_res)
: res(_res), inst(NULL), stagePasses(0), valid(false), doneInResource(false),
- complSlotNum(-1), completed(false), squashed(false), processing(false),
+ completed(false), squashed(false), processing(false),
memStall(false)
{
}
inst = NULL;
}
+std::string
+ResourceRequest::name()
+{
+ return res->name() + "." + to_string(slotNum);
+}
+
void
ResourceRequest::setRequest(DynInstPtr _inst, int stage_num,
int res_idx, int slot_num, unsigned _cmd)
setCompleted(completed);
- // Used for debugging purposes
- if (completed) {
- complSlotNum = slotNum;
- }
-
doneInResource = true;
}
const char *
ResourceEvent::description()
{
- string desc = resource->name() + " event";
+ string desc = resource->name() + "-event:slot[" + to_string(slotIdx)
+ + "]";
return desc.c_str();
}
class ResourceEvent : public Event
{
public:
- /** Pointer to the CPU. */
+ /** Pointer to the Resource this is an event for */
Resource *resource;
ResourceRequest(Resource *_res);
virtual ~ResourceRequest();
+
+ std::string name();
int reqID;
/** Get Slot Number */
int getSlot() { return slotNum; }
- int getComplSlot() { return complSlotNum; }
bool hasSlot() { return slotNum >= 0; }
/** Get Stage Number */
int stageNum;
int resIdx;
int slotNum;
- int complSlotNum;
/** Resource Request Status */
bool completed;