params: Convert the CPU objects to use the auto generated param structs.
authorNathan Binkert <nate@binkert.org>
Mon, 11 Aug 2008 19:22:16 +0000 (12:22 -0700)
committerNathan Binkert <nate@binkert.org>
Mon, 11 Aug 2008 19:22:16 +0000 (12:22 -0700)
A whole bunch of stuff has been converted to use the new params stuff, but
the CPU wasn't one of them.  While we're at it, make some things a bit
more stylish. Most of the work was done by Gabe, I just cleaned stuff up
a bit more at the end.

61 files changed:
src/arch/mips/regfile/misc_regfile.cc
src/cpu/BaseCPU.py
src/cpu/CheckerCPU.py [new file with mode: 0644]
src/cpu/SConscript
src/cpu/base.cc
src/cpu/base.hh
src/cpu/checker/cpu.hh
src/cpu/o3/O3CPU.py
src/cpu/o3/alpha/cpu.hh
src/cpu/o3/alpha/cpu_builder.cc
src/cpu/o3/alpha/cpu_impl.hh
src/cpu/o3/alpha/impl.hh
src/cpu/o3/alpha/params.hh [deleted file]
src/cpu/o3/bpred_unit.hh
src/cpu/o3/bpred_unit_impl.hh
src/cpu/o3/commit.hh
src/cpu/o3/commit_impl.hh
src/cpu/o3/cpu.cc
src/cpu/o3/cpu.hh
src/cpu/o3/decode.hh
src/cpu/o3/decode_impl.hh
src/cpu/o3/fetch.hh
src/cpu/o3/fetch_impl.hh
src/cpu/o3/iew.hh
src/cpu/o3/iew_impl.hh
src/cpu/o3/inst_queue.hh
src/cpu/o3/inst_queue_impl.hh
src/cpu/o3/isa_specific.hh
src/cpu/o3/lsq.hh
src/cpu/o3/lsq_impl.hh
src/cpu/o3/lsq_unit.hh
src/cpu/o3/lsq_unit_impl.hh
src/cpu/o3/mem_dep_unit.hh
src/cpu/o3/mem_dep_unit_impl.hh
src/cpu/o3/mips/cpu.hh
src/cpu/o3/mips/cpu_builder.cc
src/cpu/o3/mips/cpu_impl.hh
src/cpu/o3/mips/impl.hh
src/cpu/o3/mips/params.hh [deleted file]
src/cpu/o3/params.hh [deleted file]
src/cpu/o3/regfile.hh
src/cpu/o3/rename.hh
src/cpu/o3/rename_impl.hh
src/cpu/o3/sparc/cpu.hh
src/cpu/o3/sparc/cpu_builder.cc
src/cpu/o3/sparc/cpu_impl.hh
src/cpu/o3/sparc/impl.hh
src/cpu/o3/sparc/params.hh [deleted file]
src/cpu/o3/thread_state.hh
src/cpu/simple/AtomicSimpleCPU.py
src/cpu/simple/BaseSimpleCPU.py [new file with mode: 0644]
src/cpu/simple/SConscript
src/cpu/simple/TimingSimpleCPU.py
src/cpu/simple/atomic.cc
src/cpu/simple/atomic.hh
src/cpu/simple/base.cc
src/cpu/simple/base.hh
src/cpu/simple/timing.cc
src/cpu/simple/timing.hh
src/cpu/simple_thread.cc
src/sim/pseudo_inst.cc

index dc6ae0baf6d34763a1ae5330be67f17b06765a22..4078510078edd38c7fba7fb8cc6174d9307560ee 100755 (executable)
@@ -40,6 +40,8 @@
 #include "cpu/base.hh"
 #include "cpu/exetrace.hh"
 
+#include "params/DerivO3CPU.hh"
+
 using namespace std;
 
 std::string MiscRegFile::miscRegNames[NumMiscRegs] =
@@ -170,11 +172,12 @@ void
 MiscRegFile::reset(std::string core_name, unsigned num_threads,
                    unsigned num_vpes, BaseCPU *_cpu)
 {
-
     DPRINTF(MipsPRA, "Resetting CP0 State with %i TCs and %i VPEs\n",
             num_threads, num_vpes);
     cpu = _cpu;
-    const BaseCPU::Params *p = _cpu->params;
+
+    TheISA::CoreSpecific &cp = cpu->coreParams;
+
     // Do Default CP0 initialization HERE
 
     // Do Initialization for MT cores here (eventually use
@@ -183,10 +186,10 @@ MiscRegFile::reset(std::string core_name, unsigned num_threads,
     DPRINTF(MipsPRA, "Initializing CP0 State.... ");
 
     MiscReg ProcID = readRegNoEffect(PRId);
-    replaceBits(ProcID,PRIdCoOp_HI,PRIdCoOp_LO,p->coreParams.CP0_PRId_CompanyOptions);
-    replaceBits(ProcID,PRIdCoID_HI,PRIdCoID_LO,p->coreParams.CP0_PRId_CompanyID);
-    replaceBits(ProcID,PRIdProc_ID_HI,PRIdProc_ID_LO,p->coreParams.CP0_PRId_ProcessorID);
-    replaceBits(ProcID,PRIdRev_HI,PRIdRev_LO,p->coreParams.CP0_PRId_Revision);
+    replaceBits(ProcID,PRIdCoOp_HI,PRIdCoOp_LO,cp.CP0_PRId_CompanyOptions);
+    replaceBits(ProcID,PRIdCoID_HI,PRIdCoID_LO,cp.CP0_PRId_CompanyID);
+    replaceBits(ProcID,PRIdProc_ID_HI,PRIdProc_ID_LO,cp.CP0_PRId_ProcessorID);
+    replaceBits(ProcID,PRIdRev_HI,PRIdRev_LO,cp.CP0_PRId_Revision);
     setRegNoEffect(PRId,ProcID);
     // Now, create Write Mask for ProcID register
     MiscReg ProcID_Mask = 0; // Read-Only register
@@ -195,11 +198,11 @@ MiscRegFile::reset(std::string core_name, unsigned num_threads,
 
     // Config
     MiscReg cfg = readRegNoEffect(Config);
-    replaceBits(cfg, Config_BE_HI, Config_BE_LO, p->coreParams.CP0_Config_BE);
-    replaceBits(cfg, Config_AT_HI, Config_AT_LO, p->coreParams.CP0_Config_AT);
-    replaceBits(cfg, Config_AR_HI, Config_AR_LO, p->coreParams.CP0_Config_AR);
-    replaceBits(cfg, Config_MT_HI, Config_MT_LO, p->coreParams.CP0_Config_MT);
-    replaceBits(cfg, Config_VI_HI, Config_VI_LO, p->coreParams.CP0_Config_VI);
+    replaceBits(cfg, Config_BE_HI, Config_BE_LO, cp.CP0_Config_BE);
+    replaceBits(cfg, Config_AT_HI, Config_AT_LO, cp.CP0_Config_AT);
+    replaceBits(cfg, Config_AR_HI, Config_AR_LO, cp.CP0_Config_AR);
+    replaceBits(cfg, Config_MT_HI, Config_MT_LO, cp.CP0_Config_MT);
+    replaceBits(cfg, Config_VI_HI, Config_VI_LO, cp.CP0_Config_VI);
     replaceBits(cfg, Config_M, 1);
     setRegNoEffect(Config, cfg);
     // Now, create Write Mask for Config register
@@ -209,20 +212,20 @@ MiscRegFile::reset(std::string core_name, unsigned num_threads,
 
     // Config1
     MiscReg cfg1 = readRegNoEffect(Config1);
-    replaceBits(cfg1, Config1_MMUSize_HI, Config1_MMUSize_LO, p->coreParams.CP0_Config1_MMU);
-    replaceBits(cfg1, Config1_IS_HI, Config1_IS_LO, p->coreParams.CP0_Config1_IS);
-    replaceBits(cfg1, Config1_IL_HI, Config1_IL_LO, p->coreParams.CP0_Config1_IL);
-    replaceBits(cfg1, Config1_IA_HI, Config1_IA_LO, p->coreParams.CP0_Config1_IA);
-    replaceBits(cfg1, Config1_DS_HI, Config1_DS_LO, p->coreParams.CP0_Config1_DS);
-    replaceBits(cfg1, Config1_DL_HI, Config1_DL_LO, p->coreParams.CP0_Config1_DL);
-    replaceBits(cfg1, Config1_DA_HI, Config1_DA_LO, p->coreParams.CP0_Config1_DA);
-    replaceBits(cfg1, Config1_FP_HI, Config1_FP_LO, p->coreParams.CP0_Config1_FP);
-    replaceBits(cfg1, Config1_EP_HI, Config1_EP_LO, p->coreParams.CP0_Config1_EP);
-    replaceBits(cfg1, Config1_WR_HI, Config1_WR_LO, p->coreParams.CP0_Config1_WR);
-    replaceBits(cfg1, Config1_MD_HI, Config1_MD_LO, p->coreParams.CP0_Config1_MD);
-    replaceBits(cfg1, Config1_C2_HI, Config1_C2_LO, p->coreParams.CP0_Config1_C2);
-    replaceBits(cfg1, Config1_PC_HI, Config1_PC_LO, p->coreParams.CP0_Config1_PC);
-    replaceBits(cfg1, Config1_M, p->coreParams.CP0_Config1_M);
+    replaceBits(cfg1, Config1_MMUSize_HI, Config1_MMUSize_LO, cp.CP0_Config1_MMU);
+    replaceBits(cfg1, Config1_IS_HI, Config1_IS_LO, cp.CP0_Config1_IS);
+    replaceBits(cfg1, Config1_IL_HI, Config1_IL_LO, cp.CP0_Config1_IL);
+    replaceBits(cfg1, Config1_IA_HI, Config1_IA_LO, cp.CP0_Config1_IA);
+    replaceBits(cfg1, Config1_DS_HI, Config1_DS_LO, cp.CP0_Config1_DS);
+    replaceBits(cfg1, Config1_DL_HI, Config1_DL_LO, cp.CP0_Config1_DL);
+    replaceBits(cfg1, Config1_DA_HI, Config1_DA_LO, cp.CP0_Config1_DA);
+    replaceBits(cfg1, Config1_FP_HI, Config1_FP_LO, cp.CP0_Config1_FP);
+    replaceBits(cfg1, Config1_EP_HI, Config1_EP_LO, cp.CP0_Config1_EP);
+    replaceBits(cfg1, Config1_WR_HI, Config1_WR_LO, cp.CP0_Config1_WR);
+    replaceBits(cfg1, Config1_MD_HI, Config1_MD_LO, cp.CP0_Config1_MD);
+    replaceBits(cfg1, Config1_C2_HI, Config1_C2_LO, cp.CP0_Config1_C2);
+    replaceBits(cfg1, Config1_PC_HI, Config1_PC_LO, cp.CP0_Config1_PC);
+    replaceBits(cfg1, Config1_M, cp.CP0_Config1_M);
     setRegNoEffect(Config1, cfg1);
     // Now, create Write Mask for Config register
     MiscReg cfg1_Mask = 0; // Read Only Register
@@ -231,15 +234,15 @@ MiscRegFile::reset(std::string core_name, unsigned num_threads,
 
     // Config2
     MiscReg cfg2 = readRegNoEffect(Config2);
-    replaceBits(cfg2, Config2_TU_HI, Config2_TU_LO, p->coreParams.CP0_Config2_TU);
-    replaceBits(cfg2, Config2_TS_HI, Config2_TS_LO, p->coreParams.CP0_Config2_TS);
-    replaceBits(cfg2, Config2_TL_HI, Config2_TL_LO, p->coreParams.CP0_Config2_TL);
-    replaceBits(cfg2, Config2_TA_HI, Config2_TA_LO, p->coreParams.CP0_Config2_TA);
-    replaceBits(cfg2, Config2_SU_HI, Config2_SU_LO, p->coreParams.CP0_Config2_SU);
-    replaceBits(cfg2, Config2_SS_HI, Config2_SS_LO, p->coreParams.CP0_Config2_SS);
-    replaceBits(cfg2, Config2_SL_HI, Config2_SL_LO, p->coreParams.CP0_Config2_SL);
-    replaceBits(cfg2, Config2_SA_HI, Config2_SA_LO, p->coreParams.CP0_Config2_SA);
-    replaceBits(cfg2, Config2_M, p->coreParams.CP0_Config2_M);
+    replaceBits(cfg2, Config2_TU_HI, Config2_TU_LO, cp.CP0_Config2_TU);
+    replaceBits(cfg2, Config2_TS_HI, Config2_TS_LO, cp.CP0_Config2_TS);
+    replaceBits(cfg2, Config2_TL_HI, Config2_TL_LO, cp.CP0_Config2_TL);
+    replaceBits(cfg2, Config2_TA_HI, Config2_TA_LO, cp.CP0_Config2_TA);
+    replaceBits(cfg2, Config2_SU_HI, Config2_SU_LO, cp.CP0_Config2_SU);
+    replaceBits(cfg2, Config2_SS_HI, Config2_SS_LO, cp.CP0_Config2_SS);
+    replaceBits(cfg2, Config2_SL_HI, Config2_SL_LO, cp.CP0_Config2_SL);
+    replaceBits(cfg2, Config2_SA_HI, Config2_SA_LO, cp.CP0_Config2_SA);
+    replaceBits(cfg2, Config2_M, cp.CP0_Config2_M);
     setRegNoEffect(Config2, cfg2);
     // Now, create Write Mask for Config register
     MiscReg cfg2_Mask = 0x7000F000; // Read Only Register
@@ -248,14 +251,14 @@ MiscRegFile::reset(std::string core_name, unsigned num_threads,
 
     // Config3
     MiscReg cfg3 = readRegNoEffect(Config3);
-    replaceBits(cfg3, Config3_DSPP_HI, Config3_DSPP_LO, p->coreParams.CP0_Config3_DSPP);
-    replaceBits(cfg3, Config3_LPA_HI, Config3_LPA_LO, p->coreParams.CP0_Config3_LPA);
-    replaceBits(cfg3, Config3_VEIC_HI, Config3_VEIC_LO, p->coreParams.CP0_Config3_VEIC);
-    replaceBits(cfg3, Config3_VINT_HI, Config3_VINT_LO, p->coreParams.CP0_Config3_VInt);
-    replaceBits(cfg3, Config3_SP_HI, Config3_SP_LO, p->coreParams.CP0_Config3_SP);
-    replaceBits(cfg3, Config3_MT_HI, Config3_MT_LO, p->coreParams.CP0_Config3_MT);
-    replaceBits(cfg3, Config3_SM_HI, Config3_SM_LO, p->coreParams.CP0_Config3_SM);
-    replaceBits(cfg3, Config3_TL_HI, Config3_TL_LO, p->coreParams.CP0_Config3_TL);
+    replaceBits(cfg3, Config3_DSPP_HI, Config3_DSPP_LO, cp.CP0_Config3_DSPP);
+    replaceBits(cfg3, Config3_LPA_HI, Config3_LPA_LO, cp.CP0_Config3_LPA);
+    replaceBits(cfg3, Config3_VEIC_HI, Config3_VEIC_LO, cp.CP0_Config3_VEIC);
+    replaceBits(cfg3, Config3_VINT_HI, Config3_VINT_LO, cp.CP0_Config3_VInt);
+    replaceBits(cfg3, Config3_SP_HI, Config3_SP_LO, cp.CP0_Config3_SP);
+    replaceBits(cfg3, Config3_MT_HI, Config3_MT_LO, cp.CP0_Config3_MT);
+    replaceBits(cfg3, Config3_SM_HI, Config3_SM_LO, cp.CP0_Config3_SM);
+    replaceBits(cfg3, Config3_TL_HI, Config3_TL_LO, cp.CP0_Config3_TL);
     setRegNoEffect(Config3, cfg3);
     // Now, create Write Mask for Config register
     MiscReg cfg3_Mask = 0; // Read Only Register
@@ -264,7 +267,7 @@ MiscRegFile::reset(std::string core_name, unsigned num_threads,
 
     // EBase - CPUNum
     MiscReg EB = readRegNoEffect(EBase);
-    replaceBits(EB, EBase_CPUNum_HI, EBase_CPUNum_LO, p->coreParams.CP0_EBase_CPUNum);
+    replaceBits(EB, EBase_CPUNum_HI, EBase_CPUNum_LO, cp.CP0_EBase_CPUNum);
     replaceBits(EB, 31, 31, 1);
     setRegNoEffect(EBase, EB);
     // Now, create Write Mask for Config register
@@ -275,7 +278,7 @@ MiscRegFile::reset(std::string core_name, unsigned num_threads,
 
     // SRS Control - HSS (Highest Shadow Set)
     MiscReg SC = readRegNoEffect(SRSCtl);
-    replaceBits(SC, SRSCtl_HSS_HI,SRSCtl_HSS_LO,p->coreParams.CP0_SrsCtl_HSS);
+    replaceBits(SC, SRSCtl_HSS_HI,SRSCtl_HSS_LO,cp.CP0_SrsCtl_HSS);
     setRegNoEffect(SRSCtl, SC);
     // Now, create Write Mask for the SRS Ctl register
     MiscReg SC_Mask = 0x0000F3C0;
@@ -284,8 +287,8 @@ MiscRegFile::reset(std::string core_name, unsigned num_threads,
 
     // IntCtl - IPTI, IPPCI
     MiscReg IC = readRegNoEffect(IntCtl);
-    replaceBits(IC, IntCtl_IPTI_HI,IntCtl_IPTI_LO,p->coreParams.CP0_IntCtl_IPTI);
-    replaceBits(IC, IntCtl_IPPCI_HI,IntCtl_IPPCI_LO,p->coreParams.CP0_IntCtl_IPPCI);
+    replaceBits(IC, IntCtl_IPTI_HI,IntCtl_IPTI_LO,cp.CP0_IntCtl_IPTI);
+    replaceBits(IC, IntCtl_IPPCI_HI,IntCtl_IPPCI_LO,cp.CP0_IntCtl_IPPCI);
     setRegNoEffect(IntCtl, IC);
     // Now, create Write Mask for the IntCtl register
     MiscReg IC_Mask = 0x000003E0;
@@ -294,7 +297,7 @@ MiscRegFile::reset(std::string core_name, unsigned num_threads,
 
     // Watch Hi - M - FIXME (More than 1 Watch register)
     MiscReg WHi = readRegNoEffect(WatchHi0);
-    replaceBits(WHi, WatchHi_M, p->coreParams.CP0_WatchHi_M);
+    replaceBits(WHi, WatchHi_M, cp.CP0_WatchHi_M);
     setRegNoEffect(WatchHi0, WHi);
     // Now, create Write Mask for the IntCtl register
     MiscReg wh_Mask = 0x7FFF0FFF;
@@ -303,8 +306,8 @@ MiscRegFile::reset(std::string core_name, unsigned num_threads,
 
     // Perf Ctr - M - FIXME (More than 1 PerfCnt Pair)
     MiscReg PCtr = readRegNoEffect(PerfCnt0);
-    replaceBits(PCtr, PerfCntCtl_M, p->coreParams.CP0_PerfCtr_M);
-    replaceBits(PCtr, PerfCntCtl_W, p->coreParams.CP0_PerfCtr_W);
+    replaceBits(PCtr, PerfCntCtl_M, cp.CP0_PerfCtr_M);
+    replaceBits(PCtr, PerfCntCtl_W, cp.CP0_PerfCtr_W);
     setRegNoEffect(PerfCnt0, PCtr);
     // Now, create Write Mask for the IntCtl register
     MiscReg pc_Mask = 0x00007FF;
@@ -322,7 +325,7 @@ MiscRegFile::reset(std::string core_name, unsigned num_threads,
 
     // PageGrain
     MiscReg pagegrain = readRegNoEffect(PageGrain);
-    replaceBits(pagegrain,PageGrain_ESP,p->coreParams.CP0_Config3_SP);
+    replaceBits(pagegrain,PageGrain_ESP,cp.CP0_Config3_SP);
     setRegNoEffect(PageGrain, pagegrain);
     // Now, create Write Mask for the IntCtl register
     MiscReg pg_Mask = 0x10000000;
index c2a86511341d29d37a0f39f300be0e737fc8242b..1e3f0dbbc2df16c1f4fc4fd9cf79b4eeb3215037 100644 (file)
@@ -26,7 +26,7 @@
 #
 # Authors: Nathan Binkert
 
-from m5.SimObject import SimObject
+from MemObject import MemObject
 from m5.params import *
 from m5.proxy import *
 from m5 import build_env
@@ -48,14 +48,21 @@ elif build_env['TARGET_ISA'] == 'mips':
 elif build_env['TARGET_ISA'] == 'arm':
     from ArmTLB import ArmTLB, ArmDTB, ArmITB, ArmUTB
 
-class BaseCPU(SimObject):
+class BaseCPU(MemObject):
     type = 'BaseCPU'
     abstract = True
 
     system = Param.System(Parent.any, "system object")
     cpu_id = Param.Int("CPU identifier")
+    numThreads = Param.Unsigned(1, "number of HW thread contexts")
+
+    function_trace = Param.Bool(False, "Enable function trace")
+    function_trace_start = Param.Tick(0, "Cycle to start function trace")
+
+    checker = Param.BaseCPU("checker CPU")
 
     if build_env['FULL_SYSTEM']:
+        profile = Param.Latency('0ns', "trace the kernel stack")
         do_quiesce = Param.Bool(True, "enable quiesce instructions")
         do_checkpoint_insts = Param.Bool(True,
             "enable checkpoint pseudo instructions")
diff --git a/src/cpu/CheckerCPU.py b/src/cpu/CheckerCPU.py
new file mode 100644 (file)
index 0000000..06df9c1
--- /dev/null
@@ -0,0 +1,44 @@
+# Copyright (c) 2007 The Regents of The University of Michigan
+# 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.
+#
+# Authors: Nathan Binkert
+
+from m5.params import *
+from m5 import build_env
+from BaseCPU import BaseCPU
+
+class CheckerCPU(BaseCPU):
+    type = 'CheckerCPU'
+    abstract = True
+    exitOnError = Param.Bool(False, "Exit on an error")
+    updateOnError = Param.Bool(False,
+        "Update the checker with the main CPU's state on an error")
+    warnOnlyOnLoadError = Param.Bool(False,
+        "If a load result is incorrect, only print a warning and do not exit")
+    function_trace = Param.Bool(False, "Enable function trace")
+    function_trace_start = Param.Tick(0, "Cycle to start function trace")
+    if build_env['FULL_SYSTEM']:
+        profile = Param.Latency('0ns', "trace the kernel stack")
index c6a959d9d01a8405cc9fb6097156ceaf1c2e3172..750e1ee4c46e8e3978ba390c1066767d64caa00b 100644 (file)
@@ -71,6 +71,7 @@ temp_cpu_list = env['CPU_MODELS'][:]
 
 if env['USE_CHECKER']:
     temp_cpu_list.append('CheckerCPU')
+    SimObject('CheckerCPU.py')
 
 # Generate header.
 def gen_cpu_exec_signatures(target, source, env):
index 6ce08299658e4c096acc2be1f5d9315bad14a74a..f79b79350ab5f143ef52ff571daca3c2e50ec7be 100644 (file)
 #include "base/loader/symtab.hh"
 #include "base/misc.hh"
 #include "base/output.hh"
+#include "base/trace.hh"
 #include "cpu/base.hh"
 #include "cpu/cpuevent.hh"
 #include "cpu/thread_context.hh"
 #include "cpu/profile.hh"
+#include "params/BaseCPU.hh"
 #include "sim/sim_exit.hh"
 #include "sim/process.hh"
 #include "sim/sim_events.hh"
 #include "sim/system.hh"
 
-#include "base/trace.hh"
-
 // Hack
 #include "sim/stat_control.hh"
 
@@ -95,13 +95,13 @@ CPUProgressEvent::description() const
 
 #if FULL_SYSTEM
 BaseCPU::BaseCPU(Params *p)
-    : MemObject(makeParams(p->name)), clock(p->clock), instCnt(0),
-      params(p), number_of_threads(p->numberOfThreads), system(p->system),
+    : MemObject(p), clock(p->clock), instCnt(0),
+      number_of_threads(p->numThreads), system(p->system),
       phase(p->phase)
 #else
 BaseCPU::BaseCPU(Params *p)
-    : MemObject(makeParams(p->name)), clock(p->clock), params(p),
-      number_of_threads(p->numberOfThreads), system(p->system),
+    : MemObject(p), clock(p->clock),
+      number_of_threads(p->numThreads), system(p->system),
       phase(p->phase)
 #endif
 {
@@ -166,34 +166,25 @@ BaseCPU::BaseCPU(Params *p)
     }
 
     functionTracingEnabled = false;
-    if (p->functionTrace) {
+    if (p->function_trace) {
         functionTraceStream = simout.find(csprintf("ftrace.%s", name()));
         currentFunctionStart = currentFunctionEnd = 0;
-        functionEntryTick = p->functionTraceStart;
+        functionEntryTick = p->function_trace_start;
 
-        if (p->functionTraceStart == 0) {
+        if (p->function_trace_start == 0) {
             functionTracingEnabled = true;
         } else {
-            new EventWrapper<BaseCPU, &BaseCPU::enableFunctionTrace>(this,
-                                                                     p->functionTraceStart,
-                                                                     true);
+            new EventWrapper<BaseCPU,
+                &BaseCPU::enableFunctionTrace>(
+                this, p->function_trace_start, true);
         }
     }
 #if FULL_SYSTEM
     profileEvent = NULL;
-    if (params->profile)
-        profileEvent = new ProfileEvent(this, params->profile);
-#endif
-    tracer = params->tracer;
-}
-
-BaseCPU::Params::Params()
-{
-#if FULL_SYSTEM
-    profile = false;
+    if (params()->profile)
+        profileEvent = new ProfileEvent(this, params()->profile);
 #endif
-    checker = NULL;
-    tracer = NULL;
+    tracer = params()->tracer;
 }
 
 void
@@ -209,7 +200,7 @@ BaseCPU::~BaseCPU()
 void
 BaseCPU::init()
 {
-    if (!params->deferRegistration)
+    if (!params()->defer_registration)
         registerThreadContexts();
 }
 
@@ -217,13 +208,13 @@ void
 BaseCPU::startup()
 {
 #if FULL_SYSTEM
-    if (!params->deferRegistration && profileEvent)
+    if (!params()->defer_registration && profileEvent)
         profileEvent->schedule(curTick);
 #endif
 
-    if (params->progress_interval) {
+    if (params()->progress_interval) {
         new CPUProgressEvent(&mainEventQueue,
-                             ticks(params->progress_interval),
+                             ticks(params()->progress_interval),
                              this);
     }
 }
@@ -281,7 +272,7 @@ BaseCPU::registerThreadContexts()
         ThreadContext *tc = threadContexts[i];
 
 #if FULL_SYSTEM
-        int id = params->cpu_id;
+        int id = params()->cpu_id;
         if (id != -1)
             id += i;
 
index bdc7d7c8b4e6d5ff2560280ad3a1f2198e7c71e8..6e9e1dc39acefff096850406c285830f87721321 100644 (file)
@@ -45,6 +45,7 @@
 #include "arch/interrupts.hh"
 #endif
 
+class BaseCPUParams;
 class BranchPred;
 class CheckerCPU;
 class ThreadContext;
@@ -162,40 +163,9 @@ class BaseCPU : public MemObject
    ThreadContext *getContext(int tn) { return threadContexts[tn]; }
 
   public:
-    struct Params
-    {
-        std::string name;
-        int numberOfThreads;
-        bool deferRegistration;
-        Counter max_insts_any_thread;
-        Counter max_insts_all_threads;
-        Counter max_loads_any_thread;
-        Counter max_loads_all_threads;
-        Tick clock;
-        bool functionTrace;
-        Tick functionTraceStart;
-        System *system;
-        int cpu_id;
-        Trace::InstTracer * tracer;
-
-        Tick phase;
-#if FULL_SYSTEM
-        Tick profile;
-
-        bool do_statistics_insts;
-        bool do_checkpoint_insts;
-        bool do_quiesce;
-#endif
-        Tick progress_interval;
-        BaseCPU *checker;
-
-        TheISA::CoreSpecific coreParams; //ISA-Specific Params That Set Up State in Core
-
-        Params();
-    };
-
-    const Params *params;
-
+    typedef BaseCPUParams Params;
+    const Params *params() const
+    { return reinterpret_cast<const Params *>(_params); }
     BaseCPU(Params *params);
     virtual ~BaseCPU();
 
@@ -221,6 +191,8 @@ class BaseCPU : public MemObject
      */
     int number_of_threads;
 
+    TheISA::CoreSpecific coreParams; //ISA-Specific Params That Set Up State in Core
+
     /**
      * Vector of per-thread instruction-based event queues.  Used for
      * scheduling events based on number of instructions committed by
index 35dc59ff4badc04b7b1ce766ee30542486fdef4d..17648d508400012fb7844998e4b86bad65d5748f 100644 (file)
@@ -65,6 +65,7 @@ class Process;
 #endif // FULL_SYSTEM
 template <class>
 class BaseDynInst;
+class CheckerCPUParams;
 class ThreadContext;
 class MemInterface;
 class Checkpoint;
@@ -96,20 +97,10 @@ class CheckerCPU : public BaseCPU
   public:
     virtual void init();
 
-    struct Params : public BaseCPU::Params
-    {
-#if FULL_SYSTEM
-        TheISA::ITB *itb;
-        TheISA::DTB *dtb;
-#else
-        Process *process;
-#endif
-        bool exitOnError;
-        bool updateOnError;
-        bool warnOnlyOnLoadError;
-    };
-
   public:
+    typedef CheckerCPUParams Params;
+    const Params *params() const
+    { return reinterpret_cast<const Params *>(_params); }    
     CheckerCPU(Params *p);
     virtual ~CheckerCPU();
 
index f0284b2cff3d76b5dc726bf083a2a121ce6d2bb7..56e537ad2f6671e66ff9593c6851dbf38b8c7e70 100644 (file)
@@ -38,10 +38,7 @@ if build_env['USE_CHECKER']:
 class DerivO3CPU(BaseCPU):
     type = 'DerivO3CPU'
     activity = Param.Unsigned(0, "Initial count")
-    numThreads = Param.Unsigned(1, "number of HW thread contexts")
 
-    if build_env['FULL_SYSTEM']:
-        profile = Param.Latency('0ns', "trace the kernel stack")
     if build_env['USE_CHECKER']:
         if not build_env['FULL_SYSTEM']:
             checker = Param.BaseCPU(O3Checker(workload=Parent.workload,
@@ -134,9 +131,6 @@ class DerivO3CPU(BaseCPU):
 
     instShiftAmt = Param.Unsigned(2, "Number of bits to shift instructions by")
 
-    function_trace = Param.Bool(False, "Enable function trace")
-    function_trace_start = Param.Tick(0, "Cycle to start function trace")
-
     smtNumFetchingThreads = Param.Unsigned(1, "SMT Number of Fetching Threads")
     smtFetchPolicy = Param.String('SingleThread', "SMT Fetch policy")
     smtLSQPolicy    = Param.String('Partitioned', "SMT LSQ Sharing Policy")
index ebc4e7b23f435a80276a546c6228ba3cdb28d9bb..f9f0000d4e91e2d4ae8b704fdf13227e0ea676b8 100644 (file)
@@ -37,6 +37,7 @@
 #include "cpu/o3/cpu.hh"
 #include "sim/byteswap.hh"
 
+class DerivO3CPUParams;
 class EndQuiesceEvent;
 namespace Kernel {
     class Statistics;
@@ -58,10 +59,9 @@ class AlphaO3CPU : public FullO3CPU<Impl>
   public:
     typedef O3ThreadState<Impl> ImplState;
     typedef O3ThreadState<Impl> Thread;
-    typedef typename Impl::Params Params;
 
     /** Constructs an AlphaO3CPU with the given parameters. */
-    AlphaO3CPU(Params *params);
+    AlphaO3CPU(DerivO3CPUParams *params);
 
     /** Registers statistics. */
     void regStats();
index f569c048b6f043c2257267c635ca2e0aed601e4e..0ff0d5d52e1f31e4aae1f90dfeb9ea30244233d0 100644 (file)
 #include "cpu/base.hh"
 #include "cpu/o3/alpha/cpu.hh"
 #include "cpu/o3/alpha/impl.hh"
-#include "cpu/o3/alpha/params.hh"
 #include "cpu/o3/fu_pool.hh"
 #include "params/DerivO3CPU.hh"
 
 class DerivO3CPU : public AlphaO3CPU<AlphaSimpleImpl>
 {
   public:
-    DerivO3CPU(AlphaSimpleParams *p)
+    DerivO3CPU(DerivO3CPUParams *p)
         : AlphaO3CPU<AlphaSimpleImpl>(p)
     { }
 };
@@ -49,8 +48,6 @@ class DerivO3CPU : public AlphaO3CPU<AlphaSimpleImpl>
 DerivO3CPU *
 DerivO3CPUParams::create()
 {
-    DerivO3CPU *cpu;
-
 #if FULL_SYSTEM
     // Full-system only supports a single thread for the moment.
     int actual_num_threads = 1;
@@ -65,135 +62,18 @@ DerivO3CPUParams::create()
     }
 #endif
 
-    AlphaSimpleParams *params = new AlphaSimpleParams;
-
-    params->clock = clock;
-    params->phase = phase;
-
-    params->tracer = tracer;
-
-    params->name = name;
-    params->numberOfThreads = actual_num_threads;
-    params->cpu_id = cpu_id;
-    params->activity = activity;
-
-    params->itb = itb;
-    params->dtb = dtb;
-
-    params->system = system;
-#if FULL_SYSTEM
-    params->profile = profile;
-
-    params->do_quiesce = do_quiesce;
-    params->do_checkpoint_insts = do_checkpoint_insts;
-    params->do_statistics_insts = do_statistics_insts;
-#else
-    params->workload = workload;
-#endif // FULL_SYSTEM
-
-#if USE_CHECKER
-    params->checker = checker;
-#endif
-
-    params->max_insts_any_thread = max_insts_any_thread;
-    params->max_insts_all_threads = max_insts_all_threads;
-    params->max_loads_any_thread = max_loads_any_thread;
-    params->max_loads_all_threads = max_loads_all_threads;
-    params->progress_interval = progress_interval;
-
-    //
-    // Caches
-    //
-    params->cachePorts = cachePorts;
-
-    params->decodeToFetchDelay = decodeToFetchDelay;
-    params->renameToFetchDelay = renameToFetchDelay;
-    params->iewToFetchDelay = iewToFetchDelay;
-    params->commitToFetchDelay = commitToFetchDelay;
-    params->fetchWidth = fetchWidth;
-
-    params->renameToDecodeDelay = renameToDecodeDelay;
-    params->iewToDecodeDelay = iewToDecodeDelay;
-    params->commitToDecodeDelay = commitToDecodeDelay;
-    params->fetchToDecodeDelay = fetchToDecodeDelay;
-    params->decodeWidth = decodeWidth;
-
-    params->iewToRenameDelay = iewToRenameDelay;
-    params->commitToRenameDelay = commitToRenameDelay;
-    params->decodeToRenameDelay = decodeToRenameDelay;
-    params->renameWidth = renameWidth;
-
-    params->commitToIEWDelay = commitToIEWDelay;
-    params->renameToIEWDelay = renameToIEWDelay;
-    params->issueToExecuteDelay = issueToExecuteDelay;
-    params->dispatchWidth = dispatchWidth;
-    params->issueWidth = issueWidth;
-    params->wbWidth = wbWidth;
-    params->wbDepth = wbDepth;
-    params->fuPool = fuPool;
-
-    params->iewToCommitDelay = iewToCommitDelay;
-    params->renameToROBDelay = renameToROBDelay;
-    params->commitWidth = commitWidth;
-    params->squashWidth = squashWidth;
-    params->trapLatency = trapLatency;
-
-    params->backComSize = backComSize;
-    params->forwardComSize = forwardComSize;
-
-    params->predType = predType;
-    params->localPredictorSize = localPredictorSize;
-    params->localCtrBits = localCtrBits;
-    params->localHistoryTableSize = localHistoryTableSize;
-    params->localHistoryBits = localHistoryBits;
-    params->globalPredictorSize = globalPredictorSize;
-    params->globalCtrBits = globalCtrBits;
-    params->globalHistoryBits = globalHistoryBits;
-    params->choicePredictorSize = choicePredictorSize;
-    params->choiceCtrBits = choiceCtrBits;
-
-    params->BTBEntries = BTBEntries;
-    params->BTBTagSize = BTBTagSize;
-
-    params->RASSize = RASSize;
-
-    params->LQEntries = LQEntries;
-    params->SQEntries = SQEntries;
-
-    params->SSITSize = SSITSize;
-    params->LFSTSize = LFSTSize;
-
-    params->numPhysIntRegs = numPhysIntRegs;
-    params->numPhysFloatRegs = numPhysFloatRegs;
-    params->numIQEntries = numIQEntries;
-    params->numROBEntries = numROBEntries;
-
-    params->smtNumFetchingThreads = smtNumFetchingThreads;
+    numThreads = actual_num_threads;
 
     // Default smtFetchPolicy to "RoundRobin", if necessary.
     std::string round_robin_policy = "RoundRobin";
     std::string single_thread = "SingleThread";
 
     if (actual_num_threads > 1 && single_thread.compare(smtFetchPolicy) == 0)
-        params->smtFetchPolicy = round_robin_policy;
+        smtFetchPolicy = round_robin_policy;
     else
-        params->smtFetchPolicy = smtFetchPolicy;
-
-    params->smtIQPolicy    = smtIQPolicy;
-    params->smtLSQPolicy    = smtLSQPolicy;
-    params->smtLSQThreshold = smtLSQThreshold;
-    params->smtROBPolicy   = smtROBPolicy;
-    params->smtROBThreshold = smtROBThreshold;
-    params->smtCommitPolicy = smtCommitPolicy;
-
-    params->instShiftAmt = 2;
-
-    params->deferRegistration = defer_registration;
-
-    params->functionTrace = function_trace;
-    params->functionTraceStart = function_trace_start;
+        smtFetchPolicy = smtFetchPolicy;
 
-    cpu = new DerivO3CPU(params);
+    instShiftAmt = 2;
 
-    return cpu;
+    return new DerivO3CPU(this);
 }
index 7f8f0547b0c0631643bd9365181e23c9483f52e0..dc64113e1190a949b21aeee100537177545bd50c 100644 (file)
@@ -40,7 +40,6 @@
 #include "sim/stats.hh"
 
 #include "cpu/o3/alpha/cpu.hh"
-#include "cpu/o3/alpha/params.hh"
 #include "cpu/o3/alpha/thread_context.hh"
 #include "cpu/o3/comm.hh"
 #include "cpu/o3/thread_state.hh"
 #include "sim/system.hh"
 #endif
 
+#include "params/DerivO3CPU.hh"
+
 template <class Impl>
-AlphaO3CPU<Impl>::AlphaO3CPU(Params *params) : FullO3CPU<Impl>(this, params)
+AlphaO3CPU<Impl>::AlphaO3CPU(DerivO3CPUParams *params) :
+    FullO3CPU<Impl>(this, params)
 {
     DPRINTF(O3CPU, "Creating AlphaO3CPU object.\n");
 
index b928ae654e5cd0d7cf084f7b9f85f20af7840a25..d2d04292cfe3efed3ddf450df47b466cecd5ea15 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "arch/alpha/isa_traits.hh"
 
-#include "cpu/o3/alpha/params.hh"
 #include "cpu/o3/cpu_policy.hh"
 
 
@@ -77,9 +76,6 @@ struct AlphaSimpleImpl
      */
     typedef O3CPU CPUType;
 
-    /** The Params to be passed to each stage. */
-    typedef AlphaSimpleParams Params;
-
     enum {
       MaxWidth = 8,
       MaxThreads = 4
diff --git a/src/cpu/o3/alpha/params.hh b/src/cpu/o3/alpha/params.hh
deleted file mode 100644 (file)
index 164c253..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2004-2006 The Regents of The University of Michigan
- * 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.
- *
- * Authors: Kevin Lim
- */
-
-#ifndef __CPU_O3_ALPHA_PARAMS_HH__
-#define __CPU_O3_ALPHA_PARAMS_HH__
-
-#include "cpu/o3/cpu.hh"
-#include "cpu/o3/params.hh"
-
-//Forward declarations
-namespace AlphaISA
-{
-    class DTB;
-    class ITB;
-}
-class MemObject;
-class Process;
-class System;
-
-/**
- * This file defines the parameters that will be used for the AlphaO3CPU.
- * This must be defined externally so that the Impl can have a params class
- * defined that it can pass to all of the individual stages.
- */
-
-class AlphaSimpleParams : public O3Params
-{
-  public:
-
-    AlphaISA::ITB *itb;
-    AlphaISA::DTB *dtb;
-};
-
-#endif // __CPU_O3_ALPHA_PARAMS_HH__
index 3c4c8e4789f379b25ec0f2f84a5c879ec37bbec5..34fe7417833576525e0821e7ef9a70f412db2e12 100644 (file)
@@ -43,6 +43,8 @@
 
 #include <list>
 
+class DerivO3CPUParams;
+
 /**
  * Basically a wrapper class to hold both the branch predictor
  * and the BTB.
@@ -51,7 +53,6 @@ template<class Impl>
 class BPredUnit
 {
   private:
-    typedef typename Impl::Params Params;
     typedef typename Impl::DynInstPtr DynInstPtr;
 
     enum PredType {
@@ -66,7 +67,7 @@ class BPredUnit
     /**
      * @param params The params object, that has the size of the BP and BTB.
      */
-    BPredUnit(Params *params);
+    BPredUnit(DerivO3CPUParams *params);
 
     /**
      * Registers statistics.
index 84c50b4dacfa40a99d107e67c0ff635e5ed69bb9..ded72a1b5944c6120b0a18dc665e66984c12dad1 100644 (file)
 #include "base/traceflags.hh"
 #include "cpu/o3/bpred_unit.hh"
 
+#include "params/DerivO3CPU.hh"
+
 template<class Impl>
-BPredUnit<Impl>::BPredUnit(Params *params)
+BPredUnit<Impl>::BPredUnit(DerivO3CPUParams *params)
   : BTB(params->BTBEntries,
         params->BTBTagSize,
         params->instShiftAmt)
index 80e42fa8b977ccfe1b6400c33c32d42acf2f4d07..ff1e517f22476392d2fdde1426c660ca25f919fa 100644 (file)
@@ -37,6 +37,8 @@
 #include "cpu/exetrace.hh"
 #include "cpu/inst_seq.hh"
 
+class DerivO3CPUParams;
+
 template <class>
 class O3ThreadState;
 
@@ -69,7 +71,6 @@ class DefaultCommit
     // Typedefs from the Impl.
     typedef typename Impl::O3CPU O3CPU;
     typedef typename Impl::DynInstPtr DynInstPtr;
-    typedef typename Impl::Params Params;
     typedef typename Impl::CPUPol CPUPol;
 
     typedef typename CPUPol::RenameMap RenameMap;
@@ -136,7 +137,7 @@ class DefaultCommit
 
   public:
     /** Construct a DefaultCommit with the given parameters. */
-    DefaultCommit(O3CPU *_cpu, Params *params);
+    DefaultCommit(O3CPU *_cpu, DerivO3CPUParams *params);
 
     /** Returns the name of the DefaultCommit. */
     std::string name() const;
index ee0f2bb59131e191174273cb84b84239ef538eef..86b4da8ceb48097b74a5edd4443000f0c455ed16 100644 (file)
@@ -46,6 +46,8 @@
 #include "cpu/checker/cpu.hh"
 #endif
 
+#include "params/DerivO3CPU.hh"
+
 template <class Impl>
 DefaultCommit<Impl>::TrapEvent::TrapEvent(DefaultCommit<Impl> *_commit,
                                           unsigned _tid)
@@ -71,7 +73,7 @@ DefaultCommit<Impl>::TrapEvent::description() const
 }
 
 template <class Impl>
-DefaultCommit<Impl>::DefaultCommit(O3CPU *_cpu, Params *params)
+DefaultCommit<Impl>::DefaultCommit(O3CPU *_cpu, DerivO3CPUParams *params)
     : cpu(_cpu),
       squashCounter(0),
       iewToCommitDelay(params->iewToCommitDelay),
@@ -80,7 +82,7 @@ DefaultCommit<Impl>::DefaultCommit(O3CPU *_cpu, Params *params)
       fetchToCommitDelay(params->commitToFetchDelay),
       renameWidth(params->renameWidth),
       commitWidth(params->commitWidth),
-      numThreads(params->numberOfThreads),
+      numThreads(params->numThreads),
       drainPending(false),
       switchedOut(false),
       trapLatency(params->trapLatency)
index fac214174e6e53a64bff8b0355eb9f144436ff94..f06aee63468fbba4f3d7f9fa3753973cc8560d41 100644 (file)
 #include "cpu/checker/cpu.hh"
 #endif
 
+class BaseCPUParams;
+
 using namespace TheISA;
 
-BaseO3CPU::BaseO3CPU(Params *params)
+BaseO3CPU::BaseO3CPU(BaseCPUParams *params)
     : BaseCPU(params), cpu_id(0)
 {
 }
@@ -147,7 +149,7 @@ FullO3CPU<Impl>::DeallocateContextEvent::description() const
 }
 
 template <class Impl>
-FullO3CPU<Impl>::FullO3CPU(O3CPU *o3_cpu, Params *params)
+FullO3CPU<Impl>::FullO3CPU(O3CPU *o3_cpu, DerivO3CPUParams *params)
     : BaseO3CPU(params),
       itb(params->itb),
       dtb(params->dtb),
@@ -162,16 +164,16 @@ FullO3CPU<Impl>::FullO3CPU(O3CPU *o3_cpu, Params *params)
       regFile(o3_cpu, params->numPhysIntRegs,
               params->numPhysFloatRegs),
 
-      freeList(params->numberOfThreads,
+      freeList(params->numThreads,
                TheISA::NumIntRegs, params->numPhysIntRegs,
                TheISA::NumFloatRegs, params->numPhysFloatRegs),
 
       rob(o3_cpu,
           params->numROBEntries, params->squashWidth,
           params->smtROBPolicy, params->smtROBThreshold,
-          params->numberOfThreads),
+          params->numThreads),
 
-      scoreboard(params->numberOfThreads,
+      scoreboard(params->numThreads,
                  TheISA::NumIntRegs, params->numPhysIntRegs,
                  TheISA::NumFloatRegs, params->numPhysFloatRegs,
                  TheISA::NumMiscRegs * number_of_threads,
@@ -192,7 +194,7 @@ FullO3CPU<Impl>::FullO3CPU(O3CPU *o3_cpu, Params *params)
       physmem(system->physmem),
 #endif // FULL_SYSTEM
       drainCount(0),
-      deferRegistration(params->deferRegistration),
+      deferRegistration(params->defer_registration),
       numThreads(number_of_threads)
 {
     if (!deferRegistration) {
index 61d7dcf22f6b4aff7948c67ef5c5ee80a2cca221..611d03bad89fef7510537a056be3876e6f7518fa 100644 (file)
@@ -53,6 +53,8 @@
 //#include "cpu/o3/thread_context.hh"
 #include "sim/process.hh"
 
+#include "params/DerivO3CPU.hh"
+
 template <class>
 class Checker;
 class ThreadContext;
@@ -63,13 +65,13 @@ class Checkpoint;
 class MemObject;
 class Process;
 
+class BaseCPUParams;
+
 class BaseO3CPU : public BaseCPU
 {
     //Stuff that's pretty ISA independent will go here.
   public:
-    typedef BaseCPU::Params Params;
-
-    BaseO3CPU(Params *params);
+    BaseO3CPU(BaseCPUParams *params);
 
     void regStats();
 
@@ -96,7 +98,6 @@ class FullO3CPU : public BaseO3CPU
     typedef typename Impl::CPUPol CPUPolicy;
     typedef typename Impl::DynInstPtr DynInstPtr;
     typedef typename Impl::O3CPU O3CPU;
-    typedef typename Impl::Params Params;
 
     typedef O3ThreadState<Impl> Thread;
 
@@ -256,7 +257,7 @@ class FullO3CPU : public BaseO3CPU
 
   public:
     /** Constructs a CPU with the given parameters. */
-    FullO3CPU(O3CPU *o3_cpu, Params *params);
+    FullO3CPU(O3CPU *o3_cpu, DerivO3CPUParams *params);
     /** Destructor. */
     ~FullO3CPU();
 
index 3e82033cafe7744c81ab92fab321c2a71b5c9f5f..dc8063f2994b3d38eeb80af7626b1a23f2ad5a49 100644 (file)
@@ -36,6 +36,8 @@
 #include "base/statistics.hh"
 #include "base/timebuf.hh"
 
+class DerivO3CPUParams;
+
 /**
  * DefaultDecode class handles both single threaded and SMT
  * decode. Its width is specified by the parameters; each cycles it
@@ -50,7 +52,6 @@ class DefaultDecode
     // Typedefs from the Impl.
     typedef typename Impl::O3CPU O3CPU;
     typedef typename Impl::DynInstPtr DynInstPtr;
-    typedef typename Impl::Params Params;
     typedef typename Impl::CPUPol CPUPol;
 
     // Typedefs from the CPU policy.
@@ -86,7 +87,7 @@ class DefaultDecode
 
   public:
     /** DefaultDecode constructor. */
-    DefaultDecode(O3CPU *_cpu, Params *params);
+    DefaultDecode(O3CPU *_cpu, DerivO3CPUParams *params);
 
     /** Returns the name of decode. */
     std::string name() const;
index ce67384565bbbba5db7aef7503d45c0ef64e4107..015bc8d7f4173fa3389c5ea135af2a1b09b76f9c 100644 (file)
 
 #include "cpu/o3/decode.hh"
 
+#include "params/DerivO3CPU.hh"
+
 template<class Impl>
-DefaultDecode<Impl>::DefaultDecode(O3CPU *_cpu, Params *params)
+DefaultDecode<Impl>::DefaultDecode(O3CPU *_cpu, DerivO3CPUParams *params)
     : cpu(_cpu),
       renameToDecodeDelay(params->renameToDecodeDelay),
       iewToDecodeDelay(params->iewToDecodeDelay),
       commitToDecodeDelay(params->commitToDecodeDelay),
       fetchToDecodeDelay(params->fetchToDecodeDelay),
       decodeWidth(params->decodeWidth),
-      numThreads(params->numberOfThreads)
+      numThreads(params->numThreads)
 {
     _status = Inactive;
 
index d954bd1e7ac133607d4f250f88ddb13d10722e3e..f12228ff9afcedf748559e1e7329e08b78e103b3 100644 (file)
@@ -41,6 +41,8 @@
 #include "mem/port.hh"
 #include "sim/eventq.hh"
 
+class DerivO3CPUParams;
+
 /**
  * DefaultFetch class handles both single threaded and SMT fetch. Its
  * width is specified by the parameters; each cycle it tries to fetch
@@ -58,7 +60,6 @@ class DefaultFetch
     typedef typename Impl::DynInst DynInst;
     typedef typename Impl::DynInstPtr DynInstPtr;
     typedef typename Impl::O3CPU O3CPU;
-    typedef typename Impl::Params Params;
 
     /** Typedefs from the CPU policy. */
     typedef typename CPUPol::BPredUnit BPredUnit;
@@ -160,7 +161,7 @@ class DefaultFetch
 
   public:
     /** DefaultFetch constructor. */
-    DefaultFetch(O3CPU *_cpu, Params *params);
+    DefaultFetch(O3CPU *_cpu, DerivO3CPUParams *params);
 
     /** Returns the name of fetch. */
     std::string name() const;
index 7d344fa33208d58d60eeeb14d007f5ec1e8bb425..0b5ce93805b5b1f1b5a17505f6533c882b4a9ccd 100644 (file)
@@ -51,6 +51,8 @@
 #include "sim/system.hh"
 #endif // FULL_SYSTEM
 
+#include "params/DerivO3CPU.hh"
+
 template<class Impl>
 void
 DefaultFetch<Impl>::IcachePort::setPeer(Port *port)
@@ -111,7 +113,7 @@ DefaultFetch<Impl>::IcachePort::recvRetry()
 }
 
 template<class Impl>
-DefaultFetch<Impl>::DefaultFetch(O3CPU *_cpu, Params *params)
+DefaultFetch<Impl>::DefaultFetch(O3CPU *_cpu, DerivO3CPUParams *params)
     : cpu(_cpu),
       branchPred(params),
       predecoder(NULL),
@@ -123,7 +125,7 @@ DefaultFetch<Impl>::DefaultFetch(O3CPU *_cpu, Params *params)
       cacheBlocked(false),
       retryPkt(NULL),
       retryTid(-1),
-      numThreads(params->numberOfThreads),
+      numThreads(params->numThreads),
       numFetchingThreads(params->smtNumFetchingThreads),
       interruptPending(false),
       drainPending(false),
index 457e2a024bbe237b3938d4dce71f12db9ed3828e..3caf847ed8df877f6aa2a558a0a3ba17068c8ec8 100644 (file)
@@ -41,6 +41,7 @@
 #include "cpu/o3/scoreboard.hh"
 #include "cpu/o3/lsq.hh"
 
+class DerivO3CPUParams;
 class FUPool;
 
 /**
@@ -70,7 +71,6 @@ class DefaultIEW
     typedef typename Impl::CPUPol CPUPol;
     typedef typename Impl::DynInstPtr DynInstPtr;
     typedef typename Impl::O3CPU O3CPU;
-    typedef typename Impl::Params Params;
 
     typedef typename CPUPol::IQ IQ;
     typedef typename CPUPol::RenameMap RenameMap;
@@ -115,7 +115,7 @@ class DefaultIEW
 
   public:
     /** Constructs a DefaultIEW with the given parameters. */
-    DefaultIEW(O3CPU *_cpu, Params *params);
+    DefaultIEW(O3CPU *_cpu, DerivO3CPUParams *params);
 
     /** Returns the name of the DefaultIEW stage. */
     std::string name() const;
index 84d10e966019137fff8382375179d1428198107e..1daecd669081b738f4697ce821a7da43c9d75b44 100644 (file)
 #include "base/timebuf.hh"
 #include "cpu/o3/fu_pool.hh"
 #include "cpu/o3/iew.hh"
+#include "params/DerivO3CPU.hh"
 
 template<class Impl>
-DefaultIEW<Impl>::DefaultIEW(O3CPU *_cpu, Params *params)
+DefaultIEW<Impl>::DefaultIEW(O3CPU *_cpu, DerivO3CPUParams *params)
     : issueToExecQueue(params->backComSize, params->forwardComSize),
       cpu(_cpu),
       instQueue(_cpu, this, params),
@@ -52,7 +53,7 @@ DefaultIEW<Impl>::DefaultIEW(O3CPU *_cpu, Params *params)
       issueWidth(params->issueWidth),
       wbOutstanding(0),
       wbWidth(params->wbWidth),
-      numThreads(params->numberOfThreads),
+      numThreads(params->numThreads),
       switchedOut(false)
 {
     _status = Active;
index d0f503977c4b67d941fc2e00e06d63603925033e..43da1565d14e510b328f6768026cea53769c97f4 100644 (file)
 #include "cpu/inst_seq.hh"
 #include "cpu/o3/dep_graph.hh"
 #include "cpu/op_class.hh"
+#include "sim/eventq.hh"
 #include "sim/host.hh"
 
+class DerivO3CPUParams;
 class FUPool;
 class MemInterface;
 
@@ -70,7 +72,6 @@ class InstructionQueue
     //Typedefs from the Impl.
     typedef typename Impl::O3CPU O3CPU;
     typedef typename Impl::DynInstPtr DynInstPtr;
-    typedef typename Impl::Params Params;
 
     typedef typename Impl::CPUPol::IEW IEW;
     typedef typename Impl::CPUPol::MemDepUnit MemDepUnit;
@@ -110,7 +111,7 @@ class InstructionQueue
     };
 
     /** Constructs an IQ. */
-    InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr, Params *params);
+    InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params);
 
     /** Destructs the IQ. */
     ~InstructionQueue();
index fb06f20df735ab4f2e3c887e07ccc68e95c0d4c4..f3ce770fa440a43c25483f31f423ccc6ffa7d274 100644 (file)
@@ -37,6 +37,8 @@
 #include "enums/OpClass.hh"
 #include "sim/core.hh"
 
+#include "params/DerivO3CPU.hh"
+
 template <class Impl>
 InstructionQueue<Impl>::FUCompletion::FUCompletion(DynInstPtr &_inst,
                                                    int fu_idx,
@@ -65,7 +67,7 @@ InstructionQueue<Impl>::FUCompletion::description() const
 
 template <class Impl>
 InstructionQueue<Impl>::InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr,
-                                         Params *params)
+                                         DerivO3CPUParams *params)
     : cpu(cpu_ptr),
       iewStage(iew_ptr),
       fuPool(params->fuPool),
@@ -79,7 +81,7 @@ InstructionQueue<Impl>::InstructionQueue(O3CPU *cpu_ptr, IEW *iew_ptr,
 
     switchedOut = false;
 
-    numThreads = params->numberOfThreads;
+    numThreads = params->numThreads;
 
     // Set the number of physical registers as the number of int + float
     numPhysRegs = numPhysIntRegs + numPhysFloatRegs;
index 72a8d402146fa8b00cf4820d37a312024fb0f725..9e74f4c8c722e2bbec09bdaf10c25915d14a03d6 100755 (executable)
 #if THE_ISA == ALPHA_ISA
     #include "cpu/o3/alpha/cpu.hh"
     #include "cpu/o3/alpha/impl.hh"
-    #include "cpu/o3/alpha/params.hh"
     #include "cpu/o3/alpha/dyn_inst.hh"
 #elif THE_ISA == MIPS_ISA
     #include "cpu/o3/mips/cpu.hh"
     #include "cpu/o3/mips/impl.hh"
-    #include "cpu/o3/mips/params.hh"
     #include "cpu/o3/mips/dyn_inst.hh"
 #elif THE_ISA == SPARC_ISA
     #include "cpu/o3/sparc/cpu.hh"
     #include "cpu/o3/sparc/impl.hh"
-    #include "cpu/o3/sparc/params.hh"
     #include "cpu/o3/sparc/dyn_inst.hh"
 #else
     #error "ISA-specific header files O3CPU not defined ISA"
index 06de608e0b4e54afb61c9af75d8a886fbd415cc8..44b69ab4008d441077db5ac96a0f0dfe64f137b5 100644 (file)
 #include "mem/port.hh"
 #include "sim/sim_object.hh"
 
+class DerivO3CPUParams;
+
 template <class Impl>
 class LSQ {
   public:
-    typedef typename Impl::Params Params;
     typedef typename Impl::O3CPU O3CPU;
     typedef typename Impl::DynInstPtr DynInstPtr;
     typedef typename Impl::CPUPol::IEW IEW;
@@ -57,7 +58,7 @@ class LSQ {
     };
 
     /** Constructs an LSQ with the given parameters. */
-    LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, Params *params);
+    LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params);
 
     /** Returns the name of the LSQ. */
     std::string name() const;
index 8ed6f7f54766d20bbcee155afa821940389d4560..f8e77b64ebf10cc6f4fece8783cb005f81061417 100644 (file)
@@ -34,6 +34,8 @@
 
 #include "cpu/o3/lsq.hh"
 
+#include "params/DerivO3CPU.hh"
+
 template<class Impl>
 void
 LSQ<Impl>::DcachePort::setPeer(Port *port)
@@ -111,11 +113,11 @@ LSQ<Impl>::DcachePort::recvRetry()
 }
 
 template <class Impl>
-LSQ<Impl>::LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, Params *params)
+LSQ<Impl>::LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params)
     : cpu(cpu_ptr), iewStage(iew_ptr), dcachePort(this),
       LQEntries(params->LQEntries),
       SQEntries(params->SQEntries),
-      numThreads(params->numberOfThreads),
+      numThreads(params->numThreads),
       retryTid(-1)
 {
     dcachePort.snoopRangeSent = false;
index 3ae69723dc75050809cbde9edba66b7faa0273f9..a82ba3ad504264269fda3bfe2311715984ec6713 100644 (file)
@@ -46,6 +46,8 @@
 #include "mem/packet.hh"
 #include "mem/port.hh"
 
+class DerivO3CPUParams;
+
 /**
  * Class that implements the actual LQ and SQ for each specific
  * thread.  Both are circular queues; load entries are freed upon
@@ -63,7 +65,6 @@ class LSQUnit {
   protected:
     typedef TheISA::IntReg IntReg;
   public:
-    typedef typename Impl::Params Params;
     typedef typename Impl::O3CPU O3CPU;
     typedef typename Impl::DynInstPtr DynInstPtr;
     typedef typename Impl::CPUPol::IEW IEW;
@@ -75,8 +76,9 @@ class LSQUnit {
     LSQUnit();
 
     /** Initializes the LSQ unit with the specified number of entries. */
-    void init(O3CPU *cpu_ptr, IEW *iew_ptr, Params *params, LSQ *lsq_ptr,
-              unsigned maxLQEntries, unsigned maxSQEntries, unsigned id);
+    void init(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params,
+            LSQ *lsq_ptr, unsigned maxLQEntries, unsigned maxSQEntries,
+            unsigned id);
 
     /** Returns the name of the LSQ unit. */
     std::string name() const;
index e6ff5e93145f66f977eaef74a62ea4e7ecc60082..4b8d693a6c8c48a8a513fb98602f351ee0957312 100644 (file)
@@ -112,8 +112,9 @@ LSQUnit<Impl>::LSQUnit()
 
 template<class Impl>
 void
-LSQUnit<Impl>::init(O3CPU *cpu_ptr, IEW *iew_ptr, Params *params, LSQ *lsq_ptr,
-                    unsigned maxLQEntries, unsigned maxSQEntries, unsigned id)
+LSQUnit<Impl>::init(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params,
+        LSQ *lsq_ptr, unsigned maxLQEntries, unsigned maxSQEntries,
+        unsigned id)
 {
     cpu = cpu_ptr;
     iewStage = iew_ptr;
index a12a3001bbd5e2713c389d9f8d9d139211a9e40c..4f66b459951801e31d8d12940e6dad5122712607 100644 (file)
@@ -48,6 +48,8 @@ struct SNHash {
     }
 };
 
+class DerivO3CPUParams;
+
 template <class Impl>
 class InstructionQueue;
 
@@ -65,14 +67,13 @@ class InstructionQueue;
 template <class MemDepPred, class Impl>
 class MemDepUnit {
   public:
-    typedef typename Impl::Params Params;
     typedef typename Impl::DynInstPtr DynInstPtr;
 
     /** Empty constructor. Must call init() prior to using in this case. */
     MemDepUnit();
 
     /** Constructs a MemDepUnit with given parameters. */
-    MemDepUnit(Params *params);
+    MemDepUnit(DerivO3CPUParams *params);
 
     /** Frees up any memory allocated. */
     ~MemDepUnit();
@@ -81,7 +82,7 @@ class MemDepUnit {
     std::string name() const;
 
     /** Initializes the unit with parameters and a thread id. */
-    void init(Params *params, int tid);
+    void init(DerivO3CPUParams *params, int tid);
 
     /** Registers statistics. */
     void regStats();
index 64558efaa309a8a8f56844a8fdd0661412b367e5..124c087f8450230eeaf0a42a18f42fd4dcd10890 100644 (file)
@@ -33,6 +33,8 @@
 #include "cpu/o3/inst_queue.hh"
 #include "cpu/o3/mem_dep_unit.hh"
 
+#include "params/DerivO3CPU.hh"
+
 template <class MemDepPred, class Impl>
 MemDepUnit<MemDepPred, Impl>::MemDepUnit()
     : loadBarrier(false), loadBarrierSN(0), storeBarrier(false),
@@ -41,7 +43,7 @@ MemDepUnit<MemDepPred, Impl>::MemDepUnit()
 }
 
 template <class MemDepPred, class Impl>
-MemDepUnit<MemDepPred, Impl>::MemDepUnit(Params *params)
+MemDepUnit<MemDepPred, Impl>::MemDepUnit(DerivO3CPUParams *params)
     : depPred(params->SSITSize, params->LFSTSize), loadBarrier(false),
       loadBarrierSN(0), storeBarrier(false), storeBarrierSN(0), iqPtr(NULL)
 {
@@ -82,7 +84,7 @@ MemDepUnit<MemDepPred, Impl>::name() const
 
 template <class MemDepPred, class Impl>
 void
-MemDepUnit<MemDepPred, Impl>::init(Params *params, int tid)
+MemDepUnit<MemDepPred, Impl>::init(DerivO3CPUParams *params, int tid)
 {
     DPRINTF(MemDepUnit, "Creating MemDepUnit %i object.\n",tid);
 
index 3724ced46601aabc1087dac247c20dbc6b19ce8e..38eba5aebb75adb42b4d1d3aa7976a52f25cd6ce 100755 (executable)
@@ -39,6 +39,7 @@
 #include "sim/byteswap.hh"
 #include "sim/faults.hh"
 
+class DerivO3CPUParams;
 class EndQuiesceEvent;
 namespace Kernel {
     class Statistics;
@@ -60,10 +61,9 @@ class MipsO3CPU : public FullO3CPU<Impl>
   public:
     typedef O3ThreadState<Impl> ImplState;
     typedef O3ThreadState<Impl> Thread;
-    typedef typename Impl::Params Params;
 
     /** Constructs an MipsO3CPU with the given parameters. */
-    MipsO3CPU(Params *params);
+    MipsO3CPU(DerivO3CPUParams *params);
 
     /** Registers statistics. */
     void regStats();
index 4690b980433e4d099675d57f8cf5c38b13e2e979..8fe34afab7393f953fd084f1a91690e8df40dbf6 100644 (file)
 #include "cpu/base.hh"
 #include "cpu/o3/mips/cpu.hh"
 #include "cpu/o3/mips/impl.hh"
-#include "cpu/o3/mips/params.hh"
 #include "cpu/o3/fu_pool.hh"
 #include "params/DerivO3CPU.hh"
 
 class DerivO3CPU : public MipsO3CPU<MipsSimpleImpl>
 {
   public:
-    DerivO3CPU(MipsSimpleParams *p)
+    DerivO3CPU(DerivO3CPUParams *p)
         : MipsO3CPU<MipsSimpleImpl>(p)
     { }
 };
@@ -50,8 +49,10 @@ class DerivO3CPU : public MipsO3CPU<MipsSimpleImpl>
 DerivO3CPU *
 DerivO3CPUParams::create()
 {
-    DerivO3CPU *cpu;
-
+#if FULL_SYSTEM
+    // Full-system only supports a single thread for the moment.
+    int actual_num_threads = 1;
+#else
     // In non-full-system mode, we infer the number of threads from
     // the workload if it's not explicitly specified.
     int actual_num_threads =
@@ -60,123 +61,20 @@ DerivO3CPUParams::create()
     if (workload.size() == 0) {
         fatal("Must specify at least one workload!");
     }
-
-    MipsSimpleParams *params = new MipsSimpleParams;
-
-    params->clock = clock;
-    params->phase = phase;
-
-    params->tracer = tracer;
-
-    params->name = name;
-    params->numberOfThreads = actual_num_threads;
-    params->cpu_id = cpu_id;
-    params->activity = activity;
-
-    params->workload = workload;
-
-#if USE_CHECKER
-    params->checker = checker;
 #endif
 
-    params->max_insts_any_thread = max_insts_any_thread;
-    params->max_insts_all_threads = max_insts_all_threads;
-    params->max_loads_any_thread = max_loads_any_thread;
-    params->max_loads_all_threads = max_loads_all_threads;
-
-    //
-    // Caches
-    //
-    params->cachePorts = cachePorts;
-
-    params->decodeToFetchDelay = decodeToFetchDelay;
-    params->renameToFetchDelay = renameToFetchDelay;
-    params->iewToFetchDelay = iewToFetchDelay;
-    params->commitToFetchDelay = commitToFetchDelay;
-    params->fetchWidth = fetchWidth;
-
-    params->renameToDecodeDelay = renameToDecodeDelay;
-    params->iewToDecodeDelay = iewToDecodeDelay;
-    params->commitToDecodeDelay = commitToDecodeDelay;
-    params->fetchToDecodeDelay = fetchToDecodeDelay;
-    params->decodeWidth = decodeWidth;
-
-    params->iewToRenameDelay = iewToRenameDelay;
-    params->commitToRenameDelay = commitToRenameDelay;
-    params->decodeToRenameDelay = decodeToRenameDelay;
-    params->renameWidth = renameWidth;
-
-    params->commitToIEWDelay = commitToIEWDelay;
-    params->renameToIEWDelay = renameToIEWDelay;
-    params->issueToExecuteDelay = issueToExecuteDelay;
-    params->dispatchWidth = dispatchWidth;
-    params->issueWidth = issueWidth;
-    params->wbWidth = wbWidth;
-    params->wbDepth = wbDepth;
-    params->fuPool = fuPool;
-
-    params->iewToCommitDelay = iewToCommitDelay;
-    params->renameToROBDelay = renameToROBDelay;
-    params->commitWidth = commitWidth;
-    params->squashWidth = squashWidth;
-    params->trapLatency = trapLatency;
-
-    params->backComSize = backComSize;
-    params->forwardComSize = forwardComSize;
-
-    params->predType = predType;
-    params->localPredictorSize = localPredictorSize;
-    params->localCtrBits = localCtrBits;
-    params->localHistoryTableSize = localHistoryTableSize;
-    params->localHistoryBits = localHistoryBits;
-    params->globalPredictorSize = globalPredictorSize;
-    params->globalCtrBits = globalCtrBits;
-    params->globalHistoryBits = globalHistoryBits;
-    params->choicePredictorSize = choicePredictorSize;
-    params->choiceCtrBits = choiceCtrBits;
-
-    params->BTBEntries = BTBEntries;
-    params->BTBTagSize = BTBTagSize;
-
-    params->RASSize = RASSize;
-
-    params->LQEntries = LQEntries;
-    params->SQEntries = SQEntries;
-
-    params->SSITSize = SSITSize;
-    params->LFSTSize = LFSTSize;
-
-    params->numPhysIntRegs = numPhysIntRegs;
-    params->numPhysFloatRegs = numPhysFloatRegs;
-    params->numIQEntries = numIQEntries;
-    params->numROBEntries = numROBEntries;
-
-    params->smtNumFetchingThreads = smtNumFetchingThreads;
+    numThreads = actual_num_threads;
 
     // Default smtFetchPolicy to "RoundRobin", if necessary.
     std::string round_robin_policy = "RoundRobin";
     std::string single_thread = "SingleThread";
 
     if (actual_num_threads > 1 && single_thread.compare(smtFetchPolicy) == 0)
-        params->smtFetchPolicy = round_robin_policy;
+        smtFetchPolicy = round_robin_policy;
     else
-        params->smtFetchPolicy = smtFetchPolicy;
-
-    params->smtIQPolicy    = smtIQPolicy;
-    params->smtLSQPolicy    = smtLSQPolicy;
-    params->smtLSQThreshold = smtLSQThreshold;
-    params->smtROBPolicy   = smtROBPolicy;
-    params->smtROBThreshold = smtROBThreshold;
-    params->smtCommitPolicy = smtCommitPolicy;
-
-    params->instShiftAmt = 2;
-
-    params->deferRegistration = defer_registration;
-
-    params->functionTrace = function_trace;
-    params->functionTraceStart = function_trace_start;
+        smtFetchPolicy = smtFetchPolicy;
 
-    cpu = new DerivO3CPU(params);
+    instShiftAmt = 2;
 
-    return cpu;
+    return new DerivO3CPU(this);
 }
index 09d73b4a2d60381756f32a1a87141cae213804cb..70dbb4ac4b5dd389dd269134dc59b1ede3ad9d9f 100644 (file)
 #include "sim/stats.hh"
 
 #include "cpu/o3/mips/cpu.hh"
-#include "cpu/o3/mips/params.hh"
 #include "cpu/o3/mips/thread_context.hh"
 #include "cpu/o3/comm.hh"
 #include "cpu/o3/thread_state.hh"
 
+#include "params/DerivO3CPU.hh"
+
 template <class Impl>
-MipsO3CPU<Impl>::MipsO3CPU(Params *params)
+MipsO3CPU<Impl>::MipsO3CPU(DerivO3CPUParams *params)
     : FullO3CPU<Impl>(this, params)
 {
     DPRINTF(O3CPU, "Creating MipsO3CPU object.\n");
index ac7181a1991d7e7df8390d1760f39439a2b6bcdf..481184006fe906d1893a1e185c386814036762c7 100644 (file)
@@ -34,7 +34,6 @@
 
 #include "arch/mips/isa_traits.hh"
 
-#include "cpu/o3/mips/params.hh"
 #include "cpu/o3/cpu_policy.hh"
 
 
@@ -78,9 +77,6 @@ struct MipsSimpleImpl
      */
     typedef O3CPU CPUType;
 
-    /** The Params to be passed to each stage. */
-    typedef MipsSimpleParams Params;
-
     enum {
       MaxWidth = 8,
       MaxThreads = 4
diff --git a/src/cpu/o3/mips/params.hh b/src/cpu/o3/mips/params.hh
deleted file mode 100644 (file)
index 2688d3f..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2006 The Regents of The University of Michigan
- * 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.
- *
- * Authors: Kevin Lim
- *          Korey Sewell
- */
-
-#ifndef __CPU_O3_MIPS_PARAMS_HH__
-#define __CPU_O3_MIPS_PARAMS_HH__
-
-#include "cpu/o3/cpu.hh"
-#include "cpu/o3/params.hh"
-
-//Forward declarations
-namespace MipsISA
-{
-    class MipsDTB;
-    class MipsITB;
-}
-class MemObject;
-class Process;
-class System;
-
-/**
- * This file defines the parameters that will be used for the MipsO3CPU.
- * This must be defined externally so that the Impl can have a params class
- * defined that it can pass to all of the individual stages.
- */
-
-class MipsSimpleParams : public O3Params
-{
-  public:
-    MipsSimpleParams() {}
-
-    //Full System Paramater Objects place here
-    MipsISA::ITB *itb;
-    MipsISA::DTB *dtb;
-};
-
-#endif // __CPU_O3_MIPS_PARAMS_HH__
diff --git a/src/cpu/o3/params.hh b/src/cpu/o3/params.hh
deleted file mode 100755 (executable)
index b487778..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 2004-2006 The Regents of The University of Michigan
- * 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.
- *
- * Authors: Kevin Lim
- */
-
-#ifndef __CPU_O3_PARAMS_HH__
-#define __CPU_O3_PARAMS_HH__
-
-#include "cpu/o3/cpu.hh"
-
-//Forward declarations
-class FUPool;
-
-/**
- * This file defines the parameters that will be used for the O3CPU.
- * This must be defined externally so that the Impl can have a params class
- * defined that it can pass to all of the individual stages.
- */
-class O3Params : public BaseO3CPU::Params
-{
-  public:
-    unsigned activity;
-
-    //
-    // Pointers to key objects
-    //
-#if !FULL_SYSTEM
-    std::vector<Process *> workload;
-    Process *process;
-#endif // FULL_SYSTEM
-
-    BaseCPU *checker;
-
-    //
-    // Caches
-    //
-    //    MemInterface *icacheInterface;
-    //    MemInterface *dcacheInterface;
-
-    unsigned cachePorts;
-
-    //
-    // Fetch
-    //
-    unsigned decodeToFetchDelay;
-    unsigned renameToFetchDelay;
-    unsigned iewToFetchDelay;
-    unsigned commitToFetchDelay;
-    unsigned fetchWidth;
-
-    //
-    // Decode
-    //
-    unsigned renameToDecodeDelay;
-    unsigned iewToDecodeDelay;
-    unsigned commitToDecodeDelay;
-    unsigned fetchToDecodeDelay;
-    unsigned decodeWidth;
-
-    //
-    // Rename
-    //
-    unsigned iewToRenameDelay;
-    unsigned commitToRenameDelay;
-    unsigned decodeToRenameDelay;
-    unsigned renameWidth;
-
-    //
-    // IEW
-    //
-    unsigned commitToIEWDelay;
-    unsigned renameToIEWDelay;
-    unsigned issueToExecuteDelay;
-    unsigned dispatchWidth;
-    unsigned issueWidth;
-    unsigned wbWidth;
-    unsigned wbDepth;
-    FUPool *fuPool;
-
-    //
-    // Commit
-    //
-    unsigned iewToCommitDelay;
-    unsigned renameToROBDelay;
-    unsigned commitWidth;
-    unsigned squashWidth;
-    Tick trapLatency;
-    Tick fetchTrapLatency;
-
-    //
-    // Timebuffer sizes
-    //
-    unsigned backComSize;
-    unsigned forwardComSize;
-
-    //
-    // Branch predictor (BP, BTB, RAS)
-    //
-    std::string predType;
-    unsigned localPredictorSize;
-    unsigned localCtrBits;
-    unsigned localHistoryTableSize;
-    unsigned localHistoryBits;
-    unsigned globalPredictorSize;
-    unsigned globalCtrBits;
-    unsigned globalHistoryBits;
-    unsigned choicePredictorSize;
-    unsigned choiceCtrBits;
-
-    unsigned BTBEntries;
-    unsigned BTBTagSize;
-
-    unsigned RASSize;
-
-    //
-    // Load store queue
-    //
-    unsigned LQEntries;
-    unsigned SQEntries;
-
-    //
-    // Memory dependence
-    //
-    unsigned SSITSize;
-    unsigned LFSTSize;
-
-    //
-    // Miscellaneous
-    //
-    unsigned numPhysIntRegs;
-    unsigned numPhysFloatRegs;
-    unsigned numIQEntries;
-    unsigned numROBEntries;
-
-    //SMT Parameters
-    unsigned smtNumFetchingThreads;
-
-    std::string   smtFetchPolicy;
-
-    std::string   smtIQPolicy;
-    unsigned smtIQThreshold;
-
-    std::string   smtLSQPolicy;
-    unsigned smtLSQThreshold;
-
-    std::string   smtCommitPolicy;
-
-    std::string   smtROBPolicy;
-    unsigned smtROBThreshold;
-
-    // Probably can get this from somewhere.
-    unsigned instShiftAmt;
-};
-
-#endif // __CPU_O3_ALPHA_PARAMS_HH__
index 75d3fa6eb63502aaaae5078be65578d083ba98e0..8bd867136607f89499c41f8ab8fb92aab5c5c55e 100644 (file)
@@ -33,6 +33,7 @@
 #define __CPU_O3_REGFILE_HH__
 
 #include "arch/isa_traits.hh"
+#include "arch/regfile.hh"
 #include "arch/types.hh"
 #include "base/trace.hh"
 #include "config/full_system.hh"
index b2faffe43c6a6dff3cb855e45626f83e73ae1952..c9e0d418dee36880eb646b2680c2a7644c045d8b 100644 (file)
@@ -36,6 +36,8 @@
 #include "base/statistics.hh"
 #include "base/timebuf.hh"
 
+class DerivO3CPUParams;
+
 /**
  * DefaultRename handles both single threaded and SMT rename. Its
  * width is specified by the parameters; each cycle it tries to rename
@@ -56,7 +58,6 @@ class DefaultRename
     typedef typename Impl::CPUPol CPUPol;
     typedef typename Impl::DynInstPtr DynInstPtr;
     typedef typename Impl::O3CPU O3CPU;
-    typedef typename Impl::Params Params;
 
     // Typedefs from the CPUPol
     typedef typename CPUPol::DecodeStruct DecodeStruct;
@@ -107,7 +108,7 @@ class DefaultRename
 
   public:
     /** DefaultRename constructor. */
-    DefaultRename(O3CPU *_cpu, Params *params);
+    DefaultRename(O3CPU *_cpu, DerivO3CPUParams *params);
 
     /** Returns the name of rename. */
     std::string name() const;
index 49c8857530902132423a0ce7805d342046a4ccb0..81647b133926e2a91eb390acc2afdcb6fdb0c791 100644 (file)
 #include "arch/regfile.hh"
 #include "config/full_system.hh"
 #include "cpu/o3/rename.hh"
+#include "params/DerivO3CPU.hh"
 
 template <class Impl>
-DefaultRename<Impl>::DefaultRename(O3CPU *_cpu, Params *params)
+DefaultRename<Impl>::DefaultRename(O3CPU *_cpu, DerivO3CPUParams *params)
     : cpu(_cpu),
       iewToRenameDelay(params->iewToRenameDelay),
       decodeToRenameDelay(params->decodeToRenameDelay),
@@ -46,7 +47,7 @@ DefaultRename<Impl>::DefaultRename(O3CPU *_cpu, Params *params)
       commitWidth(params->commitWidth),
       resumeSerialize(false),
       resumeUnblocking(false),
-      numThreads(params->numberOfThreads),
+      numThreads(params->numThreads),
       maxPhysicalRegs(params->numPhysIntRegs + params->numPhysFloatRegs)
 {
     _status = Inactive;
index 3fd193e0f28698b95438ad5f0f76dfe1302dccb1..cccfd7d52892be36f25d1cbf592a1d35f00db12f 100644 (file)
@@ -37,6 +37,7 @@
 #include "cpu/o3/cpu.hh"
 #include "sim/byteswap.hh"
 
+class DerivO3CPUParams;
 class EndQuiesceEvent;
 namespace Kernel {
     class Statistics;
@@ -58,10 +59,9 @@ class SparcO3CPU : public FullO3CPU<Impl>
   public:
     typedef O3ThreadState<Impl> ImplState;
     typedef O3ThreadState<Impl> Thread;
-    typedef typename Impl::Params Params;
 
     /** Constructs an AlphaO3CPU with the given parameters. */
-    SparcO3CPU(Params *params);
+    SparcO3CPU(DerivO3CPUParams *params);
 
     /** Registers statistics. */
     void regStats();
index b08845b4e8f873a5dfd4b525c89e823dd26f579e..c5ea31210ac2a9003eebfff49ea5df1c291e685c 100644 (file)
 #include "cpu/base.hh"
 #include "cpu/o3/sparc/cpu.hh"
 #include "cpu/o3/sparc/impl.hh"
-#include "cpu/o3/sparc/params.hh"
 #include "cpu/o3/fu_pool.hh"
 #include "params/DerivO3CPU.hh"
 
 class DerivO3CPU : public SparcO3CPU<SparcSimpleImpl>
 {
   public:
-    DerivO3CPU(SparcSimpleParams *p)
+    DerivO3CPU(DerivO3CPUParams *p)
         : SparcO3CPU<SparcSimpleImpl>(p)
     { }
 };
@@ -50,8 +49,6 @@ class DerivO3CPU : public SparcO3CPU<SparcSimpleImpl>
 DerivO3CPU *
 DerivO3CPUParams::create()
 {
-    DerivO3CPU *cpu;
-
 #if FULL_SYSTEM
     // Full-system only supports a single thread for the moment.
     int actual_num_threads = 1;
@@ -66,135 +63,18 @@ DerivO3CPUParams::create()
     }
 #endif
 
-    SparcSimpleParams *params = new SparcSimpleParams;
-
-    params->clock = clock;
-    params->phase = phase;
-
-    params->tracer = tracer;
-
-    params->name = name;
-    params->numberOfThreads = actual_num_threads;
-    params->cpu_id = cpu_id;
-    params->activity = activity;
-
-    params->itb = itb;
-    params->dtb = dtb;
-
-    params->system = system;
-#if FULL_SYSTEM
-    params->profile = profile;
-
-    params->do_quiesce = do_quiesce;
-    params->do_checkpoint_insts = do_checkpoint_insts;
-    params->do_statistics_insts = do_statistics_insts;
-#else
-    params->workload = workload;
-#endif // FULL_SYSTEM
-
-#if USE_CHECKER
-    params->checker = checker;
-#endif
-
-    params->max_insts_any_thread = max_insts_any_thread;
-    params->max_insts_all_threads = max_insts_all_threads;
-    params->max_loads_any_thread = max_loads_any_thread;
-    params->max_loads_all_threads = max_loads_all_threads;
-    params->progress_interval = progress_interval;
-
-    //
-    // Caches
-    //
-    params->cachePorts = cachePorts;
-
-    params->decodeToFetchDelay = decodeToFetchDelay;
-    params->renameToFetchDelay = renameToFetchDelay;
-    params->iewToFetchDelay = iewToFetchDelay;
-    params->commitToFetchDelay = commitToFetchDelay;
-    params->fetchWidth = fetchWidth;
-
-    params->renameToDecodeDelay = renameToDecodeDelay;
-    params->iewToDecodeDelay = iewToDecodeDelay;
-    params->commitToDecodeDelay = commitToDecodeDelay;
-    params->fetchToDecodeDelay = fetchToDecodeDelay;
-    params->decodeWidth = decodeWidth;
-
-    params->iewToRenameDelay = iewToRenameDelay;
-    params->commitToRenameDelay = commitToRenameDelay;
-    params->decodeToRenameDelay = decodeToRenameDelay;
-    params->renameWidth = renameWidth;
-
-    params->commitToIEWDelay = commitToIEWDelay;
-    params->renameToIEWDelay = renameToIEWDelay;
-    params->issueToExecuteDelay = issueToExecuteDelay;
-    params->dispatchWidth = dispatchWidth;
-    params->issueWidth = issueWidth;
-    params->wbWidth = wbWidth;
-    params->wbDepth = wbDepth;
-    params->fuPool = fuPool;
-
-    params->iewToCommitDelay = iewToCommitDelay;
-    params->renameToROBDelay = renameToROBDelay;
-    params->commitWidth = commitWidth;
-    params->squashWidth = squashWidth;
-    params->trapLatency = trapLatency;
-
-    params->backComSize = backComSize;
-    params->forwardComSize = forwardComSize;
-
-    params->predType = predType;
-    params->localPredictorSize = localPredictorSize;
-    params->localCtrBits = localCtrBits;
-    params->localHistoryTableSize = localHistoryTableSize;
-    params->localHistoryBits = localHistoryBits;
-    params->globalPredictorSize = globalPredictorSize;
-    params->globalCtrBits = globalCtrBits;
-    params->globalHistoryBits = globalHistoryBits;
-    params->choicePredictorSize = choicePredictorSize;
-    params->choiceCtrBits = choiceCtrBits;
-
-    params->BTBEntries = BTBEntries;
-    params->BTBTagSize = BTBTagSize;
-
-    params->RASSize = RASSize;
-
-    params->LQEntries = LQEntries;
-    params->SQEntries = SQEntries;
-
-    params->SSITSize = SSITSize;
-    params->LFSTSize = LFSTSize;
-
-    params->numPhysIntRegs = numPhysIntRegs;
-    params->numPhysFloatRegs = numPhysFloatRegs;
-    params->numIQEntries = numIQEntries;
-    params->numROBEntries = numROBEntries;
-
-    params->smtNumFetchingThreads = smtNumFetchingThreads;
+    numThreads = actual_num_threads;
 
     // Default smtFetchPolicy to "RoundRobin", if necessary.
     std::string round_robin_policy = "RoundRobin";
     std::string single_thread = "SingleThread";
 
     if (actual_num_threads > 1 && single_thread.compare(smtFetchPolicy) == 0)
-        params->smtFetchPolicy = round_robin_policy;
+        smtFetchPolicy = round_robin_policy;
     else
-        params->smtFetchPolicy = smtFetchPolicy;
-
-    params->smtIQPolicy    = smtIQPolicy;
-    params->smtLSQPolicy    = smtLSQPolicy;
-    params->smtLSQThreshold = smtLSQThreshold;
-    params->smtROBPolicy   = smtROBPolicy;
-    params->smtROBThreshold = smtROBThreshold;
-    params->smtCommitPolicy = smtCommitPolicy;
-
-    params->instShiftAmt = 2;
-
-    params->deferRegistration = defer_registration;
-
-    params->functionTrace = function_trace;
-    params->functionTraceStart = function_trace_start;
+        smtFetchPolicy = smtFetchPolicy;
 
-    cpu = new DerivO3CPU(params);
+    instShiftAmt = 2;
 
-    return cpu;
+    return new DerivO3CPU(this);
 }
index 068057fc0dca2cd985d64b6f401e78248c050b6e..2dd38845f9e46029844ba692216b5b485408403c 100644 (file)
@@ -41,7 +41,6 @@
 #include "sim/stats.hh"
 
 #include "cpu/o3/sparc/cpu.hh"
-#include "cpu/o3/sparc/params.hh"
 #include "cpu/o3/sparc/thread_context.hh"
 #include "cpu/o3/comm.hh"
 #include "cpu/o3/thread_state.hh"
 #include "sim/system.hh"
 #endif
 
+#include "params/DerivO3CPU.hh"
+
 template <class Impl>
-SparcO3CPU<Impl>::SparcO3CPU(Params *params) : FullO3CPU<Impl>(this, params)
+SparcO3CPU<Impl>::SparcO3CPU(DerivO3CPUParams *params) :
+    FullO3CPU<Impl>(this, params)
 {
     DPRINTF(O3CPU, "Creating SparcO3CPU object.\n");
 
index 0a970c2f0c4cd0f6e749335d60c63d3a777490c3..982fe36ccd95495b1de6bf75e47bb0b87df10868 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "arch/sparc/isa_traits.hh"
 
-#include "cpu/o3/sparc/params.hh"
 #include "cpu/o3/cpu_policy.hh"
 
 
@@ -77,9 +76,6 @@ struct SparcSimpleImpl
      */
     typedef O3CPU CPUType;
 
-    /** The Params to be passed to each stage. */
-    typedef SparcSimpleParams Params;
-
     enum {
       MaxWidth = 8,
       MaxThreads = 4
diff --git a/src/cpu/o3/sparc/params.hh b/src/cpu/o3/sparc/params.hh
deleted file mode 100644 (file)
index 09f5238..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2004-2006 The Regents of The University of Michigan
- * 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.
- *
- * Authors: Gabe Black
- */
-
-#ifndef __CPU_O3_SPARC_PARAMS_HH__
-#define __CPU_O3_SPARC_PARAMS_HH__
-
-#include "cpu/o3/cpu.hh"
-#include "cpu/o3/params.hh"
-
-//Forward declarations
-namespace SparcISA
-{
-    class DTB;
-    class ITB;
-}
-class MemObject;
-class Process;
-class System;
-
-/**
- * This file defines the parameters that will be used for the AlphaO3CPU.
- * This must be defined externally so that the Impl can have a params class
- * defined that it can pass to all of the individual stages.
- */
-
-class SparcSimpleParams : public O3Params
-{
-  public:
-
-    SparcISA::ITB *itb;
-    SparcISA::DTB *dtb;
-};
-
-#endif // __CPU_O3_SPARC_PARAMS_HH__
index d8720b3ab90a9f69d694daa374c862dfc7b85757..8c634f67ecb5e19e42c68cc80c8ace9c990a3f78 100644 (file)
@@ -80,8 +80,8 @@ struct O3ThreadState : public ThreadState {
         : ThreadState(_cpu, -1, _thread_num),
           cpu(_cpu), inSyscall(0), trapPending(0)
     {
-        if (cpu->params->profile) {
-            profile = new FunctionProfile(cpu->params->system->kernelSymtab);
+        if (cpu->params()->profile) {
+            profile = new FunctionProfile(cpu->params()->system->kernelSymtab);
             Callback *cb =
                 new MakeCallback<O3ThreadState,
                 &O3ThreadState::dumpFuncProfile>(this);
index a0b3584392b67515e3012ab7ead395360a4636d2..e1c1e4cd1e46889896b3665b324720e018bffd11 100644 (file)
@@ -28,9 +28,9 @@
 
 from m5.params import *
 from m5 import build_env
-from BaseCPU import BaseCPU
+from BaseSimpleCPU import BaseSimpleCPU
 
-class AtomicSimpleCPU(BaseCPU):
+class AtomicSimpleCPU(BaseSimpleCPU):
     type = 'AtomicSimpleCPU'
     width = Param.Int(1, "CPU width")
     simulate_data_stalls = Param.Bool(False, "Simulate dcache stall cycles")
@@ -42,5 +42,5 @@ class AtomicSimpleCPU(BaseCPU):
     icache_port = Port("Instruction Port")
     dcache_port = Port("Data Port")
     physmem_port = Port("Physical Memory Port")
-    _mem_ports = BaseCPU._mem_ports + \
+    _mem_ports = BaseSimpleCPU._mem_ports + \
                     ['icache_port', 'dcache_port', 'physmem_port']
diff --git a/src/cpu/simple/BaseSimpleCPU.py b/src/cpu/simple/BaseSimpleCPU.py
new file mode 100644 (file)
index 0000000..9f528bc
--- /dev/null
@@ -0,0 +1,34 @@
+# Copyright (c) 2008 The Hewlett-Packard Development Company
+# 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.
+#
+# Authors: Gabe Black
+
+from m5.params import *
+from BaseCPU import BaseCPU
+
+class BaseSimpleCPU(BaseCPU):
+    type = 'BaseSimpleCPU'
+    abstract = True
index c090a938c202edc03856f33929b87588e4f5b679..76598666f557f72118fd512f381b21f1a315c0af 100644 (file)
@@ -47,3 +47,4 @@ if 'AtomicSimpleCPU' in env['CPU_MODELS'] or \
 
 if need_simple_base:
     Source('base.cc')
+    SimObject('BaseSimpleCPU.py')
index 7e777e8138fe05ad1e0b5acf5b2a03c670552778..f2b14a175a0ddad963492d42cc8ce1e8179fee57 100644 (file)
@@ -28,9 +28,9 @@
 
 from m5.params import *
 from m5 import build_env
-from BaseCPU import BaseCPU
+from BaseSimpleCPU import BaseSimpleCPU
 
-class TimingSimpleCPU(BaseCPU):
+class TimingSimpleCPU(BaseSimpleCPU):
     type = 'TimingSimpleCPU'
     function_trace = Param.Bool(False, "Enable function trace")
     function_trace_start = Param.Tick(0, "Cycle to start function trace")
@@ -38,4 +38,4 @@ class TimingSimpleCPU(BaseCPU):
         profile = Param.Latency('0ns', "trace the kernel stack")
     icache_port = Port("Instruction Port")
     dcache_port = Port("Data Port")
-    _mem_ports = BaseCPU._mem_ports + ['icache_port', 'dcache_port']
+    _mem_ports = BaseSimpleCPU._mem_ports + ['icache_port', 'dcache_port']
index 0e04a36b25dc6974c3e32c648c49d46c24944b42..7ed1ee0c3d8fb8c2c3a1a88dc5791d4cd0f80bc9 100644 (file)
@@ -152,7 +152,7 @@ AtomicSimpleCPU::DcachePort::setPeer(Port *port)
 #endif
 }
 
-AtomicSimpleCPU::AtomicSimpleCPU(Params *p)
+AtomicSimpleCPU::AtomicSimpleCPU(AtomicSimpleCPUParams *p)
     : BaseSimpleCPU(p), tickEvent(this), width(p->width),
       simulate_data_stalls(p->simulate_data_stalls),
       simulate_inst_stalls(p->simulate_inst_stalls),
@@ -812,39 +812,10 @@ AtomicSimpleCPU::printAddr(Addr a)
 AtomicSimpleCPU *
 AtomicSimpleCPUParams::create()
 {
-    AtomicSimpleCPU::Params *params = new AtomicSimpleCPU::Params();
-    params->name = name;
-    params->numberOfThreads = 1;
-    params->max_insts_any_thread = max_insts_any_thread;
-    params->max_insts_all_threads = max_insts_all_threads;
-    params->max_loads_any_thread = max_loads_any_thread;
-    params->max_loads_all_threads = max_loads_all_threads;
-    params->progress_interval = progress_interval;
-    params->deferRegistration = defer_registration;
-    params->phase = phase;
-    params->clock = clock;
-    params->functionTrace = function_trace;
-    params->functionTraceStart = function_trace_start;
-    params->width = width;
-    params->simulate_data_stalls = simulate_data_stalls;
-    params->simulate_inst_stalls = simulate_inst_stalls;
-    params->system = system;
-    params->cpu_id = cpu_id;
-    params->tracer = tracer;
-
-    params->itb = itb;
-    params->dtb = dtb;
-#if FULL_SYSTEM
-    params->profile = profile;
-    params->do_quiesce = do_quiesce;
-    params->do_checkpoint_insts = do_checkpoint_insts;
-    params->do_statistics_insts = do_statistics_insts;
-#else
+    numThreads = 1;
+#if !FULL_SYSTEM
     if (workload.size() != 1)
         panic("only one workload allowed");
-    params->process = workload[0];
 #endif
-
-    AtomicSimpleCPU *cpu = new AtomicSimpleCPU(params);
-    return cpu;
+    return new AtomicSimpleCPU(this);
 }
index 0083975336a5e71328cade6143a84d9757dfd6a6..24400df22f38b3414d42dff6d3c26927c86c84e0 100644 (file)
 #define __CPU_SIMPLE_ATOMIC_HH__
 
 #include "cpu/simple/base.hh"
+#include "params/AtomicSimpleCPU.hh"
 
 class AtomicSimpleCPU : public BaseSimpleCPU
 {
   public:
 
-    struct Params : public BaseSimpleCPU::Params {
-        int width;
-        bool simulate_data_stalls;
-        bool simulate_inst_stalls;
-    };
-
-    AtomicSimpleCPU(Params *params);
+    AtomicSimpleCPU(AtomicSimpleCPUParams *params);
     virtual ~AtomicSimpleCPU();
 
     virtual void init();
index 0c11620321360490c3bf4692197fe50d4846ba7f..3fd699868b9f7113599c1c9d8546a9b0fdb5876b 100644 (file)
 #include "mem/mem_object.hh"
 #endif // FULL_SYSTEM
 
+#include "params/BaseSimpleCPU.hh"
+
 using namespace std;
 using namespace TheISA;
 
-BaseSimpleCPU::BaseSimpleCPU(Params *p)
+BaseSimpleCPU::BaseSimpleCPU(BaseSimpleCPUParams *p)
     : BaseCPU(p), traceData(NULL), thread(NULL), predecoder(NULL)
 {
 #if FULL_SYSTEM
     thread = new SimpleThread(this, 0, p->system, p->itb, p->dtb);
 #else
-    thread = new SimpleThread(this, /* thread_num */ 0, p->process,
+    thread = new SimpleThread(this, /* thread_num */ 0, p->workload[0],
             p->itb, p->dtb, /* asid */ 0);
 #endif // !FULL_SYSTEM
 
index 62bb31de86a4f5960471b3a31d5b288aed63cabf..aeae1a3d81e0913a58791657eaaf027eb0d48b6e 100644 (file)
@@ -76,6 +76,8 @@ namespace Trace {
     class InstRecord;
 }
 
+class BaseSimpleCPUParams;
+
 
 class BaseSimpleCPU : public BaseCPU
 {
@@ -107,15 +109,7 @@ class BaseSimpleCPU : public BaseCPU
     };
 
   public:
-    struct Params : public BaseCPU::Params
-    {
-        TheISA::ITB *itb;
-        TheISA::DTB *dtb;
-#if !FULL_SYSTEM
-        Process *process;
-#endif
-    };
-    BaseSimpleCPU(Params *params);
+    BaseSimpleCPU(BaseSimpleCPUParams *params);
     virtual ~BaseSimpleCPU();
 
   public:
index 4451dfe818c80ab4d2a9715e2673344cac379851..ac67341ff69ede2a6dabccb7813424ed8b2fa8ab 100644 (file)
@@ -104,7 +104,7 @@ TimingSimpleCPU::CpuPort::TickEvent::schedule(PacketPtr _pkt, Tick t)
     Event::schedule(t);
 }
 
-TimingSimpleCPU::TimingSimpleCPU(Params *p)
+TimingSimpleCPU::TimingSimpleCPU(TimingSimpleCPUParams *p)
     : BaseSimpleCPU(p), icachePort(this, p->clock), dcachePort(this, p->clock)
 {
     _status = Idle;
@@ -852,36 +852,10 @@ TimingSimpleCPU::printAddr(Addr a)
 TimingSimpleCPU *
 TimingSimpleCPUParams::create()
 {
-    TimingSimpleCPU::Params *params = new TimingSimpleCPU::Params();
-    params->name = name;
-    params->numberOfThreads = 1;
-    params->max_insts_any_thread = max_insts_any_thread;
-    params->max_insts_all_threads = max_insts_all_threads;
-    params->max_loads_any_thread = max_loads_any_thread;
-    params->max_loads_all_threads = max_loads_all_threads;
-    params->progress_interval = progress_interval;
-    params->deferRegistration = defer_registration;
-    params->clock = clock;
-    params->phase = phase;
-    params->functionTrace = function_trace;
-    params->functionTraceStart = function_trace_start;
-    params->system = system;
-    params->cpu_id = cpu_id;
-    params->tracer = tracer;
-
-    params->itb = itb;
-    params->dtb = dtb;
-#if FULL_SYSTEM
-    params->profile = profile;
-    params->do_quiesce = do_quiesce;
-    params->do_checkpoint_insts = do_checkpoint_insts;
-    params->do_statistics_insts = do_statistics_insts;
-#else
+    numThreads = 1;
+#if !FULL_SYSTEM
     if (workload.size() != 1)
         panic("only one workload allowed");
-    params->process = workload[0];
 #endif
-
-    TimingSimpleCPU *cpu = new TimingSimpleCPU(params);
-    return cpu;
+    return new TimingSimpleCPU(this);
 }
index a748d47b4b2fceee8e4b60f8f31665d43cd65242..e405f6a4133b8bd064e256dfb5f4428e6020d0ba 100644 (file)
 
 #include "cpu/simple/base.hh"
 
+#include "params/TimingSimpleCPU.hh"
+
 class TimingSimpleCPU : public BaseSimpleCPU
 {
   public:
 
-    struct Params : public BaseSimpleCPU::Params {
-    };
-
-    TimingSimpleCPU(Params *params);
+    TimingSimpleCPU(TimingSimpleCPUParams * params);
     virtual ~TimingSimpleCPU();
 
     virtual void init();
index 8d5c4eafbdd30ad5c3dde7c929c62038e541605e..ba3312a7a762f5badcb16bb50f6b2617935589bf 100644 (file)
 #include "cpu/base.hh"
 #include "cpu/simple_thread.hh"
 #include "cpu/thread_context.hh"
+#include "params/BaseCPU.hh"
 
 #if FULL_SYSTEM
 #include "arch/kernel_stats.hh"
+#include "arch/stacktrace.hh"
 #include "base/callback.hh"
 #include "base/cprintf.hh"
 #include "base/output.hh"
 #include "cpu/quiesce_event.hh"
 #include "sim/serialize.hh"
 #include "sim/sim_exit.hh"
-#include "arch/stacktrace.hh"
 #else
+#include "mem/translating_port.hh"
 #include "sim/process.hh"
 #include "sim/system.hh"
-#include "mem/translating_port.hh"
 #endif
 
 using namespace std;
@@ -72,7 +73,7 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
 
     regs.clear();
 
-    if (cpu->params->profile) {
+    if (cpu->params()->profile) {
         profile = new FunctionProfile(system->kernelSymtab);
         Callback *cb =
             new MakeCallback<SimpleThread,
index 60a74b224d99394ad7ace98fe0100f6f1b87f642..3b5965340bf90d0f1832cfb72a14369499a96214 100644 (file)
 #include <fstream>
 #include <string>
 
+#include "arch/kernel_stats.hh"
 #include "arch/vtophys.hh"
 #include "base/annotate.hh"
 #include "cpu/base.hh"
 #include "cpu/thread_context.hh"
 #include "cpu/quiesce_event.hh"
-#include "arch/kernel_stats.hh"
+#include "params/BaseCPU.hh"
 #include "sim/pseudo_inst.hh"
 #include "sim/serialize.hh"
 #include "sim/sim_exit.hh"
@@ -67,7 +68,7 @@ arm(ThreadContext *tc)
 void
 quiesce(ThreadContext *tc)
 {
-    if (!tc->getCpuPtr()->params->do_quiesce)
+    if (!tc->getCpuPtr()->params()->do_quiesce)
         return;
 
     DPRINTF(Quiesce, "%s: quiesce()\n", tc->getCpuPtr()->name());
@@ -80,7 +81,7 @@ quiesce(ThreadContext *tc)
 void
 quiesceNs(ThreadContext *tc, uint64_t ns)
 {
-    if (!tc->getCpuPtr()->params->do_quiesce || ns == 0)
+    if (!tc->getCpuPtr()->params()->do_quiesce || ns == 0)
         return;
 
     EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
@@ -100,7 +101,7 @@ quiesceNs(ThreadContext *tc, uint64_t ns)
 void
 quiesceCycles(ThreadContext *tc, uint64_t cycles)
 {
-    if (!tc->getCpuPtr()->params->do_quiesce || cycles == 0)
+    if (!tc->getCpuPtr()->params()->do_quiesce || cycles == 0)
         return;
 
     EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
@@ -181,7 +182,7 @@ loadsymbol(ThreadContext *tc)
 void
 resetstats(ThreadContext *tc, Tick delay, Tick period)
 {
-    if (!tc->getCpuPtr()->params->do_statistics_insts)
+    if (!tc->getCpuPtr()->params()->do_statistics_insts)
         return;
 
 
@@ -194,7 +195,7 @@ resetstats(ThreadContext *tc, Tick delay, Tick period)
 void
 dumpstats(ThreadContext *tc, Tick delay, Tick period)
 {
-    if (!tc->getCpuPtr()->params->do_statistics_insts)
+    if (!tc->getCpuPtr()->params()->do_statistics_insts)
         return;
 
 
@@ -219,7 +220,7 @@ addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr)
 void
 dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
 {
-    if (!tc->getCpuPtr()->params->do_statistics_insts)
+    if (!tc->getCpuPtr()->params()->do_statistics_insts)
         return;
 
 
@@ -232,7 +233,7 @@ dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
 void
 m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
 {
-    if (!tc->getCpuPtr()->params->do_checkpoint_insts)
+    if (!tc->getCpuPtr()->params()->do_checkpoint_insts)
         return;
 
     Tick when = curTick + delay * Clock::Int::ns;