summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();