summaryrefslogtreecommitdiff
path: root/src/cpu/inorder/cpu.hh
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2011-02-12 10:14:40 -0500
committerKorey Sewell <ksewell@umich.edu>2011-02-12 10:14:40 -0500
commitec9b2ec25151bd857ad0557befc37f00bc61d1c7 (patch)
treef956e3e03407369bf25c046419432e86b6187c6c /src/cpu/inorder/cpu.hh
parent6713dbfe080df4dd04b0f29b5f2fbd6e221ffebf (diff)
downloadgem5-ec9b2ec25151bd857ad0557befc37f00bc61d1c7.tar.xz
inorder: stage scheduler for front/back end schedule creation
add a stage scheduler class to replace InstStage in pipeline_traits.cc use that class to define a default front-end, resource schedule that all instructions will follow. This will also replace the back end schedule in pipeline_traits.cc. The reason for adding this is so that we can cache instruction schedules in the future instead of calling the same function over/over again as well as constantly dynamically alllocating memory on every instruction to try to figure out it's schedule
Diffstat (limited to 'src/cpu/inorder/cpu.hh')
-rw-r--r--src/cpu/inorder/cpu.hh29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/cpu/inorder/cpu.hh b/src/cpu/inorder/cpu.hh
index 154ab690c..2a5c815e1 100644
--- a/src/cpu/inorder/cpu.hh
+++ b/src/cpu/inorder/cpu.hh
@@ -309,6 +309,8 @@ class InOrderCPU : public BaseCPU
*/
SkedCacheIt endOfSkedIt;
+ ThePipeline::RSkedPtr frontEndSked;
+
/** Add a new instruction schedule to the schedule cache */
void addToSkedCache(DynInstPtr inst, ThePipeline::RSkedPtr inst_sked)
{
@@ -351,6 +353,33 @@ class InOrderCPU : public BaseCPU
return id;
}
+ ThePipeline::RSkedPtr createFrontEndSked();
+ ThePipeline::RSkedPtr createBackEndSked(DynInstPtr inst);
+
+ class StageScheduler {
+ private:
+ ThePipeline::RSkedPtr rsked;
+ int stageNum;
+ int nextTaskPriority;
+
+ public:
+ StageScheduler(ThePipeline::RSkedPtr _rsked, int stage_num)
+ : rsked(_rsked), stageNum(stage_num),
+ nextTaskPriority(0)
+ { }
+
+ void needs(int unit, int request) {
+ rsked->push(new ScheduleEntry(
+ stageNum, nextTaskPriority++, unit, request
+ ));
+ }
+
+ void needs(int unit, int request, int param) {
+ rsked->push(new ScheduleEntry(
+ stageNum, nextTaskPriority++, unit, request, param
+ ));
+ }
+ };
public: