diff options
author | Korey Sewell <ksewell@umich.edu> | 2011-02-18 14:28:30 -0500 |
---|---|---|
committer | Korey Sewell <ksewell@umich.edu> | 2011-02-18 14:28:30 -0500 |
commit | d64226750ef9b2ac85c116f90cdfdb2a755b32d4 (patch) | |
tree | f9e0e41a6008fdf3fa67a8f014dab9b54ffd37e5 /src/cpu/inorder/resource.hh | |
parent | c8837290251a300114975861575f59a58990b51a (diff) | |
download | gem5-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.hh | 21 |
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; |