inorder: addtl functionaly for inst. skeds
add find and end functions for inst. schedules that can search by stage number
This commit is contained in:
parent
8b54858831
commit
1a6d25dc47
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue