diff options
author | Korey Sewell <ksewell@umich.edu> | 2010-06-25 17:42:34 -0400 |
---|---|---|
committer | Korey Sewell <ksewell@umich.edu> | 2010-06-25 17:42:34 -0400 |
commit | 6bfd766f2c6c93cca3f79482bfddf7e6cdeb455e (patch) | |
tree | 615205f85b0bc87a4e6cf4ca57472a976a27c985 /src/cpu/inorder/pipeline_traits.hh | |
parent | 6697d416930a0464bea6ca211a1fdfa8a1e01135 (diff) | |
download | gem5-6bfd766f2c6c93cca3f79482bfddf7e6cdeb455e.tar.xz |
inorder: resource scheduling backend
replace priority queue with vector of lists(1 list per stage) and place inside a class
so that we have more control of when an instruction uses a particular schedule entry
...
also, this is the 1st step toward making the InOrderCPU fully parameterizable. See the
wiki for details on this process
Diffstat (limited to 'src/cpu/inorder/pipeline_traits.hh')
-rw-r--r-- | src/cpu/inorder/pipeline_traits.hh | 61 |
1 files changed, 5 insertions, 56 deletions
diff --git a/src/cpu/inorder/pipeline_traits.hh b/src/cpu/inorder/pipeline_traits.hh index 0f996023b..7abfc9a81 100644 --- a/src/cpu/inorder/pipeline_traits.hh +++ b/src/cpu/inorder/pipeline_traits.hh @@ -42,6 +42,8 @@ #include "params/InOrderCPU.hh" class InOrderDynInst; +class ScheduleEntry; +class ResourceSked; /* This Namespace contains constants, typedefs, functions and * objects specific to the Pipeline Implementation. @@ -88,51 +90,7 @@ namespace ThePipeline { ////////////////////////// // RESOURCE SCHEDULING ////////////////////////// - struct ScheduleEntry { - ScheduleEntry(int stage_num, int _priority, int res_num, int _cmd = 0, - int _idx = 0) : - stageNum(stage_num), resNum(res_num), cmd(_cmd), - idx(_idx), priority(_priority) - { } - - // Stage number to perform this service. - int stageNum; - - // Resource ID to access - int resNum; - - // See specific resource for meaning - unsigned cmd; - - // See specific resource for meaning - unsigned idx; - - // Some Resources May Need Priority? - int priority; - }; - - struct entryCompare { - bool operator()(const ScheduleEntry* lhs, const ScheduleEntry* rhs) - const - { - // Prioritize first by stage number that the resource is needed - if (lhs->stageNum > rhs->stageNum) { - return true; - } else if (lhs->stageNum == rhs->stageNum) { - if (lhs->priority > rhs->priority) { - return true; - } else { - return false; - } - } else { - return false; - } - } - }; - - - typedef std::priority_queue<ScheduleEntry*, std::vector<ScheduleEntry*>, - entryCompare> ResSchedule; + typedef ResourceSked ResSchedule; void createFrontEndSchedule(DynInstPtr &inst); bool createBackEndSchedule(DynInstPtr &inst); @@ -147,17 +105,8 @@ namespace ThePipeline { public: InstStage(DynInstPtr inst, int stage_num); - void needs(int unit, int request) { - instSched->push( new ScheduleEntry( - stageNum, nextTaskPriority++, unit, request - )); - } - - void needs(int unit, int request, int param) { - instSched->push( new ScheduleEntry( - stageNum, nextTaskPriority++, unit, request, param - )); - } + void needs(int unit, int request); + void needs(int unit, int request, int param); }; }; |