Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/42100 )
Change subject: cpu: Collapse the SimpleCPUPolicy into O3CPUImpl.
......................................................................
cpu: Collapse the SimpleCPUPolicy into O3CPUImpl.
Change-Id: I0bc160f28f084c8873c3e19be9a4d7a45f9480a0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42100
Reviewed-by: Nathanael Premillieu <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/cpu/o3/commit.hh
M src/cpu/o3/cpu.hh
D src/cpu/o3/cpu_policy.hh
M src/cpu/o3/decode.hh
M src/cpu/o3/fetch.hh
M src/cpu/o3/iew.hh
M src/cpu/o3/impl.hh
M src/cpu/o3/inst_queue.hh
M src/cpu/o3/lsq_unit.hh
M src/cpu/o3/rename.hh
10 files changed, 44 insertions(+), 111 deletions(-)
Approvals:
Nathanael Premillieu: Looks good to me, approved
Gabe Black: Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/cpu/o3/commit.hh b/src/cpu/o3/commit.hh
index 978619d..6b01359 100644
--- a/src/cpu/o3/commit.hh
+++ b/src/cpu/o3/commit.hh
@@ -88,12 +88,10 @@
// Typedefs from the Impl.
typedef typename Impl::O3CPU O3CPU;
typedef typename Impl::DynInstPtr DynInstPtr;
- typedef typename Impl::CPUPol CPUPol;
-
- typedef typename CPUPol::TimeStruct TimeStruct;
- typedef typename CPUPol::FetchStruct FetchStruct;
- typedef typename CPUPol::IEWStruct IEWStruct;
- typedef typename CPUPol::RenameStruct RenameStruct;
+ typedef typename Impl::TimeStruct TimeStruct;
+ typedef typename Impl::FetchStruct FetchStruct;
+ typedef typename Impl::IEWStruct IEWStruct;
+ typedef typename Impl::RenameStruct RenameStruct;
typedef O3ThreadState<Impl> Thread;
diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh
index e462322..196f57d 100644
--- a/src/cpu/o3/cpu.hh
+++ b/src/cpu/o3/cpu.hh
@@ -55,11 +55,11 @@
#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/free_list.hh"
#include "cpu/o3/iew.hh"
+#include "cpu/o3/impl.hh"
#include "cpu/o3/limits.hh"
#include "cpu/o3/rename.hh"
#include "cpu/o3/rob.hh"
@@ -100,7 +100,6 @@
{
public:
// Typedefs from the Impl here.
- typedef typename Impl::CPUPol CPUPolicy;
typedef typename Impl::DynInstPtr DynInstPtr;
typedef typename Impl::O3CPU O3CPU;
@@ -558,15 +557,15 @@
/** Typedefs from the Impl to get the structs that each of the
* time buffers should use.
*/
- typedef typename CPUPolicy::TimeStruct TimeStruct;
+ typedef typename Impl::TimeStruct TimeStruct;
- typedef typename CPUPolicy::FetchStruct FetchStruct;
+ typedef typename Impl::FetchStruct FetchStruct;
- typedef typename CPUPolicy::DecodeStruct DecodeStruct;
+ typedef typename Impl::DecodeStruct DecodeStruct;
- typedef typename CPUPolicy::RenameStruct RenameStruct;
+ typedef typename Impl::RenameStruct RenameStruct;
- typedef typename CPUPolicy::IEWStruct IEWStruct;
+ typedef typename Impl::IEWStruct IEWStruct;
/** The main time buffer to do backwards communication. */
TimeBuffer<TimeStruct> timeBuffer;
diff --git a/src/cpu/o3/cpu_policy.hh b/src/cpu/o3/cpu_policy.hh
deleted file mode 100644
index e016548..0000000
--- a/src/cpu/o3/cpu_policy.hh
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2004-2005 The Regents of The University of Michigan
- * Copyright (c) 2013 Advanced Micro Devices, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met: redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer;
- * redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution;
- * neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __CPU_O3_CPU_POLICY_HH__
-#define __CPU_O3_CPU_POLICY_HH__
-
-#include "cpu/o3/comm.hh"
-
-/**
- * Struct that defines the key classes to be used by the CPU. All
- * classes use the typedefs defined here to determine what are the
- * classes of the other stages and communication buffers. In order to
- * change a structure such as the IQ, simply change the typedef here
- * to use the desired class instead, and recompile. In order to
- * create a different CPU to be used simultaneously with this one, see
- * the alpha_impl.hh file for instructions.
- */
-template<class Impl>
-struct SimpleCPUPolicy
-{
- /** The struct for communication between fetch and decode. */
- typedef DefaultFetchDefaultDecode<Impl> FetchStruct;
-
- /** The struct for communication between decode and rename. */
- typedef DefaultDecodeDefaultRename<Impl> DecodeStruct;
-
- /** The struct for communication between rename and IEW. */
- typedef DefaultRenameDefaultIEW<Impl> RenameStruct;
-
- /** The struct for communication between IEW and commit. */
- typedef DefaultIEWDefaultCommit<Impl> IEWStruct;
-
- /** The struct for communication within the IEW stage. */
- typedef ::IssueStruct<Impl> IssueStruct;
-
- /** The struct for all backwards communication. */
- typedef TimeBufStruct<Impl> TimeStruct;
-
-};
-
-#endif //__CPU_O3_CPU_POLICY_HH__
diff --git a/src/cpu/o3/decode.hh b/src/cpu/o3/decode.hh
index f164a88..c694e3c 100644
--- a/src/cpu/o3/decode.hh
+++ b/src/cpu/o3/decode.hh
@@ -63,12 +63,9 @@
// Typedefs from the Impl.
typedef typename Impl::O3CPU O3CPU;
typedef typename Impl::DynInstPtr DynInstPtr;
- typedef typename Impl::CPUPol CPUPol;
-
- // Typedefs from the CPU policy.
- typedef typename CPUPol::FetchStruct FetchStruct;
- typedef typename CPUPol::DecodeStruct DecodeStruct;
- typedef typename CPUPol::TimeStruct TimeStruct;
+ 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
diff --git a/src/cpu/o3/fetch.hh b/src/cpu/o3/fetch.hh
index 71531f4..dd7b5a0 100644
--- a/src/cpu/o3/fetch.hh
+++ b/src/cpu/o3/fetch.hh
@@ -72,14 +72,11 @@
{
public:
/** Typedefs from Impl. */
- typedef typename Impl::CPUPol CPUPol;
typedef typename Impl::DynInst DynInst;
typedef typename Impl::DynInstPtr DynInstPtr;
typedef typename Impl::O3CPU O3CPU;
-
- /** Typedefs from the CPU policy. */
- typedef typename CPUPol::FetchStruct FetchStruct;
- typedef typename CPUPol::TimeStruct TimeStruct;
+ typedef typename Impl::FetchStruct FetchStruct;
+ typedef typename Impl::TimeStruct TimeStruct;
/**
* IcachePort class for instruction fetch.
diff --git a/src/cpu/o3/iew.hh b/src/cpu/o3/iew.hh
index 497253f..687f745 100644
--- a/src/cpu/o3/iew.hh
+++ b/src/cpu/o3/iew.hh
@@ -81,14 +81,12 @@
{
private:
//Typedefs from Impl
- typedef typename Impl::CPUPol CPUPol;
typedef typename Impl::DynInstPtr DynInstPtr;
typedef typename Impl::O3CPU O3CPU;
-
- typedef typename CPUPol::TimeStruct TimeStruct;
- typedef typename CPUPol::IEWStruct IEWStruct;
- typedef typename CPUPol::RenameStruct RenameStruct;
- typedef typename CPUPol::IssueStruct IssueStruct;
+ 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
diff --git a/src/cpu/o3/impl.hh b/src/cpu/o3/impl.hh
index 8f0affd..c61367f 100644
--- a/src/cpu/o3/impl.hh
+++ b/src/cpu/o3/impl.hh
@@ -29,8 +29,7 @@
#ifndef __CPU_O3_IMPL_HH__
#define __CPU_O3_IMPL_HH__
-#include "config/the_isa.hh"
-#include "cpu/o3/cpu_policy.hh"
+#include "cpu/o3/comm.hh"
// Forward declarations.
class BaseO3DynInst;
@@ -48,8 +47,24 @@
*/
struct O3CPUImpl
{
- /** The CPU policy to be used, which defines all of the CPU stages. */
- typedef SimpleCPUPolicy<O3CPUImpl> CPUPol;
+ /** 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;
+
/** The DynInst type to be used. */
typedef BaseO3DynInst DynInst;
diff --git a/src/cpu/o3/inst_queue.hh b/src/cpu/o3/inst_queue.hh
index 92de7bf..2b79e9c 100644
--- a/src/cpu/o3/inst_queue.hh
+++ b/src/cpu/o3/inst_queue.hh
@@ -90,9 +90,8 @@
//Typedefs from the Impl.
typedef typename Impl::O3CPU O3CPU;
typedef typename Impl::DynInstPtr DynInstPtr;
-
- typedef typename Impl::CPUPol::IssueStruct IssueStruct;
- typedef typename Impl::CPUPol::TimeStruct TimeStruct;
+ typedef typename Impl::IssueStruct IssueStruct;
+ typedef typename Impl::TimeStruct TimeStruct;
// Typedef of iterator through the list of instructions.
typedef typename std::list<DynInstPtr>::iterator ListIt;
diff --git a/src/cpu/o3/lsq_unit.hh b/src/cpu/o3/lsq_unit.hh
index 0fca62c..eda044d 100644
--- a/src/cpu/o3/lsq_unit.hh
+++ b/src/cpu/o3/lsq_unit.hh
@@ -86,7 +86,7 @@
typedef typename Impl::O3CPU O3CPU;
typedef typename Impl::DynInstPtr DynInstPtr;
- typedef typename Impl::CPUPol::IssueStruct IssueStruct;
+ typedef typename Impl::IssueStruct IssueStruct;
using LSQSenderState = typename LSQ<Impl>::LSQSenderState;
using LSQRequest = typename LSQ<Impl>::LSQRequest;
diff --git a/src/cpu/o3/rename.hh b/src/cpu/o3/rename.hh
index 7510a45..eac8e30 100644
--- a/src/cpu/o3/rename.hh
+++ b/src/cpu/o3/rename.hh
@@ -73,14 +73,11 @@
{
public:
// Typedefs from the Impl.
- typedef typename Impl::CPUPol CPUPol;
typedef typename Impl::DynInstPtr DynInstPtr;
typedef typename Impl::O3CPU O3CPU;
-
- // Typedefs from the CPUPol
- typedef typename CPUPol::DecodeStruct DecodeStruct;
- typedef typename CPUPol::RenameStruct RenameStruct;
- typedef typename CPUPol::TimeStruct TimeStruct;
+ 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
17 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/+/42100
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: I0bc160f28f084c8873c3e19be9a4d7a45f9480a0
Gerrit-Change-Number: 42100
Gerrit-PatchSet: 19
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-CC: Giacomo Travaglini <[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