Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/42103 )
Change subject: cpu: Remove comm types from O3CPUImpl.
......................................................................
cpu: Remove comm types from O3CPUImpl.
This struct is now empty, although we still need to keep it until all
the types within O3 have been de-templated and no longer need a template
argument.
Change-Id: I3889bdbb1b8d638f7b04e5bfb7698e35eb7f2e57
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42103
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/cpu/o3/comm.hh
M src/cpu/o3/commit.hh
M src/cpu/o3/commit_impl.hh
M src/cpu/o3/cpu.hh
M src/cpu/o3/decode.hh
M src/cpu/o3/decode_impl.hh
M src/cpu/o3/fetch.hh
M src/cpu/o3/fetch_impl.hh
M src/cpu/o3/iew.hh
M src/cpu/o3/iew_impl.hh
M src/cpu/o3/impl.hh
M src/cpu/o3/inst_queue.hh
M src/cpu/o3/inst_queue_impl.hh
M src/cpu/o3/lsq_unit.hh
M src/cpu/o3/probe/elastic_trace.hh
M src/cpu/o3/rename.hh
M src/cpu/o3/rename_impl.hh
17 files changed, 108 insertions(+), 167 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/cpu/o3/comm.hh b/src/cpu/o3/comm.hh
index eb85e5e..c35c2bd 100644
--- a/src/cpu/o3/comm.hh
+++ b/src/cpu/o3/comm.hh
@@ -51,9 +51,11 @@
#include "cpu/o3/limits.hh"
#include "sim/faults.hh"
+namespace O3Comm
+{
+
/** Struct that defines the information passed from fetch to decode. */
-template<class Impl>
-struct DefaultFetchDefaultDecode
+struct FetchStruct
{
int size;
@@ -64,8 +66,7 @@
};
/** Struct that defines the information passed from decode to rename. */
-template<class Impl>
-struct DefaultDecodeDefaultRename
+struct DecodeStruct
{
int size;
@@ -73,8 +74,7 @@
};
/** Struct that defines the information passed from rename to IEW. */
-template<class Impl>
-struct DefaultRenameDefaultIEW
+struct RenameStruct
{
int size;
@@ -82,8 +82,7 @@
};
/** Struct that defines the information passed from IEW to commit. */
-template<class Impl>
-struct DefaultIEWDefaultCommit
+struct IEWStruct
{
int size;
@@ -99,7 +98,6 @@
bool includeSquashInst[O3MaxThreads];
};
-template<class Impl>
struct IssueStruct
{
int size;
@@ -108,8 +106,7 @@
};
/** Struct that defines all backwards communication. */
-template<class Impl>
-struct TimeBufStruct
+struct TimeStruct
{
struct DecodeComm
{
@@ -225,4 +222,6 @@
bool iewUnblock[O3MaxThreads];
};
+} // namespace O3Comm
+
#endif //__CPU_O3_COMM_HH__
diff --git a/src/cpu/o3/commit.hh b/src/cpu/o3/commit.hh
index 4c9a7b5..cb954b8 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/comm.hh"
#include "cpu/o3/dyn_inst_ptr.hh"
#include "cpu/o3/iew.hh"
#include "cpu/o3/limits.hh"
@@ -86,12 +87,6 @@
class DefaultCommit
{
public:
- // Typedefs from the Impl.
- typedef typename Impl::TimeStruct TimeStruct;
- typedef typename Impl::FetchStruct FetchStruct;
- typedef typename Impl::IEWStruct IEWStruct;
- typedef typename Impl::RenameStruct RenameStruct;
-
typedef O3ThreadState<Impl> Thread;
/** Overall commit status. Used to determine if the CPU can deschedule
@@ -147,15 +142,15 @@
void setThreads(std::vector<Thread *> &threads);
/** Sets the main time buffer pointer, used for backwards
communication. */
- void setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr);
+ void setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr);
- void setFetchQueue(TimeBuffer<FetchStruct> *fq_ptr);
+ void setFetchQueue(TimeBuffer<O3Comm::FetchStruct> *fq_ptr);
/** Sets the pointer to the queue coming from rename. */
- void setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr);
+ void setRenameQueue(TimeBuffer<O3Comm::RenameStruct> *rq_ptr);
/** Sets the pointer to the queue coming from IEW. */
- void setIEWQueue(TimeBuffer<IEWStruct> *iq_ptr);
+ void setIEWQueue(TimeBuffer<O3Comm::IEWStruct> *iq_ptr);
/** Sets the pointer to the IEW stage. */
void setIEWStage(DefaultIEW<Impl> *iew_stage);
@@ -326,29 +321,29 @@
private:
/** Time buffer interface. */
- TimeBuffer<TimeStruct> *timeBuffer;
+ TimeBuffer<O3Comm::TimeStruct> *timeBuffer;
/** Wire to write information heading to previous stages. */
- typename TimeBuffer<TimeStruct>::wire toIEW;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire toIEW;
/** Wire to read information from IEW (for ROB). */
- typename TimeBuffer<TimeStruct>::wire robInfoFromIEW;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire robInfoFromIEW;
- TimeBuffer<FetchStruct> *fetchQueue;
+ TimeBuffer<O3Comm::FetchStruct> *fetchQueue;
- typename TimeBuffer<FetchStruct>::wire fromFetch;
+ typename TimeBuffer<O3Comm::FetchStruct>::wire fromFetch;
/** IEW instruction queue interface. */
- TimeBuffer<IEWStruct> *iewQueue;
+ TimeBuffer<O3Comm::IEWStruct> *iewQueue;
/** Wire to read information from IEW queue. */
- typename TimeBuffer<IEWStruct>::wire fromIEW;
+ typename TimeBuffer<O3Comm::IEWStruct>::wire fromIEW;
/** Rename instruction queue interface, for ROB. */
- TimeBuffer<RenameStruct> *renameQueue;
+ TimeBuffer<O3Comm::RenameStruct> *renameQueue;
/** Wire to read information from rename queue. */
- typename TimeBuffer<RenameStruct>::wire fromRename;
+ typename TimeBuffer<O3Comm::RenameStruct>::wire fromRename;
public:
/** ROB interface. */
diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh
index 4442eb9..3e7f97f 100644
--- a/src/cpu/o3/commit_impl.hh
+++ b/src/cpu/o3/commit_impl.hh
@@ -259,7 +259,7 @@
template <class Impl>
void
-DefaultCommit<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr)
+DefaultCommit<Impl>::setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr)
{
timeBuffer = tb_ptr;
@@ -272,7 +272,7 @@
template <class Impl>
void
-DefaultCommit<Impl>::setFetchQueue(TimeBuffer<FetchStruct> *fq_ptr)
+DefaultCommit<Impl>::setFetchQueue(TimeBuffer<O3Comm::FetchStruct> *fq_ptr)
{
fetchQueue = fq_ptr;
@@ -282,7 +282,7 @@
template <class Impl>
void
-DefaultCommit<Impl>::setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr)
+DefaultCommit<Impl>::setRenameQueue(TimeBuffer<O3Comm::RenameStruct>
*rq_ptr)
{
renameQueue = rq_ptr;
@@ -292,7 +292,7 @@
template <class Impl>
void
-DefaultCommit<Impl>::setIEWQueue(TimeBuffer<IEWStruct> *iq_ptr)
+DefaultCommit<Impl>::setIEWQueue(TimeBuffer<O3Comm::IEWStruct> *iq_ptr)
{
iewQueue = iq_ptr;
diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh
index 2eeedea..7b5fac0 100644
--- a/src/cpu/o3/cpu.hh
+++ b/src/cpu/o3/cpu.hh
@@ -550,35 +550,23 @@
RenameIdx,
IEWIdx,
CommitIdx,
- NumStages };
-
- /** Typedefs from the Impl to get the structs that each of the
- * time buffers should use.
- */
- typedef typename Impl::TimeStruct TimeStruct;
-
- typedef typename Impl::FetchStruct FetchStruct;
-
- typedef typename Impl::DecodeStruct DecodeStruct;
-
- typedef typename Impl::RenameStruct RenameStruct;
-
- typedef typename Impl::IEWStruct IEWStruct;
+ NumStages
+ };
/** The main time buffer to do backwards communication. */
- TimeBuffer<TimeStruct> timeBuffer;
+ TimeBuffer<O3Comm::TimeStruct> timeBuffer;
/** The fetch stage's instruction queue. */
- TimeBuffer<FetchStruct> fetchQueue;
+ TimeBuffer<O3Comm::FetchStruct> fetchQueue;
/** The decode stage's instruction queue. */
- TimeBuffer<DecodeStruct> decodeQueue;
+ TimeBuffer<O3Comm::DecodeStruct> decodeQueue;
/** The rename stage's instruction queue. */
- TimeBuffer<RenameStruct> renameQueue;
+ TimeBuffer<O3Comm::RenameStruct> renameQueue;
/** The IEW stage's instruction queue. */
- TimeBuffer<IEWStruct> iewQueue;
+ TimeBuffer<O3Comm::IEWStruct> iewQueue;
private:
/** The activity recorder; used to tell if the CPU has any
diff --git a/src/cpu/o3/decode.hh b/src/cpu/o3/decode.hh
index 1d9e04e..20cb467 100644
--- a/src/cpu/o3/decode.hh
+++ b/src/cpu/o3/decode.hh
@@ -44,6 +44,7 @@
#include <queue>
#include "base/statistics.hh"
+#include "cpu/o3/comm.hh"
#include "cpu/o3/dyn_inst_ptr.hh"
#include "cpu/o3/limits.hh"
#include "cpu/timebuf.hh"
@@ -63,12 +64,6 @@
template<class Impl>
class DefaultDecode
{
- private:
- // Typedefs from the Impl.
- typedef typename Impl::FetchStruct FetchStruct;
- typedef typename Impl::DecodeStruct DecodeStruct;
- typedef typename Impl::TimeStruct TimeStruct;
-
public:
/** Overall decode stage status. Used to determine if the CPU can
* deschedule itself due to a lack of activity.
@@ -112,13 +107,13 @@
std::string name() const;
/** Sets the main backwards communication time buffer pointer. */
- void setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr);
+ void setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr);
/** Sets pointer to time buffer used to communicate to the next stage.
*/
- void setDecodeQueue(TimeBuffer<DecodeStruct> *dq_ptr);
+ void setDecodeQueue(TimeBuffer<O3Comm::DecodeStruct> *dq_ptr);
/** Sets pointer to time buffer coming from fetch. */
- void setFetchQueue(TimeBuffer<FetchStruct> *fq_ptr);
+ void setFetchQueue(TimeBuffer<O3Comm::FetchStruct> *fq_ptr);
/** Sets pointer to list of active threads. */
void setActiveThreads(std::list<ThreadID> *at_ptr);
@@ -209,32 +204,32 @@
FullO3CPU<Impl> *cpu;
/** Time buffer interface. */
- TimeBuffer<TimeStruct> *timeBuffer;
+ TimeBuffer<O3Comm::TimeStruct> *timeBuffer;
/** Wire to get rename's output from backwards time buffer. */
- typename TimeBuffer<TimeStruct>::wire fromRename;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire fromRename;
/** Wire to get iew's information from backwards time buffer. */
- typename TimeBuffer<TimeStruct>::wire fromIEW;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire fromIEW;
/** Wire to get commit's information from backwards time buffer. */
- typename TimeBuffer<TimeStruct>::wire fromCommit;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire fromCommit;
/** Wire to write information heading to previous stages. */
// Might not be the best name as not only fetch will read it.
- typename TimeBuffer<TimeStruct>::wire toFetch;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire toFetch;
/** Decode instruction queue. */
- TimeBuffer<DecodeStruct> *decodeQueue;
+ TimeBuffer<O3Comm::DecodeStruct> *decodeQueue;
/** Wire used to write any information heading to rename. */
- typename TimeBuffer<DecodeStruct>::wire toRename;
+ typename TimeBuffer<O3Comm::DecodeStruct>::wire toRename;
/** Fetch instruction queue interface. */
- TimeBuffer<FetchStruct> *fetchQueue;
+ TimeBuffer<O3Comm::FetchStruct> *fetchQueue;
/** Wire to get fetch's output from fetch queue. */
- typename TimeBuffer<FetchStruct>::wire fromFetch;
+ typename TimeBuffer<O3Comm::FetchStruct>::wire fromFetch;
/** Queue of all instructions coming from fetch this cycle. */
std::queue<O3DynInstPtr> insts[O3MaxThreads];
diff --git a/src/cpu/o3/decode_impl.hh b/src/cpu/o3/decode_impl.hh
index fc03145..90feb1c 100644
--- a/src/cpu/o3/decode_impl.hh
+++ b/src/cpu/o3/decode_impl.hh
@@ -161,7 +161,7 @@
template<class Impl>
void
-DefaultDecode<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr)
+DefaultDecode<Impl>::setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr)
{
timeBuffer = tb_ptr;
@@ -176,7 +176,7 @@
template<class Impl>
void
-DefaultDecode<Impl>::setDecodeQueue(TimeBuffer<DecodeStruct> *dq_ptr)
+DefaultDecode<Impl>::setDecodeQueue(TimeBuffer<O3Comm::DecodeStruct>
*dq_ptr)
{
decodeQueue = dq_ptr;
@@ -186,7 +186,7 @@
template<class Impl>
void
-DefaultDecode<Impl>::setFetchQueue(TimeBuffer<FetchStruct> *fq_ptr)
+DefaultDecode<Impl>::setFetchQueue(TimeBuffer<O3Comm::FetchStruct> *fq_ptr)
{
fetchQueue = fq_ptr;
diff --git a/src/cpu/o3/fetch.hh b/src/cpu/o3/fetch.hh
index 2b9e2de..ff6ffee 100644
--- a/src/cpu/o3/fetch.hh
+++ b/src/cpu/o3/fetch.hh
@@ -44,6 +44,7 @@
#include "arch/decoder.hh"
#include "base/statistics.hh"
#include "config/the_isa.hh"
+#include "cpu/o3/comm.hh"
#include "cpu/o3/dyn_inst_ptr.hh"
#include "cpu/o3/limits.hh"
#include "cpu/pc_event.hh"
@@ -72,10 +73,6 @@
class DefaultFetch
{
public:
- /** Typedefs from Impl. */
- typedef typename Impl::FetchStruct FetchStruct;
- typedef typename Impl::TimeStruct TimeStruct;
-
/**
* IcachePort class for instruction fetch.
*/
@@ -221,13 +218,13 @@
void regProbePoints();
/** Sets the main backwards communication time buffer pointer. */
- void setTimeBuffer(TimeBuffer<TimeStruct> *time_buffer);
+ void setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *time_buffer);
/** Sets pointer to list of active threads. */
void setActiveThreads(std::list<ThreadID> *at_ptr);
/** Sets pointer to time buffer used to communicate to the next stage.
*/
- void setFetchQueue(TimeBuffer<FetchStruct> *fq_ptr);
+ void setFetchQueue(TimeBuffer<O3Comm::FetchStruct> *fq_ptr);
/** Initialize stage. */
void startupStage();
@@ -404,23 +401,23 @@
FullO3CPU<Impl> *cpu;
/** Time buffer interface. */
- TimeBuffer<TimeStruct> *timeBuffer;
+ TimeBuffer<O3Comm::TimeStruct> *timeBuffer;
/** Wire to get decode's information from backwards time buffer. */
- typename TimeBuffer<TimeStruct>::wire fromDecode;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire fromDecode;
/** Wire to get rename's information from backwards time buffer. */
- typename TimeBuffer<TimeStruct>::wire fromRename;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire fromRename;
/** Wire to get iew's information from backwards time buffer. */
- typename TimeBuffer<TimeStruct>::wire fromIEW;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire fromIEW;
/** Wire to get commit's information from backwards time buffer. */
- typename TimeBuffer<TimeStruct>::wire fromCommit;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire fromCommit;
//Might be annoying how this name is different than the queue.
/** Wire used to write any information heading to decode. */
- typename TimeBuffer<FetchStruct>::wire toDecode;
+ typename TimeBuffer<O3Comm::FetchStruct>::wire toDecode;
/** BPredUnit. */
BPredUnit *branchPred;
diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh
index a5627e1..72b10c5 100644
--- a/src/cpu/o3/fetch_impl.hh
+++ b/src/cpu/o3/fetch_impl.hh
@@ -262,7 +262,7 @@
}
template<class Impl>
void
-DefaultFetch<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *time_buffer)
+DefaultFetch<Impl>::setTimeBuffer(TimeBuffer<O3Comm::TimeStruct>
*time_buffer)
{
timeBuffer = time_buffer;
@@ -282,7 +282,7 @@
template<class Impl>
void
-DefaultFetch<Impl>::setFetchQueue(TimeBuffer<FetchStruct> *ftb_ptr)
+DefaultFetch<Impl>::setFetchQueue(TimeBuffer<O3Comm::FetchStruct> *ftb_ptr)
{
// Create wire to write information to proper place in fetch time buf.
toDecode = ftb_ptr->getWire(0);
diff --git a/src/cpu/o3/iew.hh b/src/cpu/o3/iew.hh
index a0f4869..24999b5 100644
--- a/src/cpu/o3/iew.hh
+++ b/src/cpu/o3/iew.hh
@@ -80,13 +80,6 @@
template<class Impl>
class DefaultIEW
{
- private:
- //Typedefs from Impl
- typedef typename Impl::TimeStruct TimeStruct;
- typedef typename Impl::IEWStruct IEWStruct;
- typedef typename Impl::RenameStruct RenameStruct;
- typedef typename Impl::IssueStruct IssueStruct;
-
public:
/** Overall IEW stage status. Used to determine if the CPU can
* deschedule itself due to a lack of activity.
@@ -143,13 +136,13 @@
void clearStates(ThreadID tid);
/** Sets main time buffer used for backwards communication. */
- void setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr);
+ void setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr);
/** Sets time buffer for getting instructions coming from rename. */
- void setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr);
+ void setRenameQueue(TimeBuffer<O3Comm::RenameStruct> *rq_ptr);
/** Sets time buffer to pass on instructions to commit. */
- void setIEWQueue(TimeBuffer<IEWStruct> *iq_ptr);
+ void setIEWQueue(TimeBuffer<O3Comm::IEWStruct> *iq_ptr);
/** Sets pointer to list of active threads. */
void setActiveThreads(std::list<ThreadID> *at_ptr);
@@ -303,37 +296,37 @@
void updateExeInstStats(const O3DynInstPtr &inst);
/** Pointer to main time buffer used for backwards communication. */
- TimeBuffer<TimeStruct> *timeBuffer;
+ TimeBuffer<O3Comm::TimeStruct> *timeBuffer;
/** Wire to write information heading to previous stages. */
- typename TimeBuffer<TimeStruct>::wire toFetch;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire toFetch;
/** Wire to get commit's output from backwards time buffer. */
- typename TimeBuffer<TimeStruct>::wire fromCommit;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire fromCommit;
/** Wire to write information heading to previous stages. */
- typename TimeBuffer<TimeStruct>::wire toRename;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire toRename;
/** Rename instruction queue interface. */
- TimeBuffer<RenameStruct> *renameQueue;
+ TimeBuffer<O3Comm::RenameStruct> *renameQueue;
/** Wire to get rename's output from rename queue. */
- typename TimeBuffer<RenameStruct>::wire fromRename;
+ typename TimeBuffer<O3Comm::RenameStruct>::wire fromRename;
/** Issue stage queue. */
- TimeBuffer<IssueStruct> issueToExecQueue;
+ TimeBuffer<O3Comm::IssueStruct> issueToExecQueue;
/** Wire to read information from the issue stage time queue. */
- typename TimeBuffer<IssueStruct>::wire fromIssue;
+ typename TimeBuffer<O3Comm::IssueStruct>::wire fromIssue;
/**
* IEW stage time buffer. Holds ROB indices of instructions that
* can be marked as completed.
*/
- TimeBuffer<IEWStruct> *iewQueue;
+ TimeBuffer<O3Comm::IEWStruct> *iewQueue;
/** Wire to write infromation heading to commit. */
- typename TimeBuffer<IEWStruct>::wire toCommit;
+ typename TimeBuffer<O3Comm::IEWStruct>::wire toCommit;
/** Queue of all instructions coming from rename this cycle. */
std::queue<O3DynInstPtr> insts[O3MaxThreads];
diff --git a/src/cpu/o3/iew_impl.hh b/src/cpu/o3/iew_impl.hh
index 54327fa..57edc93 100644
--- a/src/cpu/o3/iew_impl.hh
+++ b/src/cpu/o3/iew_impl.hh
@@ -306,7 +306,7 @@
template<class Impl>
void
-DefaultIEW<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr)
+DefaultIEW<Impl>::setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr)
{
timeBuffer = tb_ptr;
@@ -324,7 +324,7 @@
template<class Impl>
void
-DefaultIEW<Impl>::setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr)
+DefaultIEW<Impl>::setRenameQueue(TimeBuffer<O3Comm::RenameStruct> *rq_ptr)
{
renameQueue = rq_ptr;
@@ -334,7 +334,7 @@
template<class Impl>
void
-DefaultIEW<Impl>::setIEWQueue(TimeBuffer<IEWStruct> *iq_ptr)
+DefaultIEW<Impl>::setIEWQueue(TimeBuffer<O3Comm::IEWStruct> *iq_ptr)
{
iewQueue = iq_ptr;
diff --git a/src/cpu/o3/impl.hh b/src/cpu/o3/impl.hh
index d9d3e1f..b3b21e9 100644
--- a/src/cpu/o3/impl.hh
+++ b/src/cpu/o3/impl.hh
@@ -29,8 +29,6 @@
#ifndef __CPU_O3_IMPL_HH__
#define __CPU_O3_IMPL_HH__
-#include "cpu/o3/comm.hh"
-
/** Implementation specific struct that defines several key types to the
* CPU, the stages within the CPU, the time buffers, and the DynInst.
* The struct defines the ISA, the CPU policy, the specific DynInst, the
@@ -39,25 +37,6 @@
* This is one of the key things that must be defined for each hardware
* specific CPU implementation.
*/
-struct O3CPUImpl
-{
- /** The struct for communication between fetch and decode. */
- typedef DefaultFetchDefaultDecode<O3CPUImpl> FetchStruct;
-
- /** The struct for communication between decode and rename. */
- typedef DefaultDecodeDefaultRename<O3CPUImpl> DecodeStruct;
-
- /** The struct for communication between rename and IEW. */
- typedef DefaultRenameDefaultIEW<O3CPUImpl> RenameStruct;
-
- /** The struct for communication between IEW and commit. */
- typedef DefaultIEWDefaultCommit<O3CPUImpl> IEWStruct;
-
- /** The struct for communication within the IEW stage. */
- typedef ::IssueStruct<O3CPUImpl> IssueStruct;
-
- /** The struct for all backwards communication. */
- typedef TimeBufStruct<O3CPUImpl> TimeStruct;
-};
+struct O3CPUImpl {};
#endif // __CPU_O3_SPARC_IMPL_HH__
diff --git a/src/cpu/o3/inst_queue.hh b/src/cpu/o3/inst_queue.hh
index 879655d..7791cdc 100644
--- a/src/cpu/o3/inst_queue.hh
+++ b/src/cpu/o3/inst_queue.hh
@@ -50,6 +50,7 @@
#include "base/statistics.hh"
#include "base/types.hh"
#include "cpu/inst_seq.hh"
+#include "cpu/o3/comm.hh"
#include "cpu/o3/dep_graph.hh"
#include "cpu/o3/dyn_inst_ptr.hh"
#include "cpu/o3/limits.hh"
@@ -91,10 +92,6 @@
class InstructionQueue
{
public:
- //Typedefs from the Impl.
- typedef typename Impl::IssueStruct IssueStruct;
- typedef typename Impl::TimeStruct TimeStruct;
-
// Typedef of iterator through the list of instructions.
typedef typename std::list<O3DynInstPtr>::iterator ListIt;
@@ -143,10 +140,10 @@
void setActiveThreads(std::list<ThreadID> *at_ptr);
/** Sets the timer buffer between issue and execute. */
- void setIssueToExecuteQueue(TimeBuffer<IssueStruct> *i2eQueue);
+ void setIssueToExecuteQueue(TimeBuffer<O3Comm::IssueStruct> *i2eQueue);
/** Sets the global time buffer. */
- void setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr);
+ void setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr);
/** Determine if we are drained. */
bool isDrained() const;
@@ -300,13 +297,13 @@
/** The queue to the execute stage. Issued instructions will be
written
* into it.
*/
- TimeBuffer<IssueStruct> *issueToExecuteQueue;
+ TimeBuffer<O3Comm::IssueStruct> *issueToExecuteQueue;
/** The backwards time buffer. */
- TimeBuffer<TimeStruct> *timeBuffer;
+ TimeBuffer<O3Comm::TimeStruct> *timeBuffer;
/** Wire to read information from timebuffer. */
- typename TimeBuffer<TimeStruct>::wire fromCommit;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire fromCommit;
/** Function unit pool. */
FUPool *fuPool;
diff --git a/src/cpu/o3/inst_queue_impl.hh b/src/cpu/o3/inst_queue_impl.hh
index 3159742..e521fc1 100644
--- a/src/cpu/o3/inst_queue_impl.hh
+++ b/src/cpu/o3/inst_queue_impl.hh
@@ -441,14 +441,15 @@
template <class Impl>
void
-InstructionQueue<Impl>::setIssueToExecuteQueue(TimeBuffer<IssueStruct>
*i2e_ptr)
+InstructionQueue<Impl>::setIssueToExecuteQueue(
+ TimeBuffer<O3Comm::IssueStruct> *i2e_ptr)
{
issueToExecuteQueue = i2e_ptr;
}
template <class Impl>
void
-InstructionQueue<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr)
+InstructionQueue<Impl>::setTimeBuffer(TimeBuffer<O3Comm::TimeStruct>
*tb_ptr)
{
timeBuffer = tb_ptr;
@@ -779,7 +780,7 @@
DPRINTF(IQ, "Attempting to schedule ready instructions from "
"the IQ.\n");
- IssueStruct *i2e_info = issueToExecuteQueue->access(0);
+ O3Comm::IssueStruct *i2e_info = issueToExecuteQueue->access(0);
O3DynInstPtr mem_inst;
while ((mem_inst = std::move(getDeferredMemInstToExecute()))) {
diff --git a/src/cpu/o3/lsq_unit.hh b/src/cpu/o3/lsq_unit.hh
index 14768f8..704a20b 100644
--- a/src/cpu/o3/lsq_unit.hh
+++ b/src/cpu/o3/lsq_unit.hh
@@ -53,6 +53,7 @@
#include "arch/locked_mem.hh"
#include "config/the_isa.hh"
#include "cpu/inst_seq.hh"
+#include "cpu/o3/comm.hh"
#include "cpu/o3/dyn_inst_ptr.hh"
#include "cpu/o3/lsq.hh"
#include "cpu/timebuf.hh"
@@ -85,8 +86,6 @@
public:
static constexpr auto MaxDataBytes = MaxVecRegLenInBytes;
- typedef typename Impl::IssueStruct IssueStruct;
-
using LSQSenderState = typename LSQ<Impl>::LSQSenderState;
using LSQRequest = typename LSQ<Impl>::LSQRequest;
private:
@@ -521,7 +520,7 @@
Addr cacheBlockMask;
/** Wire to read information from the issue stage time queue. */
- typename TimeBuffer<IssueStruct>::wire fromIssue;
+ typename TimeBuffer<O3Comm::IssueStruct>::wire fromIssue;
/** Whether or not the LSQ is stalled. */
bool stalled;
diff --git a/src/cpu/o3/probe/elastic_trace.hh
b/src/cpu/o3/probe/elastic_trace.hh
index 914e4ea..d43eb36 100644
--- a/src/cpu/o3/probe/elastic_trace.hh
+++ b/src/cpu/o3/probe/elastic_trace.hh
@@ -50,8 +50,10 @@
#include <unordered_map>
#include <utility>
+#include "base/statistics.hh"
#include "cpu/o3/dyn_inst_ptr.hh"
#include "cpu/o3/impl.hh"
+#include "cpu/reg_class.hh"
#include "mem/request.hh"
#include "params/ElasticTrace.hh"
#include "proto/inst_dep_record.pb.h"
diff --git a/src/cpu/o3/rename.hh b/src/cpu/o3/rename.hh
index 0fa8f18..1424bdb 100644
--- a/src/cpu/o3/rename.hh
+++ b/src/cpu/o3/rename.hh
@@ -47,6 +47,7 @@
#include "base/statistics.hh"
#include "config/the_isa.hh"
+#include "cpu/o3/comm.hh"
#include "cpu/o3/commit.hh"
#include "cpu/o3/dyn_inst_ptr.hh"
#include "cpu/o3/free_list.hh"
@@ -73,11 +74,6 @@
class DefaultRename
{
public:
- // Typedefs from the Impl.
- typedef typename Impl::DecodeStruct DecodeStruct;
- typedef typename Impl::RenameStruct RenameStruct;
- typedef typename Impl::TimeStruct TimeStruct;
-
// 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
// using a deque instead of a queue. (Most other stages use a
@@ -134,13 +130,13 @@
void regProbePoints();
/** Sets the main backwards communication time buffer pointer. */
- void setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr);
+ void setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr);
/** Sets pointer to time buffer used to communicate to the next stage.
*/
- void setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr);
+ void setRenameQueue(TimeBuffer<O3Comm::RenameStruct> *rq_ptr);
/** Sets pointer to time buffer coming from decode. */
- void setDecodeQueue(TimeBuffer<DecodeStruct> *dq_ptr);
+ void setDecodeQueue(TimeBuffer<O3Comm::DecodeStruct> *dq_ptr);
/** Sets pointer to IEW stage. Used only for initialization. */
void setIEWStage(DefaultIEW<Impl> *iew_stage)
@@ -322,28 +318,28 @@
FullO3CPU<Impl> *cpu;
/** Pointer to main time buffer used for backwards communication. */
- TimeBuffer<TimeStruct> *timeBuffer;
+ TimeBuffer<O3Comm::TimeStruct> *timeBuffer;
/** Wire to get IEW's output from backwards time buffer. */
- typename TimeBuffer<TimeStruct>::wire fromIEW;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire fromIEW;
/** Wire to get commit's output from backwards time buffer. */
- typename TimeBuffer<TimeStruct>::wire fromCommit;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire fromCommit;
/** Wire to write infromation heading to previous stages. */
- typename TimeBuffer<TimeStruct>::wire toDecode;
+ typename TimeBuffer<O3Comm::TimeStruct>::wire toDecode;
/** Rename instruction queue. */
- TimeBuffer<RenameStruct> *renameQueue;
+ TimeBuffer<O3Comm::RenameStruct> *renameQueue;
/** Wire to write any information heading to IEW. */
- typename TimeBuffer<RenameStruct>::wire toIEW;
+ typename TimeBuffer<O3Comm::RenameStruct>::wire toIEW;
/** Decode instruction queue interface. */
- TimeBuffer<DecodeStruct> *decodeQueue;
+ TimeBuffer<O3Comm::DecodeStruct> *decodeQueue;
/** Wire to get decode's output from decode queue. */
- typename TimeBuffer<DecodeStruct>::wire fromDecode;
+ typename TimeBuffer<O3Comm::DecodeStruct>::wire fromDecode;
/** Queue of all instructions coming from decode this cycle. */
InstQueue insts[O3MaxThreads];
diff --git a/src/cpu/o3/rename_impl.hh b/src/cpu/o3/rename_impl.hh
index 1a5409b..01904cf 100644
--- a/src/cpu/o3/rename_impl.hh
+++ b/src/cpu/o3/rename_impl.hh
@@ -186,7 +186,7 @@
template <class Impl>
void
-DefaultRename<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr)
+DefaultRename<Impl>::setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr)
{
timeBuffer = tb_ptr;
@@ -202,7 +202,7 @@
template <class Impl>
void
-DefaultRename<Impl>::setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr)
+DefaultRename<Impl>::setRenameQueue(TimeBuffer<O3Comm::RenameStruct>
*rq_ptr)
{
renameQueue = rq_ptr;
@@ -212,7 +212,7 @@
template <class Impl>
void
-DefaultRename<Impl>::setDecodeQueue(TimeBuffer<DecodeStruct> *dq_ptr)
+DefaultRename<Impl>::setDecodeQueue(TimeBuffer<O3Comm::DecodeStruct>
*dq_ptr)
{
decodeQueue = dq_ptr;
18 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/42103
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I3889bdbb1b8d638f7b04e5bfb7698e35eb7f2e57
Gerrit-Change-Number: 42103
Gerrit-PatchSet: 20
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nathanael Premillieu <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s