diff --git a/src/cpu/o3/commit.hh b/src/cpu/o3/commit.hh index 978619dafe..6b01359a0f 100644 --- a/src/cpu/o3/commit.hh +++ b/src/cpu/o3/commit.hh @@ -88,12 +88,10 @@ class DefaultCommit // 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 Thread; diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh index e462322d72..196f57d124 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 @@ class FullO3CPU : public BaseO3CPU { 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 @@ class FullO3CPU : public BaseO3CPU /** 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 timeBuffer; diff --git a/src/cpu/o3/cpu_policy.hh b/src/cpu/o3/cpu_policy.hh deleted file mode 100644 index e016548848..0000000000 --- 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 -struct SimpleCPUPolicy -{ - /** The struct for communication between fetch and decode. */ - typedef DefaultFetchDefaultDecode FetchStruct; - - /** The struct for communication between decode and rename. */ - typedef DefaultDecodeDefaultRename DecodeStruct; - - /** The struct for communication between rename and IEW. */ - typedef DefaultRenameDefaultIEW RenameStruct; - - /** The struct for communication between IEW and commit. */ - typedef DefaultIEWDefaultCommit IEWStruct; - - /** The struct for communication within the IEW stage. */ - typedef ::IssueStruct IssueStruct; - - /** The struct for all backwards communication. */ - typedef TimeBufStruct TimeStruct; - -}; - -#endif //__CPU_O3_CPU_POLICY_HH__ diff --git a/src/cpu/o3/decode.hh b/src/cpu/o3/decode.hh index f164a8899f..c694e3c380 100644 --- a/src/cpu/o3/decode.hh +++ b/src/cpu/o3/decode.hh @@ -63,12 +63,9 @@ class DefaultDecode // 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 71531f4ec1..dd7b5a0af9 100644 --- a/src/cpu/o3/fetch.hh +++ b/src/cpu/o3/fetch.hh @@ -72,14 +72,11 @@ class DefaultFetch { 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 497253f5b0..687f745d14 100644 --- a/src/cpu/o3/iew.hh +++ b/src/cpu/o3/iew.hh @@ -81,14 +81,12 @@ class DefaultIEW { 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 8f0affd2d3..c61367f46e 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 @@ class FullO3CPU; */ struct O3CPUImpl { - /** The CPU policy to be used, which defines all of the CPU stages. */ - typedef SimpleCPUPolicy CPUPol; + /** The struct for communication between fetch and decode. */ + typedef DefaultFetchDefaultDecode FetchStruct; + + /** The struct for communication between decode and rename. */ + typedef DefaultDecodeDefaultRename DecodeStruct; + + /** The struct for communication between rename and IEW. */ + typedef DefaultRenameDefaultIEW RenameStruct; + + /** The struct for communication between IEW and commit. */ + typedef DefaultIEWDefaultCommit IEWStruct; + + /** The struct for communication within the IEW stage. */ + typedef ::IssueStruct IssueStruct; + + /** The struct for all backwards communication. */ + typedef TimeBufStruct 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 92de7bf920..2b79e9cb77 100644 --- a/src/cpu/o3/inst_queue.hh +++ b/src/cpu/o3/inst_queue.hh @@ -90,9 +90,8 @@ class InstructionQueue //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::iterator ListIt; diff --git a/src/cpu/o3/lsq_unit.hh b/src/cpu/o3/lsq_unit.hh index 0fca62c688..eda044d0d6 100644 --- a/src/cpu/o3/lsq_unit.hh +++ b/src/cpu/o3/lsq_unit.hh @@ -86,7 +86,7 @@ class LSQUnit 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::LSQSenderState; using LSQRequest = typename LSQ::LSQRequest; diff --git a/src/cpu/o3/rename.hh b/src/cpu/o3/rename.hh index 7510a456b1..eac8e30a3b 100644 --- a/src/cpu/o3/rename.hh +++ b/src/cpu/o3/rename.hh @@ -73,14 +73,11 @@ class DefaultRename { 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