add find and end functions for inst. schedules
that can search by stage number
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()
{
/** 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();