From bc16bbc158613b7eaebe7d2021a6a0503c4a0635 Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Fri, 18 Feb 2011 14:31:31 -0500 Subject: [PATCH] inorder: add names and slot #s to res. dprints --- src/cpu/inorder/resource.cc | 18 +++++++++++------- src/cpu/inorder/resource.hh | 6 +++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/cpu/inorder/resource.cc b/src/cpu/inorder/resource.cc index 701785658..24211532e 100644 --- a/src/cpu/inorder/resource.cc +++ b/src/cpu/inorder/resource.cc @@ -31,6 +31,8 @@ #include #include + +#include "base/str.hh" #include "cpu/inorder/resource.hh" #include "cpu/inorder/cpu.hh" using namespace std; @@ -376,7 +378,7 @@ int ResourceRequest::maxReqCount = 0; 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) { } @@ -391,6 +393,12 @@ ResourceRequest::~ResourceRequest() 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) @@ -433,11 +441,6 @@ ResourceRequest::done(bool completed) setCompleted(completed); - // Used for debugging purposes - if (completed) { - complSlotNum = slotNum; - } - doneInResource = true; } @@ -466,7 +469,8 @@ ResourceEvent::process() const char * ResourceEvent::description() { - string desc = resource->name() + " event"; + string desc = resource->name() + "-event:slot[" + to_string(slotIdx) + + "]"; return desc.c_str(); } diff --git a/src/cpu/inorder/resource.hh b/src/cpu/inorder/resource.hh index fc16df099..7899a215f 100644 --- a/src/cpu/inorder/resource.hh +++ b/src/cpu/inorder/resource.hh @@ -247,7 +247,7 @@ class Resource { class ResourceEvent : public Event { public: - /** Pointer to the CPU. */ + /** Pointer to the Resource this is an event for */ Resource *resource; @@ -305,6 +305,8 @@ class ResourceRequest ResourceRequest(Resource *_res); virtual ~ResourceRequest(); + + std::string name(); int reqID; @@ -330,7 +332,6 @@ class ResourceRequest /** Get Slot Number */ int getSlot() { return slotNum; } - int getComplSlot() { return complSlotNum; } bool hasSlot() { return slotNum >= 0; } /** Get Stage Number */ @@ -393,7 +394,6 @@ class ResourceRequest int stageNum; int resIdx; int slotNum; - int complSlotNum; /** Resource Request Status */ bool completed; -- 2.30.2