summaryrefslogtreecommitdiff
path: root/src/cpu/inorder/resource.hh
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2011-02-18 14:28:30 -0500
committerKorey Sewell <ksewell@umich.edu>2011-02-18 14:28:30 -0500
commitd64226750ef9b2ac85c116f90cdfdb2a755b32d4 (patch)
treef9e0e41a6008fdf3fa67a8f014dab9b54ffd37e5 /src/cpu/inorder/resource.hh
parentc8837290251a300114975861575f59a58990b51a (diff)
downloadgem5-d64226750ef9b2ac85c116f90cdfdb2a755b32d4.tar.xz
inorder: remove request map, use request vector
take away all instances of reqMap in the code and make all references use the built-in request vectors inside of each resource. The request map was dynamically allocating a request per instruction. The request vector just allocates N number of requests during instantiation and then the surrounding code is fixed up to reuse those N requests *** setRequest() and clearRequest() are the new accessors needed to define a new request in a resource
Diffstat (limited to 'src/cpu/inorder/resource.hh')
-rw-r--r--src/cpu/inorder/resource.hh21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/cpu/inorder/resource.hh b/src/cpu/inorder/resource.hh
index c02fe4014..c40314c94 100644
--- a/src/cpu/inorder/resource.hh
+++ b/src/cpu/inorder/resource.hh
@@ -221,9 +221,9 @@ class Resource {
const int latency;
public:
- /** Mapping of slot-numbers to the resource-request pointers */
- std::map<int, ResReqPtr> reqMap;
-
+ /** List of all Requests the Resource is Servicing. Each request
+ represents part of the resource's bandwidth
+ */
std::vector<ResReqPtr> reqs;
/** A list of all the available execution slots for this resource.
@@ -302,19 +302,21 @@ class ResourceRequest
friend class Resource;
public:
- ResourceRequest(Resource *_res, DynInstPtr _inst, int stage_num,
- int res_idx, int slot_num, unsigned _cmd);
+ ResourceRequest(Resource *_res);
virtual ~ResourceRequest();
int reqID;
+ virtual void setRequest(DynInstPtr _inst, int stage_num,
+ int res_idx, int slot_num, unsigned _cmd);
+
+ virtual void clearRequest();
+
/** Acknowledge that this is a request is done and remove
* from resource.
*/
void done(bool completed = true);
-
- short stagePasses;
/////////////////////////////////////////////
//
@@ -356,6 +358,10 @@ class ResourceRequest
/** Command For This Resource */
unsigned cmd;
+ short stagePasses;
+
+ bool valid;
+
////////////////////////////////////////
//
// GET RESOURCE REQUEST STATUS FROM VARIABLES
@@ -379,7 +385,6 @@ class ResourceRequest
protected:
/** Resource Identification */
- bool valid;
ThreadID tid;
int stageNum;
int resIdx;