Gabe Black has uploaded this change for review. (
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
---
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, 110 insertions(+), 168 deletions(-)
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 312d7a7..35223d6 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
@@ -145,15 +140,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);
@@ -324,29 +319,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 ad037c8..8e73e39 100644
--- a/src/cpu/o3/commit_impl.hh
+++ b/src/cpu/o3/commit_impl.hh
@@ -253,7 +253,7 @@
template <class Impl>
void
-DefaultCommit<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr)
+DefaultCommit<Impl>::setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr)
{
timeBuffer = tb_ptr;
@@ -266,7 +266,7 @@
template <class Impl>
void
-DefaultCommit<Impl>::setFetchQueue(TimeBuffer<FetchStruct> *fq_ptr)
+DefaultCommit<Impl>::setFetchQueue(TimeBuffer<O3Comm::FetchStruct> *fq_ptr)
{
fetchQueue = fq_ptr;
@@ -276,7 +276,7 @@
template <class Impl>
void
-DefaultCommit<Impl>::setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr)
+DefaultCommit<Impl>::setRenameQueue(TimeBuffer<O3Comm::RenameStruct>
*rq_ptr)
{
renameQueue = rq_ptr;
@@ -286,7 +286,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 cc824d5..f1f2a17 100644
--- a/src/cpu/o3/cpu.hh
+++ b/src/cpu/o3/cpu.hh
@@ -594,41 +594,30 @@
* activateStage() or deactivateStage(), they can specify which stage
* is being activated/deactivated.
*/
- enum StageIdx {
+ enum StageIdx
+ {
FetchIdx,
DecodeIdx,
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 5ce138c..e9de729 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.
@@ -110,13 +105,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);
@@ -207,32 +202,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 c5dd305..deedc13 100644
--- a/src/cpu/o3/decode_impl.hh
+++ b/src/cpu/o3/decode_impl.hh
@@ -159,7 +159,7 @@
template<class Impl>
void
-DefaultDecode<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr)
+DefaultDecode<Impl>::setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr)
{
timeBuffer = tb_ptr;
@@ -174,7 +174,7 @@
template<class Impl>
void
-DefaultDecode<Impl>::setDecodeQueue(TimeBuffer<DecodeStruct> *dq_ptr)
+DefaultDecode<Impl>::setDecodeQueue(TimeBuffer<O3Comm::DecodeStruct>
*dq_ptr)
{
decodeQueue = dq_ptr;
@@ -184,7 +184,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 a9b534d..4cb7fb3 100644
--- a/src/cpu/o3/fetch.hh
+++ b/src/cpu/o3/fetch.hh
@@ -45,6 +45,7 @@
#include "arch/utility.hh"
#include "base/statistics.hh"
#include "config/the_isa.hh"
+#include "cpu/o3/comm.hh"
#include "cpu/o3/limits.hh"
#include "cpu/pc_event.hh"
#include "cpu/pred/bpred_unit.hh"
@@ -75,10 +76,6 @@
class DefaultFetch
{
public:
- /** Typedefs from Impl. */
- typedef typename Impl::FetchStruct FetchStruct;
- typedef typename Impl::TimeStruct TimeStruct;
-
/**
* IcachePort class for instruction fetch.
*/
@@ -222,13 +219,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();
@@ -405,23 +402,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 171699c..86d7f12 100644
--- a/src/cpu/o3/fetch_impl.hh
+++ b/src/cpu/o3/fetch_impl.hh
@@ -256,7 +256,7 @@
}
template<class Impl>
void
-DefaultFetch<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *time_buffer)
+DefaultFetch<Impl>::setTimeBuffer(TimeBuffer<O3Comm::TimeStruct>
*time_buffer)
{
timeBuffer = time_buffer;
@@ -276,7 +276,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 b6f553c..68c56b4 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.
@@ -141,13 +134,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);
@@ -301,37 +294,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 8d0e290..fbd7cf4 100644
--- a/src/cpu/o3/iew_impl.hh
+++ b/src/cpu/o3/iew_impl.hh
@@ -293,7 +293,7 @@
template<class Impl>
void
-DefaultIEW<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr)
+DefaultIEW<Impl>::setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr)
{
timeBuffer = tb_ptr;
@@ -311,7 +311,7 @@
template<class Impl>
void
-DefaultIEW<Impl>::setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr)
+DefaultIEW<Impl>::setRenameQueue(TimeBuffer<O3Comm::RenameStruct> *rq_ptr)
{
renameQueue = rq_ptr;
@@ -321,7 +321,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 51fb40a..8cfbfeb 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;
@@ -142,10 +139,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;
@@ -299,13 +296,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 fbe2167..5204594 100644
--- a/src/cpu/o3/inst_queue_impl.hh
+++ b/src/cpu/o3/inst_queue_impl.hh
@@ -435,14 +435,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;
@@ -773,7 +774,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 0fee4a1..0528bbe 100644
--- a/src/cpu/o3/lsq_unit.hh
+++ b/src/cpu/o3/lsq_unit.hh
@@ -54,6 +54,7 @@
#include "base/refcnt.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"
@@ -86,8 +87,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:
@@ -522,7 +521,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 dd1206a..49939a4 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 ede0fea..22f89ee 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
@@ -132,13 +128,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)
@@ -319,28 +315,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 6fcd7c2..9ea1dbc 100644
--- a/src/cpu/o3/rename_impl.hh
+++ b/src/cpu/o3/rename_impl.hh
@@ -181,7 +181,7 @@
template <class Impl>
void
-DefaultRename<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr)
+DefaultRename<Impl>::setTimeBuffer(TimeBuffer<O3Comm::TimeStruct> *tb_ptr)
{
timeBuffer = tb_ptr;
@@ -197,7 +197,7 @@
template <class Impl>
void
-DefaultRename<Impl>::setRenameQueue(TimeBuffer<RenameStruct> *rq_ptr)
+DefaultRename<Impl>::setRenameQueue(TimeBuffer<O3Comm::RenameStruct>
*rq_ptr)
{
renameQueue = rq_ptr;
@@ -207,7 +207,7 @@
template <class Impl>
void
-DefaultRename<Impl>::setDecodeQueue(TimeBuffer<DecodeStruct> *dq_ptr)
+DefaultRename<Impl>::setDecodeQueue(TimeBuffer<O3Comm::DecodeStruct>
*dq_ptr)
{
decodeQueue = dq_ptr;
--
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: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s