inorder: add valid bit for resource requests
authorKorey Sewell <ksewell@umich.edu>
Fri, 18 Feb 2011 19:28:22 +0000 (14:28 -0500)
committerKorey Sewell <ksewell@umich.edu>
Fri, 18 Feb 2011 19:28:22 +0000 (14:28 -0500)
this will allow us to reuse resource requests within a resource instead
of always dynamically allocating

src/cpu/inorder/resource.cc
src/cpu/inorder/resource.hh

index 568e2759d682f09f06ca164ea7cb495ea4e53656..e6a0db0212131bfc284804ea60438818fcd83955 100644 (file)
@@ -407,7 +407,7 @@ int ResourceRequest::maxReqCount = 0;
 ResourceRequest::ResourceRequest(Resource *_res, DynInstPtr _inst, 
                                  int stage_num, int res_idx, int slot_num, 
                                  unsigned _cmd)
-    : res(_res), inst(_inst), cmd(_cmd),  stageNum(stage_num),
+    : res(_res), inst(_inst), cmd(_cmd),  valid(false), stageNum(stage_num),
       resIdx(res_idx), slotNum(slot_num), completed(false),
       squashed(false), processing(false), memStall(false)
 {
index 7f6cb6642bdf691068a9a6d39146b6b042233277..c02fe40148338fd33ebef77891a7dd6ce6404db7 100644 (file)
@@ -299,6 +299,8 @@ class ResourceRequest
 
     static int maxReqCount;
     
+    friend class Resource;
+
   public:
     ResourceRequest(Resource *_res, DynInstPtr _inst, int stage_num,
                     int res_idx, int slot_num, unsigned _cmd);
@@ -321,7 +323,6 @@ class ResourceRequest
     /////////////////////////////////////////////
     /** Get Resource Index */
     int getResIdx() { return resIdx; }
-
        
     /** Get Slot Number */
     int getSlot() { return slotNum; }
@@ -378,6 +379,7 @@ class ResourceRequest
 
   protected:
     /** Resource Identification */
+    bool valid;
     ThreadID tid;
     int stageNum;
     int resIdx;