diff --git a/src/cpu/o3/commit.hh b/src/cpu/o3/commit.hh index 7885031d66..5324947093 100644 --- a/src/cpu/o3/commit.hh +++ b/src/cpu/o3/commit.hh @@ -46,6 +46,7 @@ #include "base/statistics.hh" #include "cpu/exetrace.hh" #include "cpu/inst_seq.hh" +#include "cpu/o3/iew.hh" #include "cpu/o3/limits.hh" #include "cpu/timebuf.hh" #include "enums/CommitPolicy.hh" @@ -95,9 +96,6 @@ class DefaultCommit typedef typename CPUPol::IEWStruct IEWStruct; typedef typename CPUPol::RenameStruct RenameStruct; - typedef typename CPUPol::Fetch Fetch; - typedef typename CPUPol::IEW IEW; - typedef O3ThreadState Thread; /** Overall commit status. Used to determine if the CPU can deschedule @@ -164,13 +162,13 @@ class DefaultCommit void setIEWQueue(TimeBuffer *iq_ptr); /** Sets the pointer to the IEW stage. */ - void setIEWStage(IEW *iew_stage); + void setIEWStage(DefaultIEW *iew_stage); /** The pointer to the IEW stage. Used solely to ensure that * various events (traps, interrupts, syscalls) do not occur until * all stores have written back. */ - IEW *iewStage; + DefaultIEW *iewStage; /** Sets pointer to list of active threads. */ void setActiveThreads(std::list *at_ptr); diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh index 463e913e92..8a5f052aee 100644 --- a/src/cpu/o3/commit_impl.hh +++ b/src/cpu/o3/commit_impl.hh @@ -291,7 +291,7 @@ DefaultCommit::setIEWQueue(TimeBuffer *iq_ptr) template void -DefaultCommit::setIEWStage(IEW *iew_stage) +DefaultCommit::setIEWStage(DefaultIEW *iew_stage) { iewStage = iew_stage; } diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh index 7c8b74557e..fa9d40db63 100644 --- a/src/cpu/o3/cpu.hh +++ b/src/cpu/o3/cpu.hh @@ -54,8 +54,13 @@ #include "base/statistics.hh" #include "config/the_isa.hh" #include "cpu/o3/comm.hh" +#include "cpu/o3/commit.hh" #include "cpu/o3/cpu_policy.hh" +#include "cpu/o3/decode.hh" +#include "cpu/o3/fetch.hh" +#include "cpu/o3/iew.hh" #include "cpu/o3/limits.hh" +#include "cpu/o3/rename.hh" #include "cpu/o3/scoreboard.hh" #include "cpu/o3/thread_state.hh" #include "cpu/activity.hh" @@ -487,19 +492,19 @@ class FullO3CPU : public BaseO3CPU protected: /** The fetch stage. */ - typename CPUPolicy::Fetch fetch; + DefaultFetch fetch; /** The decode stage. */ - typename CPUPolicy::Decode decode; + DefaultDecode decode; /** The dispatch stage. */ - typename CPUPolicy::Rename rename; + DefaultRename rename; /** The issue/execute/writeback stages. */ - typename CPUPolicy::IEW iew; + DefaultIEW iew; /** The commit stage. */ - typename CPUPolicy::Commit commit; + DefaultCommit commit; /** The rename mode of the vector registers */ Enums::VecRegRenameMode vecMode; diff --git a/src/cpu/o3/cpu_policy.hh b/src/cpu/o3/cpu_policy.hh index 82dcd095e4..c5af880010 100644 --- a/src/cpu/o3/cpu_policy.hh +++ b/src/cpu/o3/cpu_policy.hh @@ -31,17 +31,12 @@ #define __CPU_O3_CPU_POLICY_HH__ #include "cpu/o3/comm.hh" -#include "cpu/o3/commit.hh" -#include "cpu/o3/decode.hh" -#include "cpu/o3/fetch.hh" #include "cpu/o3/free_list.hh" -#include "cpu/o3/iew.hh" #include "cpu/o3/inst_queue.hh" #include "cpu/o3/lsq.hh" #include "cpu/o3/lsq_unit.hh" #include "cpu/o3/mem_dep_unit.hh" #include "cpu/o3/regfile.hh" -#include "cpu/o3/rename.hh" #include "cpu/o3/rename_map.hh" #include "cpu/o3/rob.hh" #include "cpu/o3/store_set.hh" @@ -73,17 +68,6 @@ struct SimpleCPUPolicy /** Typedef for the thread-specific LSQ units. */ typedef ::LSQUnit LSQUnit; - /** Typedef for fetch. */ - typedef DefaultFetch Fetch; - /** Typedef for decode. */ - typedef DefaultDecode Decode; - /** Typedef for rename. */ - typedef DefaultRename Rename; - /** Typedef for Issue/Execute/Writeback. */ - typedef DefaultIEW IEW; - /** Typedef for commit. */ - typedef DefaultCommit Commit; - /** The struct for communication between fetch and decode. */ typedef DefaultFetchDefaultDecode FetchStruct; diff --git a/src/cpu/o3/inst_queue.hh b/src/cpu/o3/inst_queue.hh index 9e54f17aa9..8f9e0ff30b 100644 --- a/src/cpu/o3/inst_queue.hh +++ b/src/cpu/o3/inst_queue.hh @@ -51,6 +51,7 @@ #include "base/types.hh" #include "cpu/inst_seq.hh" #include "cpu/o3/dep_graph.hh" +#include "cpu/o3/iew.hh" #include "cpu/o3/limits.hh" #include "cpu/op_class.hh" #include "cpu/timebuf.hh" @@ -86,7 +87,6 @@ class InstructionQueue typedef typename Impl::O3CPU O3CPU; typedef typename Impl::DynInstPtr DynInstPtr; - typedef typename Impl::CPUPol::IEW IEW; typedef typename Impl::CPUPol::MemDepUnit MemDepUnit; typedef typename Impl::CPUPol::IssueStruct IssueStruct; typedef typename Impl::CPUPol::TimeStruct TimeStruct; @@ -123,7 +123,7 @@ class InstructionQueue }; /** Constructs an IQ. */ - InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr, + InstructionQueue(O3CPU *cpu_ptr, DefaultIEW *iew_ptr, const DerivO3CPUParams ¶ms); /** Destructs the IQ. */ @@ -282,7 +282,7 @@ class InstructionQueue MemInterface *dcacheInterface; /** Pointer to IEW stage. */ - IEW *iewStage; + DefaultIEW *iewStage; /** The memory dependence unit, which tracks/predicts memory dependences * between instructions. diff --git a/src/cpu/o3/inst_queue_impl.hh b/src/cpu/o3/inst_queue_impl.hh index c992d77aaf..5d1b305270 100644 --- a/src/cpu/o3/inst_queue_impl.hh +++ b/src/cpu/o3/inst_queue_impl.hh @@ -83,8 +83,8 @@ InstructionQueue::FUCompletion::description() const } template -InstructionQueue::InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr, - const DerivO3CPUParams ¶ms) +InstructionQueue::InstructionQueue(O3CPU *cpu_ptr, + DefaultIEW *iew_ptr, const DerivO3CPUParams ¶ms) : cpu(cpu_ptr), iewStage(iew_ptr), fuPool(params.fuPool), diff --git a/src/cpu/o3/lsq.hh b/src/cpu/o3/lsq.hh index 2eaa701e35..95bf258560 100644 --- a/src/cpu/o3/lsq.hh +++ b/src/cpu/o3/lsq.hh @@ -64,6 +64,9 @@ struct DerivO3CPUParams; template class FullO3CPU; +template +class DefaultIEW; + template class LSQ @@ -71,7 +74,6 @@ class LSQ public: typedef typename Impl::O3CPU O3CPU; typedef typename Impl::DynInstPtr DynInstPtr; - typedef typename Impl::CPUPol::IEW IEW; typedef typename Impl::CPUPol::LSQUnit LSQUnit; class LSQRequest; @@ -853,7 +855,8 @@ class LSQ }; /** Constructs an LSQ with the given parameters. */ - LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, const DerivO3CPUParams ¶ms); + LSQ(O3CPU *cpu_ptr, DefaultIEW *iew_ptr, + const DerivO3CPUParams ¶ms); ~LSQ() { } /** Returns the name of the LSQ. */ @@ -1112,7 +1115,7 @@ class LSQ O3CPU *cpu; /** The IEW stage pointer. */ - IEW *iewStage; + DefaultIEW *iewStage; /** Is D-cache blocked? */ bool cacheBlocked() const; diff --git a/src/cpu/o3/lsq_impl.hh b/src/cpu/o3/lsq_impl.hh index 31c1beb3fc..acd4a69f15 100644 --- a/src/cpu/o3/lsq_impl.hh +++ b/src/cpu/o3/lsq_impl.hh @@ -48,6 +48,7 @@ #include "base/logging.hh" #include "cpu/o3/cpu.hh" +#include "cpu/o3/iew.hh" #include "cpu/o3/limits.hh" #include "cpu/o3/lsq.hh" #include "debug/Drain.hh" @@ -58,7 +59,8 @@ #include "params/DerivO3CPU.hh" template -LSQ::LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, const DerivO3CPUParams ¶ms) +LSQ::LSQ(O3CPU *cpu_ptr, DefaultIEW *iew_ptr, + const DerivO3CPUParams ¶ms) : cpu(cpu_ptr), iewStage(iew_ptr), _cacheBlocked(false), cacheStorePorts(params.cacheStorePorts), usedStorePorts(0), diff --git a/src/cpu/o3/lsq_unit.hh b/src/cpu/o3/lsq_unit.hh index ada3d4cb61..70b12ae20c 100644 --- a/src/cpu/o3/lsq_unit.hh +++ b/src/cpu/o3/lsq_unit.hh @@ -62,6 +62,9 @@ struct DerivO3CPUParams; #include "base/circular_queue.hh" +template +class DefaultIEW; + /** * Class that implements the actual LQ and SQ for each specific * thread. Both are circular queues; load entries are freed upon @@ -82,7 +85,6 @@ class LSQUnit typedef typename Impl::O3CPU O3CPU; typedef typename Impl::DynInstPtr DynInstPtr; - typedef typename Impl::CPUPol::IEW IEW; typedef typename Impl::CPUPol::LSQ LSQ; typedef typename Impl::CPUPol::IssueStruct IssueStruct; @@ -232,8 +234,8 @@ class LSQUnit } /** Initializes the LSQ unit with the specified number of entries. */ - void init(O3CPU *cpu_ptr, IEW *iew_ptr, const DerivO3CPUParams ¶ms, - LSQ *lsq_ptr, unsigned id); + void init(O3CPU *cpu_ptr, DefaultIEW *iew_ptr, + const DerivO3CPUParams ¶ms, LSQ *lsq_ptr, unsigned id); /** Returns the name of the LSQ unit. */ std::string name() const; @@ -408,7 +410,7 @@ class LSQUnit O3CPU *cpu; /** Pointer to the IEW stage. */ - IEW *iewStage; + DefaultIEW *iewStage; /** Pointer to the LSQ. */ LSQ *lsq; diff --git a/src/cpu/o3/lsq_unit_impl.hh b/src/cpu/o3/lsq_unit_impl.hh index 8244222aaf..71d02f1216 100644 --- a/src/cpu/o3/lsq_unit_impl.hh +++ b/src/cpu/o3/lsq_unit_impl.hh @@ -215,7 +215,7 @@ LSQUnit::LSQUnit(uint32_t lqEntries, uint32_t sqEntries) template void -LSQUnit::init(O3CPU *cpu_ptr, IEW *iew_ptr, +LSQUnit::init(O3CPU *cpu_ptr, DefaultIEW *iew_ptr, const DerivO3CPUParams ¶ms, LSQ *lsq_ptr, unsigned id) { lsqID = id; diff --git a/src/cpu/o3/rename.hh b/src/cpu/o3/rename.hh index 9859e8eecb..f57ed58ff8 100644 --- a/src/cpu/o3/rename.hh +++ b/src/cpu/o3/rename.hh @@ -47,6 +47,8 @@ #include "base/statistics.hh" #include "config/the_isa.hh" +#include "cpu/o3/commit.hh" +#include "cpu/o3/iew.hh" #include "cpu/o3/limits.hh" #include "cpu/timebuf.hh" #include "sim/probe/probe.hh" @@ -80,9 +82,6 @@ class DefaultRename typedef typename CPUPol::TimeStruct TimeStruct; typedef typename CPUPol::FreeList FreeList; typedef typename CPUPol::RenameMap RenameMap; - // These are used only for initialization. - typedef typename CPUPol::IEW IEW; - typedef typename CPUPol::Commit Commit; // A deque is used to queue the instructions. Barrier insts must // be added to the front of the queue, which is the only reason for @@ -149,19 +148,19 @@ class DefaultRename void setDecodeQueue(TimeBuffer *dq_ptr); /** Sets pointer to IEW stage. Used only for initialization. */ - void setIEWStage(IEW *iew_stage) + void setIEWStage(DefaultIEW *iew_stage) { iew_ptr = iew_stage; } /** Sets pointer to commit stage. Used only for initialization. */ - void setCommitStage(Commit *commit_stage) + void setCommitStage(DefaultCommit *commit_stage) { commit_ptr = commit_stage; } private: /** Pointer to IEW stage. Used only for initialization. */ - IEW *iew_ptr; + DefaultIEW *iew_ptr; /** Pointer to commit stage. Used only for initialization. */ - Commit *commit_ptr; + DefaultCommit *commit_ptr; public: /** Initializes variables for the stage. */