summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2011-06-19 21:43:35 -0400
committerKorey Sewell <ksewell@umich.edu>2011-06-19 21:43:35 -0400
commit1a6d25dc478554cf1e7fe44e607c39989c58f114 (patch)
treedcc3ec214b14ba7c32b296a7bda81aa476b97906 /src
parent8b54858831292661d17f5dd60d9e7672e22fef73 (diff)
downloadgem5-1a6d25dc478554cf1e7fe44e607c39989c58f114.tar.xz
inorder: addtl functionaly for inst. skeds
add find and end functions for inst. schedules that can search by stage number
Diffstat (limited to 'src')
-rw-r--r--src/cpu/inorder/resource_sked.cc21
-rw-r--r--src/cpu/inorder/resource_sked.hh6
2 files changed, 27 insertions, 0 deletions
diff --git a/src/cpu/inorder/resource_sked.cc b/src/cpu/inorder/resource_sked.cc
index 96b4f84b6..e52ed8ff0 100644
--- a/src/cpu/inorder/resource_sked.cc
+++ b/src/cpu/inorder/resource_sked.cc
@@ -90,6 +90,27 @@ ResourceSked::end()
return stages[num_stages - 1].end();
}
+ResourceSked::SkedIt
+ResourceSked::end(int stage_num)
+{
+ return stages[stage_num].end();
+}
+
+ResourceSked::SkedIt
+ResourceSked::find(int stage_num, int cmd)
+{
+ SkedIt stage_it = stages[stage_num].begin();
+ SkedIt stage_end = stages[stage_num].end();
+
+ while (stage_it != stage_end) {
+ if ((*stage_it)->cmd == cmd)
+ return stage_it;
+ stage_it++;
+ }
+
+ return stages[stage_num].end();
+}
+
ScheduleEntry*
ResourceSked::top()
{
diff --git a/src/cpu/inorder/resource_sked.hh b/src/cpu/inorder/resource_sked.hh
index 6338e8e9b..c44c2d3fa 100644
--- a/src/cpu/inorder/resource_sked.hh
+++ b/src/cpu/inorder/resource_sked.hh
@@ -111,6 +111,12 @@ class ResourceSked {
/** Ending Entry of this schedule */
SkedIt end();
+ /** Ending Entry of a specified stage */
+ SkedIt end(int stage_num);
+
+ /** Find a schedule entry based on stage and command */
+ SkedIt find(int stage_num, int cmd);
+
/** What is the next task for this instruction schedule? */
ScheduleEntry* top();