summaryrefslogtreecommitdiff
path: root/src/cpu/inorder/resource_pool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/inorder/resource_pool.cc')
-rw-r--r--src/cpu/inorder/resource_pool.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cpu/inorder/resource_pool.cc b/src/cpu/inorder/resource_pool.cc
index 1f15a2c96..74bf4f03b 100644
--- a/src/cpu/inorder/resource_pool.cc
+++ b/src/cpu/inorder/resource_pool.cc
@@ -181,6 +181,25 @@ ResourcePool::getResIdx(const std::string &res_name)
return idx;
}
+ panic("Can't find resource idx for: %s\n", res_name);
+ return 0;
+}
+
+unsigned
+ResourcePool::getResIdx(const ThePipeline::ResourceId &res_id)
+{
+ int num_resources = resources.size();
+
+ for (int idx = 0; idx < num_resources; idx++) {
+ if (resources[idx]->getId() == res_id)
+ return idx;
+ }
+
+ // todo: change return value to int and return a -1 here
+ // maybe even have enumerated type
+ // panic for now...
+ panic("Can't find resource idx for: %i\n", res_id);
+
return 0;
}