summaryrefslogtreecommitdiff
path: root/src/cpu/inorder/resource.cc
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2011-02-18 14:27:52 -0500
committerKorey Sewell <ksewell@umich.edu>2011-02-18 14:27:52 -0500
commit991d0185c68b53a04ae5d1f1a05749bbfddced89 (patch)
tree70a97d5b52ff695810b00513a9b3e0907e2a5d4b /src/cpu/inorder/resource.cc
parent2971b8401a4a76a774962900d9aed6e9eb4b2950 (diff)
downloadgem5-991d0185c68b53a04ae5d1f1a05749bbfddced89.tar.xz
inorder: initialize res. req. vectors based on resource bandwidth
first change in an optimization that will stop InOrder from allocating new memory for every instruction's request to a resource. This gets expensive since every instruction needs to access ~10 requests before graduation. Instead, the plan is to allocate just enough resource request objects to satisfy each resource's bandwidth (e.g. the execution unit would need to allocate 3 resource request objects for a 1-issue pipeline since on any given cycle it could have 2 read requests and 1 write request) and then let the instructions contend and reuse those allocated requests. The end result is a smaller memory footprint for the InOrder model and increased simulation performance
Diffstat (limited to 'src/cpu/inorder/resource.cc')
-rw-r--r--src/cpu/inorder/resource.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cpu/inorder/resource.cc b/src/cpu/inorder/resource.cc
index 72b45dda8..5a31125c6 100644
--- a/src/cpu/inorder/resource.cc
+++ b/src/cpu/inorder/resource.cc
@@ -40,6 +40,8 @@ Resource::Resource(string res_name, int res_id, int res_width,
: resName(res_name), id(res_id),
width(res_width), latency(res_latency), cpu(_cpu)
{
+ reqs.resize(width);
+
// Use to deny a instruction a resource.
deniedReq = new ResourceRequest(this, NULL, 0, 0, 0, 0);
}
@@ -57,6 +59,10 @@ Resource::init()
// Set Up Resource Events to Appropriate Resource BandWidth
resourceEvent = new ResourceEvent[width];
+ for (int i = 0; i < width; i++) {
+ reqs[i] = new ResourceRequest(this, NULL, 0, 0, 0, 0);
+ }
+
initSlots();
}