2005-05-27 05:30:12 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 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.
|
|
|
|
*/
|
|
|
|
|
2005-08-30 19:18:54 +02:00
|
|
|
#include "config/full_system.hh"
|
|
|
|
|
|
|
|
#if FULL_SYSTEM
|
2004-08-20 20:54:07 +02:00
|
|
|
#include "sim/system.hh"
|
|
|
|
#else
|
|
|
|
#include "sim/process.hh"
|
|
|
|
#endif
|
2005-06-02 03:59:27 +02:00
|
|
|
#include "sim/root.hh"
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-03-04 21:18:40 +01:00
|
|
|
#include "cpu/cpu_exec_context.hh"
|
|
|
|
#include "cpu/exec_context.hh"
|
2005-06-05 02:50:10 +02:00
|
|
|
#include "cpu/o3/alpha_dyn_inst.hh"
|
|
|
|
#include "cpu/o3/alpha_impl.hh"
|
|
|
|
#include "cpu/o3/cpu.hh"
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
#include "sim/stat_control.hh"
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
using namespace std;
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
BaseFullCPU::BaseFullCPU(Params *params)
|
|
|
|
: BaseCPU(params), cpu_id(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
BaseFullCPU::regStats()
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
BaseCPU::regStats();
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::TickEvent::TickEvent(FullO3CPU<Impl> *c)
|
2004-08-20 20:54:07 +02:00
|
|
|
: Event(&mainEventQueue, CPU_Tick_Pri), cpu(c)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::TickEvent::process()
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
cpu->tick();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
const char *
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::TickEvent::description()
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2005-06-05 09:25:26 +02:00
|
|
|
return "FullO3CPU tick event";
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//Call constructor to all the pipeline stages here
|
|
|
|
template <class Impl>
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::FullO3CPU(Params *params)
|
Update to make multiple instruction issue and different latencies work.
Also change to ref counted DynInst.
SConscript:
Add branch predictor, BTB, load store queue, and storesets.
arch/isa_parser.py:
Specify the template parameter for AlphaDynInst
base/traceflags.py:
Add load store queue, store set, and mem dependence unit to the
list of trace flags.
cpu/base_dyn_inst.cc:
Change formating, add in debug statement.
cpu/base_dyn_inst.hh:
Change DynInst to be RefCounted, add flag to clear whether or not this
instruction can commit. This is likely to be removed in the future.
cpu/beta_cpu/alpha_dyn_inst.cc:
AlphaDynInst has been changed to be templated, so now this CC file
is just used to force instantiations of AlphaDynInst.
cpu/beta_cpu/alpha_dyn_inst.hh:
Changed AlphaDynInst to be templated on Impl. Removed some unnecessary
functions.
cpu/beta_cpu/alpha_full_cpu.cc:
AlphaFullCPU has been changed to be templated, so this CC file is now
just used to force instantation of AlphaFullCPU.
cpu/beta_cpu/alpha_full_cpu.hh:
Change AlphaFullCPU to be templated on Impl.
cpu/beta_cpu/alpha_impl.hh:
Update it to reflect AlphaDynInst and AlphaFullCPU being templated
on Impl. Also removed time buffers from here, as they are really
a part of the CPU and are thus in the CPU policy now.
cpu/beta_cpu/alpha_params.hh:
Make AlphaSimpleParams inherit from the BaseFullCPU so that it doesn't
need to specifically declare any parameters that are already in the
BaseFullCPU.
cpu/beta_cpu/comm.hh:
Changed the structure of the time buffer communication structs. Now
they include the size of the packet of instructions it is sending.
Added some parameters to the backwards communication struct, mainly
for squashing.
cpu/beta_cpu/commit.hh:
Update typenames to reflect change in location of time buffer structs.
Update DynInst to DynInstPtr (it is refcounted now).
cpu/beta_cpu/commit_impl.hh:
Formatting changes mainly. Also sends back proper information
on branch mispredicts so that the bpred unit can update itself.
Updated behavior for non-speculative instructions (stores, any
other non-spec instructions): once they reach the head of the ROB,
the ROB signals back to the IQ that it can go ahead and issue the
non-speculative instruction. The instruction itself is updated so that
commit won't try to commit it again until it is done executing.
cpu/beta_cpu/cpu_policy.hh:
Added branch prediction unit, mem dependence prediction unit, load
store queue. Moved time buffer structs from AlphaSimpleImpl to here.
cpu/beta_cpu/decode.hh:
Changed typedefs to reflect change in location of time buffer structs
and also the change from DynInst to ref counted DynInstPtr.
cpu/beta_cpu/decode_impl.hh:
Continues to buffer instructions even while unblocking now. Changed
how it loops through groups of instructions so it can properly block
during the middle of a group of instructions.
cpu/beta_cpu/fetch.hh:
Changed typedefs to reflect change in location of time buffer structs
and the change to ref counted DynInsts. Also added in branch
brediction unit.
cpu/beta_cpu/fetch_impl.hh:
Add in branch prediction. Changed how fetch checks inputs and its
current state to make for easier logic.
cpu/beta_cpu/free_list.cc:
Changed int regs and float regs to logically use one flat namespace.
Future change will be moving them to a single scoreboard to conserve
space.
cpu/beta_cpu/free_list.hh:
Mostly debugging statements. Might be removed for performance in future.
cpu/beta_cpu/full_cpu.cc:
Added in some debugging statements. Updated BaseFullCPU to take
a params object.
cpu/beta_cpu/full_cpu.hh:
Added params class within BaseCPU that other param classes will be
able to inherit from. Updated typedefs to reflect change in location
of time buffer structs and ref counted DynInst.
cpu/beta_cpu/iew.hh:
Updated typedefs to reflect change in location of time buffer structs
and use of ref counted DynInsts.
cpu/beta_cpu/iew_impl.hh:
Added in load store queue, updated iew to be able to execute non-
speculative instructions, instead of having them execute in commit.
cpu/beta_cpu/inst_queue.hh:
Updated change to ref counted DynInsts. Changed inst queue to hold
non-speculative instructions as well, which are issued only when
commit signals backwards that a nonspeculative instruction is at
the head of the ROB.
cpu/beta_cpu/inst_queue_impl.hh:
Updated to allow for non-speculative instructions to be in the inst
queue. Also added some debug functions.
cpu/beta_cpu/regfile.hh:
Added debugging statements, changed formatting.
cpu/beta_cpu/rename.hh:
Updated typedefs, added some functions to clean up code.
cpu/beta_cpu/rename_impl.hh:
Moved some code into functions to make it easier to read.
cpu/beta_cpu/rename_map.cc:
Changed int and float reg behavior to use a single flat namespace. In
the future, the rename maps can be combined to a single rename map to
save space.
cpu/beta_cpu/rename_map.hh:
Added destructor.
cpu/beta_cpu/rob.hh:
Updated it with change from DynInst to ref counted DynInst.
cpu/beta_cpu/rob_impl.hh:
Formatting, updated to use ref counted DynInst.
cpu/static_inst.hh:
Updated forward declaration for AlphaDynInst now that it is templated.
--HG--
extra : convert_revision : 1045f240ee9b6a4bd368e1806aca029ebbdc6dd3
2004-09-23 20:06:03 +02:00
|
|
|
: BaseFullCPU(params),
|
2004-08-20 20:54:07 +02:00
|
|
|
tickEvent(this),
|
2006-04-23 00:26:48 +02:00
|
|
|
removeInstsThisCycle(false),
|
2004-08-20 20:54:07 +02:00
|
|
|
fetch(params),
|
|
|
|
decode(params),
|
|
|
|
rename(params),
|
|
|
|
iew(params),
|
|
|
|
commit(params),
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
regFile(params->numPhysIntRegs, params->numPhysFloatRegs),
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
freeList(params->numberOfThreads,//number of activeThreads
|
|
|
|
TheISA::NumIntRegs, params->numPhysIntRegs,
|
|
|
|
TheISA::NumFloatRegs, params->numPhysFloatRegs),
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
rob(params->numROBEntries, params->squashWidth,
|
|
|
|
params->smtROBPolicy, params->smtROBThreshold,
|
|
|
|
params->numberOfThreads),
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
scoreboard(params->numberOfThreads,//number of activeThreads
|
|
|
|
TheISA::NumIntRegs, params->numPhysIntRegs,
|
|
|
|
TheISA::NumFloatRegs, params->numPhysFloatRegs,
|
|
|
|
TheISA::NumMiscRegs * number_of_threads,
|
|
|
|
TheISA::ZeroReg),
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
// What to pass to these time buffers?
|
|
|
|
// For now just have these time buffers be pretty big.
|
2006-04-23 00:26:48 +02:00
|
|
|
// @todo: Make these time buffer sizes parameters.
|
Update to make multiple instruction issue and different latencies work.
Also change to ref counted DynInst.
SConscript:
Add branch predictor, BTB, load store queue, and storesets.
arch/isa_parser.py:
Specify the template parameter for AlphaDynInst
base/traceflags.py:
Add load store queue, store set, and mem dependence unit to the
list of trace flags.
cpu/base_dyn_inst.cc:
Change formating, add in debug statement.
cpu/base_dyn_inst.hh:
Change DynInst to be RefCounted, add flag to clear whether or not this
instruction can commit. This is likely to be removed in the future.
cpu/beta_cpu/alpha_dyn_inst.cc:
AlphaDynInst has been changed to be templated, so now this CC file
is just used to force instantiations of AlphaDynInst.
cpu/beta_cpu/alpha_dyn_inst.hh:
Changed AlphaDynInst to be templated on Impl. Removed some unnecessary
functions.
cpu/beta_cpu/alpha_full_cpu.cc:
AlphaFullCPU has been changed to be templated, so this CC file is now
just used to force instantation of AlphaFullCPU.
cpu/beta_cpu/alpha_full_cpu.hh:
Change AlphaFullCPU to be templated on Impl.
cpu/beta_cpu/alpha_impl.hh:
Update it to reflect AlphaDynInst and AlphaFullCPU being templated
on Impl. Also removed time buffers from here, as they are really
a part of the CPU and are thus in the CPU policy now.
cpu/beta_cpu/alpha_params.hh:
Make AlphaSimpleParams inherit from the BaseFullCPU so that it doesn't
need to specifically declare any parameters that are already in the
BaseFullCPU.
cpu/beta_cpu/comm.hh:
Changed the structure of the time buffer communication structs. Now
they include the size of the packet of instructions it is sending.
Added some parameters to the backwards communication struct, mainly
for squashing.
cpu/beta_cpu/commit.hh:
Update typenames to reflect change in location of time buffer structs.
Update DynInst to DynInstPtr (it is refcounted now).
cpu/beta_cpu/commit_impl.hh:
Formatting changes mainly. Also sends back proper information
on branch mispredicts so that the bpred unit can update itself.
Updated behavior for non-speculative instructions (stores, any
other non-spec instructions): once they reach the head of the ROB,
the ROB signals back to the IQ that it can go ahead and issue the
non-speculative instruction. The instruction itself is updated so that
commit won't try to commit it again until it is done executing.
cpu/beta_cpu/cpu_policy.hh:
Added branch prediction unit, mem dependence prediction unit, load
store queue. Moved time buffer structs from AlphaSimpleImpl to here.
cpu/beta_cpu/decode.hh:
Changed typedefs to reflect change in location of time buffer structs
and also the change from DynInst to ref counted DynInstPtr.
cpu/beta_cpu/decode_impl.hh:
Continues to buffer instructions even while unblocking now. Changed
how it loops through groups of instructions so it can properly block
during the middle of a group of instructions.
cpu/beta_cpu/fetch.hh:
Changed typedefs to reflect change in location of time buffer structs
and the change to ref counted DynInsts. Also added in branch
brediction unit.
cpu/beta_cpu/fetch_impl.hh:
Add in branch prediction. Changed how fetch checks inputs and its
current state to make for easier logic.
cpu/beta_cpu/free_list.cc:
Changed int regs and float regs to logically use one flat namespace.
Future change will be moving them to a single scoreboard to conserve
space.
cpu/beta_cpu/free_list.hh:
Mostly debugging statements. Might be removed for performance in future.
cpu/beta_cpu/full_cpu.cc:
Added in some debugging statements. Updated BaseFullCPU to take
a params object.
cpu/beta_cpu/full_cpu.hh:
Added params class within BaseCPU that other param classes will be
able to inherit from. Updated typedefs to reflect change in location
of time buffer structs and ref counted DynInst.
cpu/beta_cpu/iew.hh:
Updated typedefs to reflect change in location of time buffer structs
and use of ref counted DynInsts.
cpu/beta_cpu/iew_impl.hh:
Added in load store queue, updated iew to be able to execute non-
speculative instructions, instead of having them execute in commit.
cpu/beta_cpu/inst_queue.hh:
Updated change to ref counted DynInsts. Changed inst queue to hold
non-speculative instructions as well, which are issued only when
commit signals backwards that a nonspeculative instruction is at
the head of the ROB.
cpu/beta_cpu/inst_queue_impl.hh:
Updated to allow for non-speculative instructions to be in the inst
queue. Also added some debug functions.
cpu/beta_cpu/regfile.hh:
Added debugging statements, changed formatting.
cpu/beta_cpu/rename.hh:
Updated typedefs, added some functions to clean up code.
cpu/beta_cpu/rename_impl.hh:
Moved some code into functions to make it easier to read.
cpu/beta_cpu/rename_map.cc:
Changed int and float reg behavior to use a single flat namespace. In
the future, the rename maps can be combined to a single rename map to
save space.
cpu/beta_cpu/rename_map.hh:
Added destructor.
cpu/beta_cpu/rob.hh:
Updated it with change from DynInst to ref counted DynInst.
cpu/beta_cpu/rob_impl.hh:
Formatting, updated to use ref counted DynInst.
cpu/static_inst.hh:
Updated forward declaration for AlphaDynInst now that it is templated.
--HG--
extra : convert_revision : 1045f240ee9b6a4bd368e1806aca029ebbdc6dd3
2004-09-23 20:06:03 +02:00
|
|
|
timeBuffer(5, 5),
|
|
|
|
fetchQueue(5, 5),
|
|
|
|
decodeQueue(5, 5),
|
|
|
|
renameQueue(5, 5),
|
|
|
|
iewQueue(5, 5),
|
2006-04-23 00:26:48 +02:00
|
|
|
activityBuffer(5, 0),
|
|
|
|
activityCount(0),
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
globalSeqNum(1),
|
|
|
|
|
2005-08-30 19:18:54 +02:00
|
|
|
#if FULL_SYSTEM
|
2006-04-23 00:26:48 +02:00
|
|
|
system(params->system),
|
2005-05-03 16:56:47 +02:00
|
|
|
memCtrl(system->memctrl),
|
2004-08-20 20:54:07 +02:00
|
|
|
physmem(system->physmem),
|
2006-04-23 00:26:48 +02:00
|
|
|
mem(params->mem),
|
2004-08-20 20:54:07 +02:00
|
|
|
#else
|
2006-04-24 23:11:31 +02:00
|
|
|
// pTable(params->pTable),
|
2006-05-04 17:36:20 +02:00
|
|
|
mem(params->workload[0]->getMemory()),
|
2004-08-20 20:54:07 +02:00
|
|
|
#endif // FULL_SYSTEM
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
icacheInterface(params->icacheInterface),
|
|
|
|
dcacheInterface(params->dcacheInterface),
|
|
|
|
deferRegistration(params->deferRegistration)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
_status = Idle;
|
2005-05-03 16:56:47 +02:00
|
|
|
|
2005-08-30 19:18:54 +02:00
|
|
|
#if !FULL_SYSTEM
|
2006-04-23 00:26:48 +02:00
|
|
|
thread.resize(number_of_threads);
|
|
|
|
tids.resize(number_of_threads);
|
2005-05-03 16:56:47 +02:00
|
|
|
#endif
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
// The stages also need their CPU pointer setup. However this must be
|
|
|
|
// done at the upper level CPU because they have pointers to the upper
|
2005-06-05 09:25:26 +02:00
|
|
|
// level CPU, and not this FullO3CPU.
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
// Set up Pointers to the activeThreads list for each stage
|
|
|
|
fetch.setActiveThreads(&activeThreads);
|
|
|
|
decode.setActiveThreads(&activeThreads);
|
|
|
|
rename.setActiveThreads(&activeThreads);
|
|
|
|
iew.setActiveThreads(&activeThreads);
|
|
|
|
commit.setActiveThreads(&activeThreads);
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
// Give each of the stages the time buffer they will use.
|
|
|
|
fetch.setTimeBuffer(&timeBuffer);
|
|
|
|
decode.setTimeBuffer(&timeBuffer);
|
|
|
|
rename.setTimeBuffer(&timeBuffer);
|
|
|
|
iew.setTimeBuffer(&timeBuffer);
|
|
|
|
commit.setTimeBuffer(&timeBuffer);
|
|
|
|
|
|
|
|
// Also setup each of the stages' queues.
|
|
|
|
fetch.setFetchQueue(&fetchQueue);
|
|
|
|
decode.setFetchQueue(&fetchQueue);
|
2006-04-23 00:26:48 +02:00
|
|
|
commit.setFetchQueue(&fetchQueue);
|
2004-08-20 20:54:07 +02:00
|
|
|
decode.setDecodeQueue(&decodeQueue);
|
|
|
|
rename.setDecodeQueue(&decodeQueue);
|
|
|
|
rename.setRenameQueue(&renameQueue);
|
|
|
|
iew.setRenameQueue(&renameQueue);
|
|
|
|
iew.setIEWQueue(&iewQueue);
|
|
|
|
commit.setIEWQueue(&iewQueue);
|
|
|
|
commit.setRenameQueue(&renameQueue);
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
commit.setIEWStage(&iew);
|
|
|
|
rename.setIEWStage(&iew);
|
|
|
|
rename.setCommitStage(&commit);
|
|
|
|
|
|
|
|
//Make Sure That this a Valid Architeture
|
|
|
|
//@todo: move this up in constructor
|
|
|
|
numThreads = number_of_threads;
|
|
|
|
|
|
|
|
#if !FULL_SYSTEM
|
2006-05-04 17:36:20 +02:00
|
|
|
int active_threads = params->workload.size();
|
2006-04-23 00:26:48 +02:00
|
|
|
#else
|
2006-05-04 17:36:20 +02:00
|
|
|
int active_threads = 1;
|
2006-04-23 00:26:48 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
assert(params->numPhysIntRegs >= numThreads * TheISA::NumIntRegs);
|
|
|
|
assert(params->numPhysFloatRegs >= numThreads * TheISA::NumFloatRegs);
|
|
|
|
|
|
|
|
rename.setScoreboard(&scoreboard);
|
|
|
|
iew.setScoreboard(&scoreboard);
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
// Setup the rename map for whichever stages need it.
|
2006-04-23 00:26:48 +02:00
|
|
|
PhysRegIndex lreg_idx = 0;
|
|
|
|
PhysRegIndex freg_idx = params->numPhysIntRegs; //Index to 1 after int regs
|
|
|
|
|
|
|
|
for (int tid=0; tid < numThreads; tid++) {
|
2006-05-04 17:36:20 +02:00
|
|
|
bool bindRegs = (tid <= active_threads - 1);
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
commitRenameMap[tid].init(TheISA::NumIntRegs,
|
|
|
|
params->numPhysIntRegs,
|
|
|
|
lreg_idx, //Index for Logical. Regs
|
|
|
|
|
|
|
|
TheISA::NumFloatRegs,
|
|
|
|
params->numPhysFloatRegs,
|
|
|
|
freg_idx, //Index for Float Regs
|
|
|
|
|
|
|
|
TheISA::NumMiscRegs,
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
TheISA::ZeroReg,
|
|
|
|
TheISA::ZeroReg,
|
|
|
|
|
|
|
|
tid,
|
|
|
|
false);
|
|
|
|
|
|
|
|
renameMap[tid].init(TheISA::NumIntRegs,
|
|
|
|
params->numPhysIntRegs,
|
|
|
|
lreg_idx, //Index for Logical. Regs
|
|
|
|
|
|
|
|
TheISA::NumFloatRegs,
|
|
|
|
params->numPhysFloatRegs,
|
|
|
|
freg_idx, //Index for Float Regs
|
|
|
|
|
|
|
|
TheISA::NumMiscRegs,
|
|
|
|
|
|
|
|
TheISA::ZeroReg,
|
|
|
|
TheISA::ZeroReg,
|
|
|
|
|
|
|
|
tid,
|
|
|
|
bindRegs);
|
|
|
|
}
|
|
|
|
|
|
|
|
rename.setRenameMap(renameMap);
|
|
|
|
commit.setRenameMap(commitRenameMap);
|
|
|
|
|
|
|
|
// Give renameMap & rename stage access to the freeList;
|
|
|
|
for (int i=0; i < numThreads; i++) {
|
|
|
|
renameMap[i].setFreeList(&freeList);
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
rename.setFreeList(&freeList);
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
// Setup the page table for whichever stages need it.
|
|
|
|
#if !FULL_SYSTEM
|
2006-04-24 23:11:31 +02:00
|
|
|
// fetch.setPageTable(pTable);
|
|
|
|
// iew.setPageTable(pTable);
|
2006-04-23 00:26:48 +02:00
|
|
|
#endif
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
// Setup the ROB for whichever stages need it.
|
|
|
|
commit.setROB(&rob);
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
lastRunningCycle = curTick;
|
|
|
|
|
|
|
|
for (int i = 0; i < NumStages; ++i) {
|
|
|
|
stageActive[i] = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
contextSwitch = false;
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::~FullO3CPU()
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::fullCPURegStats()
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
BaseFullCPU::regStats();
|
|
|
|
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
// Register any of the FullCPU's stats here.
|
2006-04-23 00:26:48 +02:00
|
|
|
timesIdled
|
|
|
|
.name(name() + ".timesIdled")
|
|
|
|
.desc("Number of times that the entire CPU went into an idle state and"
|
|
|
|
" unscheduled itself")
|
|
|
|
.prereq(timesIdled);
|
|
|
|
|
|
|
|
idleCycles
|
|
|
|
.name(name() + ".idleCycles")
|
|
|
|
.desc("Total number of cycles that the CPU has spent unscheduled due "
|
|
|
|
"to idling")
|
|
|
|
.prereq(idleCycles);
|
|
|
|
|
|
|
|
// Number of Instructions simulated
|
|
|
|
// --------------------------------
|
|
|
|
// Should probably be in Base CPU but need templated
|
|
|
|
// MaxThreads so put in here instead
|
|
|
|
committedInsts
|
|
|
|
.init(numThreads)
|
|
|
|
.name(name() + ".committedInsts")
|
|
|
|
.desc("Number of Instructions Simulated");
|
|
|
|
|
|
|
|
totalCommittedInsts
|
|
|
|
.name(name() + ".committedInsts_total")
|
|
|
|
.desc("Number of Instructions Simulated");
|
|
|
|
|
|
|
|
cpi
|
|
|
|
.name(name() + ".cpi")
|
|
|
|
.desc("CPI: Cycles Per Instruction")
|
|
|
|
.precision(6);
|
|
|
|
cpi = simTicks / committedInsts;
|
|
|
|
|
|
|
|
totalCpi
|
|
|
|
.name(name() + ".cpi_total")
|
|
|
|
.desc("CPI: Total CPI of All Threads")
|
|
|
|
.precision(6);
|
|
|
|
totalCpi = simTicks / totalCommittedInsts;
|
|
|
|
|
|
|
|
ipc
|
|
|
|
.name(name() + ".ipc")
|
|
|
|
.desc("IPC: Instructions Per Cycle")
|
|
|
|
.precision(6);
|
|
|
|
ipc = committedInsts / simTicks;
|
|
|
|
|
|
|
|
totalIpc
|
|
|
|
.name(name() + ".ipc_total")
|
|
|
|
.desc("IPC: Total IPC of All Threads")
|
|
|
|
.precision(6);
|
|
|
|
totalIpc = totalCommittedInsts / simTicks;
|
|
|
|
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
}
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::tick()
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2005-06-05 09:25:26 +02:00
|
|
|
DPRINTF(FullCPU, "\n\nFullCPU: Ticking main, FullO3CPU.\n");
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
++numCycles;
|
|
|
|
|
|
|
|
activity = false;
|
|
|
|
|
|
|
|
//Tick each of the stages
|
2004-08-20 20:54:07 +02:00
|
|
|
fetch.tick();
|
|
|
|
|
|
|
|
decode.tick();
|
|
|
|
|
|
|
|
rename.tick();
|
|
|
|
|
|
|
|
iew.tick();
|
|
|
|
|
|
|
|
commit.tick();
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
#if !FULL_SYSTEM
|
|
|
|
doContextSwitch();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Now advance the time buffers
|
2004-08-20 20:54:07 +02:00
|
|
|
timeBuffer.advance();
|
|
|
|
|
|
|
|
fetchQueue.advance();
|
|
|
|
decodeQueue.advance();
|
|
|
|
renameQueue.advance();
|
|
|
|
iewQueue.advance();
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
advanceActivityBuffer();
|
|
|
|
|
|
|
|
if (removeInstsThisCycle) {
|
|
|
|
cleanUpRemovedInsts();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (activityCount && !tickEvent.scheduled()) {
|
2006-05-04 17:36:20 +02:00
|
|
|
tickEvent.schedule(curTick + cycles(1));
|
2006-04-23 00:26:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#if !FULL_SYSTEM
|
|
|
|
updateThreadPriority();
|
|
|
|
#endif
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::init()
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-05-04 17:36:20 +02:00
|
|
|
if (!deferRegistration) {
|
|
|
|
registerExecContexts();
|
2006-04-23 00:26:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Set inSyscall so that the CPU doesn't squash when initially
|
|
|
|
// setting up registers.
|
|
|
|
for (int i = 0; i < number_of_threads; ++i)
|
|
|
|
thread[i]->inSyscall = true;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
// Need to do a copy of the xc->regs into the CPU's regfile so
|
|
|
|
// that it can start properly.
|
|
|
|
|
|
|
|
for (int tid=0; tid < number_of_threads; tid++) {
|
2004-08-20 20:54:07 +02:00
|
|
|
// Need to do a copy of the xc->regs into the CPU's regfile so
|
|
|
|
// that it can start properly.
|
2005-08-30 19:18:54 +02:00
|
|
|
#if FULL_SYSTEM
|
2006-05-04 17:36:20 +02:00
|
|
|
ExecContext *src_xc = execContexts[tid];
|
2005-05-03 16:56:47 +02:00
|
|
|
#else
|
2006-04-23 00:26:48 +02:00
|
|
|
ExecContext *src_xc = thread[tid]->getXCProxy();
|
2005-05-03 16:56:47 +02:00
|
|
|
#endif
|
2006-04-23 00:26:48 +02:00
|
|
|
// Threads start in the Suspended State
|
|
|
|
if (src_xc->status() != ExecContext::Suspended) {
|
|
|
|
continue;
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
#if FULL_SYSTEM
|
|
|
|
TheISA::initCPU(src_xc, src_xc->readCpuId());
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
// Clear inSyscall.
|
|
|
|
for (int i = 0; i < number_of_threads; ++i)
|
|
|
|
thread[i]->inSyscall = false;
|
|
|
|
|
|
|
|
// Probably should just make a call to all the stages to init stage,
|
|
|
|
// regardless of whether or not they need it. Keeps it more independent.
|
|
|
|
fetch.initStage();
|
|
|
|
iew.initStage();
|
|
|
|
rename.initStage();
|
|
|
|
commit.initStage();
|
|
|
|
|
|
|
|
commit.setThreads(thread);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::insertThread(unsigned tid)
|
|
|
|
{
|
|
|
|
DPRINTF(FullCPU,"[tid:%i] Initializing thread data");
|
|
|
|
// Will change now that the PC and thread state is internal to the CPU
|
|
|
|
// and not in the CPUExecContext.
|
|
|
|
#if 0
|
|
|
|
#if FULL_SYSTEM
|
|
|
|
ExecContext *src_xc = system->execContexts[tid];
|
|
|
|
#else
|
|
|
|
CPUExecContext *src_xc = thread[tid];
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//Bind Int Regs to Rename Map
|
|
|
|
for (int ireg = 0; ireg < TheISA::NumIntRegs; ireg++) {
|
|
|
|
PhysRegIndex phys_reg = freeList.getIntReg();
|
|
|
|
|
|
|
|
renameMap[tid].setEntry(ireg,phys_reg);
|
|
|
|
scoreboard.setReg(phys_reg);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Bind Float Regs to Rename Map
|
|
|
|
for (int freg = 0; freg < TheISA::NumFloatRegs; freg++) {
|
|
|
|
PhysRegIndex phys_reg = freeList.getFloatReg();
|
|
|
|
|
|
|
|
renameMap[tid].setEntry(freg,phys_reg);
|
|
|
|
scoreboard.setReg(phys_reg);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Copy Thread Data Into RegFile
|
|
|
|
this->copyFromXC(tid);
|
|
|
|
|
|
|
|
//Set PC/NPC
|
|
|
|
regFile.pc[tid] = src_xc->readPC();
|
|
|
|
regFile.npc[tid] = src_xc->readNextPC();
|
|
|
|
|
|
|
|
src_xc->setStatus(ExecContext::Active);
|
|
|
|
|
|
|
|
activateContext(tid,1);
|
|
|
|
|
|
|
|
//Reset ROB/IQ/LSQ Entries
|
|
|
|
commit.rob->resetEntries();
|
|
|
|
iew.resetEntries();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::removeThread(unsigned tid)
|
|
|
|
{
|
|
|
|
DPRINTF(FullCPU,"[tid:%i] Removing thread data");
|
|
|
|
#if 0
|
|
|
|
//Unbind Int Regs from Rename Map
|
|
|
|
for (int ireg = 0; ireg < TheISA::NumIntRegs; ireg++) {
|
|
|
|
PhysRegIndex phys_reg = renameMap[tid].lookup(ireg);
|
|
|
|
|
|
|
|
scoreboard.unsetReg(phys_reg);
|
|
|
|
freeList.addReg(phys_reg);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Unbind Float Regs from Rename Map
|
|
|
|
for (int freg = 0; freg < TheISA::NumFloatRegs; freg++) {
|
|
|
|
PhysRegIndex phys_reg = renameMap[tid].lookup(freg);
|
|
|
|
|
|
|
|
scoreboard.unsetReg(phys_reg);
|
|
|
|
freeList.addReg(phys_reg);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Copy Thread Data From RegFile
|
|
|
|
/* Fix Me:
|
|
|
|
* Do we really need to do this if we are removing a thread
|
|
|
|
* in the sense that it's finished (exiting)? If the thread is just
|
|
|
|
* being suspended we might...
|
|
|
|
*/
|
|
|
|
// this->copyToXC(tid);
|
|
|
|
|
|
|
|
//Squash Throughout Pipeline
|
|
|
|
fetch.squash(0,tid);
|
|
|
|
decode.squash(tid);
|
|
|
|
rename.squash(tid);
|
|
|
|
|
|
|
|
assert(iew.ldstQueue.getCount(tid) == 0);
|
|
|
|
|
|
|
|
//Reset ROB/IQ/LSQ Entries
|
|
|
|
if (activeThreads.size() >= 1) {
|
|
|
|
commit.rob->resetEntries();
|
|
|
|
iew.resetEntries();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::activateWhenReady(int tid)
|
|
|
|
{
|
|
|
|
DPRINTF(FullCPU,"[tid:%i]: Checking if resources are available for incoming"
|
|
|
|
"(e.g. PhysRegs/ROB/IQ/LSQ) \n",
|
|
|
|
tid);
|
|
|
|
|
|
|
|
bool ready = true;
|
|
|
|
|
|
|
|
if (freeList.numFreeIntRegs() >= TheISA::NumIntRegs) {
|
|
|
|
DPRINTF(FullCPU,"[tid:%i] Suspending thread due to not enough "
|
|
|
|
"Phys. Int. Regs.\n",
|
|
|
|
tid);
|
|
|
|
ready = false;
|
|
|
|
} else if (freeList.numFreeFloatRegs() >= TheISA::NumFloatRegs) {
|
|
|
|
DPRINTF(FullCPU,"[tid:%i] Suspending thread due to not enough "
|
|
|
|
"Phys. Float. Regs.\n",
|
|
|
|
tid);
|
|
|
|
ready = false;
|
|
|
|
} else if (commit.rob->numFreeEntries() >=
|
|
|
|
commit.rob->entryAmount(activeThreads.size() + 1)) {
|
|
|
|
DPRINTF(FullCPU,"[tid:%i] Suspending thread due to not enough "
|
|
|
|
"ROB entries.\n",
|
|
|
|
tid);
|
|
|
|
ready = false;
|
|
|
|
} else if (iew.instQueue.numFreeEntries() >=
|
|
|
|
iew.instQueue.entryAmount(activeThreads.size() + 1)) {
|
|
|
|
DPRINTF(FullCPU,"[tid:%i] Suspending thread due to not enough "
|
|
|
|
"IQ entries.\n",
|
|
|
|
tid);
|
|
|
|
ready = false;
|
|
|
|
} else if (iew.ldstQueue.numFreeEntries() >=
|
|
|
|
iew.ldstQueue.entryAmount(activeThreads.size() + 1)) {
|
|
|
|
DPRINTF(FullCPU,"[tid:%i] Suspending thread due to not enough "
|
|
|
|
"LSQ entries.\n",
|
|
|
|
tid);
|
|
|
|
ready = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ready) {
|
|
|
|
insertThread(tid);
|
|
|
|
|
|
|
|
contextSwitch = false;
|
|
|
|
|
|
|
|
cpuWaitList.remove(tid);
|
|
|
|
} else {
|
|
|
|
suspendContext(tid);
|
|
|
|
|
|
|
|
//blocks fetch
|
|
|
|
contextSwitch = true;
|
|
|
|
|
|
|
|
//do waitlist
|
|
|
|
cpuWaitList.push_back(tid);
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::activateContext(int tid, int delay)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
// Needs to set each stage to running as well.
|
2006-04-23 00:26:48 +02:00
|
|
|
list<unsigned>::iterator isActive = find(
|
|
|
|
activeThreads.begin(), activeThreads.end(), tid);
|
|
|
|
|
|
|
|
if (isActive == activeThreads.end()) {
|
|
|
|
//May Need to Re-code this if the delay variable is the
|
|
|
|
//delay needed for thread to activate
|
|
|
|
DPRINTF(FullCPU, "Adding Thread %i to active threads list\n",
|
|
|
|
tid);
|
|
|
|
|
|
|
|
activeThreads.push_back(tid);
|
|
|
|
}
|
|
|
|
|
2006-05-04 17:36:20 +02:00
|
|
|
assert(_status == Idle || _status == SwitchedOut);
|
2004-08-20 20:54:07 +02:00
|
|
|
|
|
|
|
scheduleTickEvent(delay);
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
// Be sure to signal that there's some activity so the CPU doesn't
|
|
|
|
// deschedule itself.
|
|
|
|
activityThisCycle();
|
|
|
|
fetch.wakeFromQuiesce();
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
_status = Running;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::suspendContext(int tid)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
DPRINTF(FullCPU,"[tid: %i]: Suspended ...\n", tid);
|
|
|
|
unscheduleTickEvent();
|
|
|
|
_status = Idle;
|
|
|
|
/*
|
|
|
|
//Remove From Active List, if Active
|
|
|
|
list<unsigned>::iterator isActive = find(
|
|
|
|
activeThreads.begin(), activeThreads.end(), tid);
|
|
|
|
|
|
|
|
if (isActive != activeThreads.end()) {
|
|
|
|
DPRINTF(FullCPU,"[tid:%i]: Removing from active threads list\n",
|
|
|
|
tid);
|
|
|
|
activeThreads.erase(isActive);
|
|
|
|
}
|
|
|
|
*/
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::deallocateContext(int tid)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
DPRINTF(FullCPU,"[tid:%i]: Deallocating ...", tid);
|
|
|
|
/*
|
|
|
|
//Remove From Active List, if Active
|
|
|
|
list<unsigned>::iterator isActive = find(
|
|
|
|
activeThreads.begin(), activeThreads.end(), tid);
|
|
|
|
|
|
|
|
if (isActive != activeThreads.end()) {
|
|
|
|
DPRINTF(FullCPU,"[tid:%i]: Removing from active threads list\n",
|
|
|
|
tid);
|
|
|
|
activeThreads.erase(isActive);
|
|
|
|
|
|
|
|
removeThread(tid);
|
|
|
|
}
|
|
|
|
*/
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::haltContext(int tid)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
DPRINTF(FullCPU,"[tid:%i]: Halted ...", tid);
|
|
|
|
/*
|
|
|
|
//Remove From Active List, if Active
|
|
|
|
list<unsigned>::iterator isActive = find(
|
|
|
|
activeThreads.begin(), activeThreads.end(), tid);
|
|
|
|
|
|
|
|
if (isActive != activeThreads.end()) {
|
|
|
|
DPRINTF(FullCPU,"[tid:%i]: Removing from active threads list\n",
|
|
|
|
tid);
|
|
|
|
activeThreads.erase(isActive);
|
|
|
|
|
|
|
|
removeThread(tid);
|
|
|
|
}
|
|
|
|
*/
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-05-04 17:36:20 +02:00
|
|
|
FullO3CPU<Impl>::switchOut(Sampler *sampler)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-05-04 17:36:20 +02:00
|
|
|
// panic("FullO3CPU does not have a switch out function.\n");
|
|
|
|
fetch.switchOut();
|
|
|
|
decode.switchOut();
|
|
|
|
rename.switchOut();
|
|
|
|
iew.switchOut();
|
|
|
|
commit.switchOut();
|
|
|
|
if (tickEvent.scheduled())
|
|
|
|
tickEvent.squash();
|
|
|
|
sampler->signalSwitched();
|
|
|
|
_status = SwitchedOut;
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::takeOverFrom(BaseCPU *oldCPU)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-05-04 17:36:20 +02:00
|
|
|
for (int i = 0; i < 6; ++i) {
|
|
|
|
timeBuffer.advance();
|
|
|
|
fetchQueue.advance();
|
|
|
|
decodeQueue.advance();
|
|
|
|
renameQueue.advance();
|
|
|
|
iewQueue.advance();
|
|
|
|
activityBuffer.advance();
|
|
|
|
}
|
|
|
|
|
|
|
|
activityCount = 0;
|
|
|
|
bzero(&stageActive, sizeof(stageActive));
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
BaseCPU::takeOverFrom(oldCPU);
|
|
|
|
|
2006-05-04 17:36:20 +02:00
|
|
|
fetch.takeOverFrom();
|
|
|
|
decode.takeOverFrom();
|
|
|
|
rename.takeOverFrom();
|
|
|
|
iew.takeOverFrom();
|
|
|
|
commit.takeOverFrom();
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
assert(!tickEvent.scheduled());
|
|
|
|
|
2006-05-04 17:36:20 +02:00
|
|
|
// @todo: Figure out how to properly select the tid to put onto the active threads list.
|
|
|
|
int tid = 0;
|
|
|
|
|
|
|
|
list<unsigned>::iterator isActive = find(
|
|
|
|
activeThreads.begin(), activeThreads.end(), tid);
|
|
|
|
|
|
|
|
if (isActive == activeThreads.end()) {
|
|
|
|
//May Need to Re-code this if the delay variable is the
|
|
|
|
//delay needed for thread to activate
|
|
|
|
DPRINTF(FullCPU, "Adding Thread %i to active threads list\n",
|
|
|
|
tid);
|
|
|
|
|
|
|
|
activeThreads.push_back(tid);
|
|
|
|
}
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
// Set all status's to active, schedule the
|
|
|
|
// CPU's tick event.
|
2006-05-04 17:36:20 +02:00
|
|
|
// @todo: Fix up statuses so this is handled properly
|
2004-08-20 20:54:07 +02:00
|
|
|
for (int i = 0; i < execContexts.size(); ++i) {
|
2005-05-03 16:56:47 +02:00
|
|
|
ExecContext *xc = execContexts[i];
|
|
|
|
if (xc->status() == ExecContext::Active && _status != Running) {
|
|
|
|
_status = Running;
|
|
|
|
tickEvent.schedule(curTick);
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
2006-05-04 17:36:20 +02:00
|
|
|
if (!tickEvent.scheduled())
|
|
|
|
tickEvent.schedule(curTick);
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
InstSeqNum
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::getAndIncrementInstSeq()
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
return globalSeqNum++;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
uint64_t
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::readIntReg(int reg_idx)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
return regFile.readIntReg(reg_idx);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
float
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::readFloatRegSingle(int reg_idx)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
return regFile.readFloatRegSingle(reg_idx);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
double
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::readFloatRegDouble(int reg_idx)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
return regFile.readFloatRegDouble(reg_idx);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
uint64_t
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::readFloatRegInt(int reg_idx)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
return regFile.readFloatRegInt(reg_idx);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::setIntReg(int reg_idx, uint64_t val)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
regFile.setIntReg(reg_idx, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::setFloatRegSingle(int reg_idx, float val)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
regFile.setFloatRegSingle(reg_idx, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::setFloatRegDouble(int reg_idx, double val)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
regFile.setFloatRegDouble(reg_idx, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::setFloatRegInt(int reg_idx, uint64_t val)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
regFile.setFloatRegInt(reg_idx, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
uint64_t
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::readArchIntReg(int reg_idx, unsigned tid)
|
|
|
|
{
|
|
|
|
PhysRegIndex phys_reg = commitRenameMap[tid].lookup(reg_idx);
|
|
|
|
|
|
|
|
return regFile.readIntReg(phys_reg);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
float
|
|
|
|
FullO3CPU<Impl>::readArchFloatRegSingle(int reg_idx, unsigned tid)
|
|
|
|
{
|
2006-05-04 17:36:20 +02:00
|
|
|
int idx = reg_idx + TheISA::FP_Base_DepTag;
|
|
|
|
PhysRegIndex phys_reg = commitRenameMap[tid].lookup(idx);
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
return regFile.readFloatRegSingle(phys_reg);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
double
|
|
|
|
FullO3CPU<Impl>::readArchFloatRegDouble(int reg_idx, unsigned tid)
|
|
|
|
{
|
2006-05-04 17:36:20 +02:00
|
|
|
int idx = reg_idx + TheISA::FP_Base_DepTag;
|
|
|
|
PhysRegIndex phys_reg = commitRenameMap[tid].lookup(idx);
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
return regFile.readFloatRegDouble(phys_reg);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
uint64_t
|
|
|
|
FullO3CPU<Impl>::readArchFloatRegInt(int reg_idx, unsigned tid)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-05-04 17:36:20 +02:00
|
|
|
int idx = reg_idx + TheISA::FP_Base_DepTag;
|
|
|
|
PhysRegIndex phys_reg = commitRenameMap[tid].lookup(idx);
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
return regFile.readFloatRegInt(phys_reg);
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::setArchIntReg(int reg_idx, uint64_t val, unsigned tid)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
if (reg_idx == TheISA::ZeroReg) {
|
|
|
|
warn("Setting r31 through ArchIntReg in CPU, cycle %i\n", curTick);
|
|
|
|
}
|
|
|
|
|
|
|
|
PhysRegIndex phys_reg = commitRenameMap[tid].lookup(reg_idx);
|
|
|
|
|
|
|
|
regFile.setIntReg(phys_reg, val);
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::setArchFloatRegSingle(int reg_idx, float val, unsigned tid)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
PhysRegIndex phys_reg = commitRenameMap[tid].lookup(reg_idx);
|
|
|
|
|
|
|
|
regFile.setFloatRegSingle(phys_reg, val);
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::setArchFloatRegDouble(int reg_idx, double val, unsigned tid)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
PhysRegIndex phys_reg = commitRenameMap[tid].lookup(reg_idx);
|
|
|
|
|
|
|
|
regFile.setFloatRegDouble(phys_reg, val);
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::setArchFloatRegInt(int reg_idx, uint64_t val, unsigned tid)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
PhysRegIndex phys_reg = commitRenameMap[tid].lookup(reg_idx);
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
regFile.setFloatRegInt(phys_reg, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
uint64_t
|
|
|
|
FullO3CPU<Impl>::readPC(unsigned tid)
|
|
|
|
{
|
|
|
|
return commit.readPC(tid);
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::setPC(Addr new_PC,unsigned tid)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
commit.setPC(new_PC, tid);
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
template <class Impl>
|
|
|
|
uint64_t
|
|
|
|
FullO3CPU<Impl>::readNextPC(unsigned tid)
|
|
|
|
{
|
|
|
|
return commit.readNextPC(tid);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::setNextPC(uint64_t val,unsigned tid)
|
|
|
|
{
|
|
|
|
commit.setNextPC(val, tid);
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
template <class Impl>
|
|
|
|
typename FullO3CPU<Impl>::ListIt
|
|
|
|
FullO3CPU<Impl>::addInst(DynInstPtr &inst)
|
|
|
|
{
|
|
|
|
instList.push_back(inst);
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
return --(instList.end());
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::instDone(unsigned tid)
|
|
|
|
{
|
|
|
|
// Keep an instruction count.
|
|
|
|
thread[tid]->numInst++;
|
|
|
|
thread[tid]->numInsts++;
|
|
|
|
committedInsts[tid]++;
|
|
|
|
totalCommittedInsts++;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
// Check for instruction-count-based events.
|
|
|
|
comInstEventQueue[tid]->serviceEvents(thread[tid]->numInst);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::addToRemoveList(DynInstPtr &inst)
|
|
|
|
{
|
|
|
|
removeInstsThisCycle = true;
|
|
|
|
|
|
|
|
removeList.push(inst->getInstListIt());
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::removeFrontInst(DynInstPtr &inst)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
DPRINTF(FullCPU, "FullCPU: Removing committed instruction [tid:%i] PC %#x "
|
|
|
|
"[sn:%lli]\n",
|
2006-04-24 23:11:31 +02:00
|
|
|
inst->threadNumber, inst->readPC(), inst->seqNum);
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
removeInstsThisCycle = true;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
// Remove the front instruction.
|
|
|
|
removeList.push(inst->getInstListIt());
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::removeInstsNotInROB(unsigned tid)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
DPRINTF(FullCPU, "FullCPU: Thread %i: Deleting instructions from instruction"
|
|
|
|
" list.\n", tid);
|
|
|
|
|
|
|
|
ListIt end_it;
|
|
|
|
|
|
|
|
bool rob_empty = false;
|
|
|
|
|
|
|
|
if (instList.empty()) {
|
|
|
|
return;
|
|
|
|
} else if (rob.isEmpty(/*tid*/)) {
|
|
|
|
DPRINTF(FullCPU, "FullCPU: ROB is empty, squashing all insts.\n");
|
|
|
|
end_it = instList.begin();
|
|
|
|
rob_empty = true;
|
|
|
|
} else {
|
|
|
|
end_it = (rob.readTailInst(tid))->getInstListIt();
|
|
|
|
DPRINTF(FullCPU, "FullCPU: ROB is not empty, squashing insts not in ROB.\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
removeInstsThisCycle = true;
|
|
|
|
|
|
|
|
ListIt inst_it = instList.end();
|
|
|
|
|
|
|
|
inst_it--;
|
|
|
|
|
|
|
|
// Walk through the instruction list, removing any instructions
|
|
|
|
// that were inserted after the given instruction iterator, end_it.
|
|
|
|
while (inst_it != end_it) {
|
|
|
|
assert(!instList.empty());
|
|
|
|
|
|
|
|
bool break_loop = (inst_it == instList.begin());
|
|
|
|
|
|
|
|
squashInstIt(inst_it, tid);
|
|
|
|
|
|
|
|
inst_it--;
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
if (break_loop)
|
|
|
|
break;
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
// If the ROB was empty, then we actually need to remove the first
|
|
|
|
// instruction as well.
|
|
|
|
if (rob_empty) {
|
|
|
|
squashInstIt(inst_it, tid);
|
|
|
|
}
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-04-23 00:26:48 +02:00
|
|
|
FullO3CPU<Impl>::removeInstsUntil(const InstSeqNum &seq_num,
|
|
|
|
unsigned tid)
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
{
|
2006-04-23 00:26:48 +02:00
|
|
|
assert(!instList.empty());
|
|
|
|
|
|
|
|
removeInstsThisCycle = true;
|
|
|
|
|
|
|
|
ListIt inst_iter = instList.end();
|
|
|
|
|
|
|
|
inst_iter--;
|
|
|
|
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
DPRINTF(FullCPU, "FullCPU: Deleting instructions from instruction "
|
2006-04-23 00:26:48 +02:00
|
|
|
"list that are from [tid:%i] and above [sn:%lli] (end=%lli).\n",
|
|
|
|
tid, seq_num, (*inst_iter)->seqNum);
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
while ((*inst_iter)->seqNum > seq_num) {
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
bool break_loop = (inst_iter == instList.begin());
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
squashInstIt(inst_iter, tid);
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
inst_iter--;
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
if (break_loop)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
inline void
|
|
|
|
FullO3CPU<Impl>::squashInstIt(const ListIt &instIt, const unsigned &tid)
|
|
|
|
{
|
|
|
|
if ((*instIt)->threadNumber == tid) {
|
|
|
|
DPRINTF(FullCPU, "FullCPU: Squashing instruction, "
|
|
|
|
"[tid:%i] [sn:%lli] PC %#x\n",
|
|
|
|
(*instIt)->threadNumber,
|
|
|
|
(*instIt)->seqNum,
|
|
|
|
(*instIt)->readPC());
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
|
|
|
|
// Mark it as squashed.
|
2006-04-23 00:26:48 +02:00
|
|
|
(*instIt)->setSquashed();
|
|
|
|
|
|
|
|
//@todo: Formulate a consistent method for deleting
|
|
|
|
//instructions from the instruction list
|
|
|
|
// Remove the instruction from the list.
|
|
|
|
removeList.push(instIt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::cleanUpRemovedInsts()
|
|
|
|
{
|
|
|
|
while (!removeList.empty()) {
|
|
|
|
DPRINTF(FullCPU, "FullCPU: Removing instruction, "
|
|
|
|
"[tid:%i] [sn:%lli] PC %#x\n",
|
|
|
|
(*removeList.front())->threadNumber,
|
|
|
|
(*removeList.front())->seqNum,
|
|
|
|
(*removeList.front())->readPC());
|
|
|
|
|
|
|
|
instList.erase(removeList.front());
|
|
|
|
|
|
|
|
removeList.pop();
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
}
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
removeInstsThisCycle = false;
|
Check in of various updates to the CPU. Mainly adds in stats, improves
branch prediction, and makes memory dependence work properly.
SConscript:
Added return address stack, tournament predictor.
cpu/base_cpu.cc:
Added debug break and print statements.
cpu/base_dyn_inst.cc:
cpu/base_dyn_inst.hh:
Comment out possibly unneeded variables.
cpu/beta_cpu/2bit_local_pred.cc:
2bit predictor no longer speculatively updates itself.
cpu/beta_cpu/alpha_dyn_inst.hh:
Comment formatting.
cpu/beta_cpu/alpha_full_cpu.hh:
Formatting
cpu/beta_cpu/alpha_full_cpu_builder.cc:
Added new parameters for branch predictors, and IQ parameters.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
Register stats.
cpu/beta_cpu/alpha_params.hh:
Added parameters for IQ, branch predictors, and store sets.
cpu/beta_cpu/bpred_unit.cc:
Removed one class.
cpu/beta_cpu/bpred_unit.hh:
Add in RAS, stats. Changed branch predictor unit functionality
so that it holds a history of past branches so it can update, and also
hold a proper history of the RAS so it can be restored on branch
mispredicts.
cpu/beta_cpu/bpred_unit_impl.hh:
Added in stats, history of branches, RAS. Now bpred unit actually
modifies the instruction's predicted next PC.
cpu/beta_cpu/btb.cc:
Add in sanity checks.
cpu/beta_cpu/comm.hh:
Add in communication where needed, remove it where it's not.
cpu/beta_cpu/commit.hh:
cpu/beta_cpu/rename.hh:
cpu/beta_cpu/rename_impl.hh:
Add in stats.
cpu/beta_cpu/commit_impl.hh:
Stats, update what is sent back on branch mispredict.
cpu/beta_cpu/cpu_policy.hh:
Change the bpred unit being used.
cpu/beta_cpu/decode.hh:
cpu/beta_cpu/decode_impl.hh:
Stats.
cpu/beta_cpu/fetch.hh:
Stats, change squash so it can handle squashes from decode differently
than squashes from commit.
cpu/beta_cpu/fetch_impl.hh:
Add in stats. Change how a cache line is fetched. Update to work with
caches. Also have separate functions for different behavior if squash
is coming from decode vs commit.
cpu/beta_cpu/free_list.hh:
Remove some old comments.
cpu/beta_cpu/full_cpu.cc:
cpu/beta_cpu/full_cpu.hh:
Added function to remove instructions from back of instruction list
until a certain sequence number.
cpu/beta_cpu/iew.hh:
Stats, separate squashing behavior due to branches vs memory.
cpu/beta_cpu/iew_impl.hh:
Stats, separate squashing behavior for branches vs memory.
cpu/beta_cpu/inst_queue.cc:
Debug stuff
cpu/beta_cpu/inst_queue.hh:
Stats, change how mem dep unit works, debug stuff
cpu/beta_cpu/inst_queue_impl.hh:
Stats, change how mem dep unit works, debug stuff. Also add in
parameters that used to be hardcoded.
cpu/beta_cpu/mem_dep_unit.hh:
cpu/beta_cpu/mem_dep_unit_impl.hh:
Add in stats, change how memory dependence unit works. It now holds
the memory instructions that are waiting for their memory dependences
to resolve. It provides which instructions are ready directly to the
IQ.
cpu/beta_cpu/regfile.hh:
Fix up sanity checks.
cpu/beta_cpu/rename_map.cc:
Fix loop variable type.
cpu/beta_cpu/rob_impl.hh:
Remove intermediate DynInstPtr
cpu/beta_cpu/store_set.cc:
Add in debugging statements.
cpu/beta_cpu/store_set.hh:
Reorder function arguments to match the rest of the calls.
--HG--
extra : convert_revision : aabf9b1fecd1d743265dfc3b174d6159937c6f44
2004-10-22 00:02:36 +02:00
|
|
|
}
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::removeAllInsts()
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
instList.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::dumpInsts()
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
int num = 0;
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
ListIt inst_list_it = instList.begin();
|
|
|
|
|
|
|
|
cprintf("Dumping Instruction List\n");
|
|
|
|
|
|
|
|
while (inst_list_it != instList.end()) {
|
|
|
|
cprintf("Instruction:%i\nPC:%#x\n[tid:%i]\n[sn:%lli]\nIssued:%i\n"
|
|
|
|
"Squashed:%i\n\n",
|
|
|
|
num, (*inst_list_it)->readPC(), (*inst_list_it)->threadNumber,
|
|
|
|
(*inst_list_it)->seqNum, (*inst_list_it)->isIssued(),
|
|
|
|
(*inst_list_it)->isSquashed());
|
2004-08-20 20:54:07 +02:00
|
|
|
inst_list_it++;
|
|
|
|
++num;
|
|
|
|
}
|
2006-04-23 00:26:48 +02:00
|
|
|
|
|
|
|
|
2004-08-20 20:54:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2005-06-05 09:25:26 +02:00
|
|
|
FullO3CPU<Impl>::wakeDependents(DynInstPtr &inst)
|
2004-08-20 20:54:07 +02:00
|
|
|
{
|
|
|
|
iew.wakeDependents(inst);
|
|
|
|
}
|
|
|
|
|
2006-04-23 00:26:48 +02:00
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::wakeCPU()
|
|
|
|
{
|
|
|
|
if (activityCount || tickEvent.scheduled()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
idleCycles += curTick - lastRunningCycle;
|
|
|
|
|
|
|
|
tickEvent.schedule(curTick);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::activityThisCycle()
|
|
|
|
{
|
|
|
|
if (activityBuffer[0]) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
activityBuffer[0] = true;
|
|
|
|
activity = true;
|
|
|
|
++activityCount;
|
|
|
|
|
|
|
|
DPRINTF(Activity, "Activity: %i\n", activityCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::advanceActivityBuffer()
|
|
|
|
{
|
|
|
|
if (activityBuffer[-5]) {
|
|
|
|
--activityCount;
|
|
|
|
|
|
|
|
assert(activityCount >= 0);
|
|
|
|
|
|
|
|
DPRINTF(Activity, "Activity: %i\n", activityCount);
|
|
|
|
|
|
|
|
if (activityCount == 0) {
|
|
|
|
DPRINTF(FullCPU, "No activity left, going to idle!\n");
|
|
|
|
lastRunningCycle = curTick;
|
|
|
|
timesIdled++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
activityBuffer.advance();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::activateStage(const StageIdx idx)
|
|
|
|
{
|
|
|
|
if (!stageActive[idx]) {
|
|
|
|
++activityCount;
|
|
|
|
|
|
|
|
stageActive[idx] = true;
|
|
|
|
|
|
|
|
DPRINTF(Activity, "Activity: %i\n", activityCount);
|
|
|
|
} else {
|
|
|
|
DPRINTF(Activity, "Stage %i already active.\n", idx);
|
|
|
|
}
|
|
|
|
|
|
|
|
// @todo: Number is hardcoded for now. Replace with parameter.
|
|
|
|
assert(activityCount < 15);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::deactivateStage(const StageIdx idx)
|
|
|
|
{
|
|
|
|
if (stageActive[idx]) {
|
|
|
|
--activityCount;
|
|
|
|
|
|
|
|
stageActive[idx] = false;
|
|
|
|
|
|
|
|
DPRINTF(Activity, "Activity: %i\n", activityCount);
|
|
|
|
} else {
|
|
|
|
DPRINTF(Activity, "Stage %i already inactive.\n", idx);
|
|
|
|
}
|
|
|
|
|
|
|
|
assert(activityCount >= 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
int
|
|
|
|
FullO3CPU<Impl>::getFreeTid()
|
|
|
|
{
|
|
|
|
for (int i=0; i < numThreads; i++) {
|
|
|
|
if (!tids[i]) {
|
|
|
|
tids[i] = true;
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::doContextSwitch()
|
|
|
|
{
|
|
|
|
if (contextSwitch) {
|
|
|
|
|
|
|
|
//ADD CODE TO DEACTIVE THREAD HERE (???)
|
|
|
|
|
|
|
|
for (int tid=0; tid < cpuWaitList.size(); tid++) {
|
|
|
|
activateWhenReady(tid);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cpuWaitList.size() == 0)
|
|
|
|
contextSwitch = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
FullO3CPU<Impl>::updateThreadPriority()
|
|
|
|
{
|
|
|
|
if (activeThreads.size() > 1)
|
|
|
|
{
|
|
|
|
//DEFAULT TO ROUND ROBIN SCHEME
|
|
|
|
//e.g. Move highest priority to end of thread list
|
|
|
|
list<unsigned>::iterator list_begin = activeThreads.begin();
|
|
|
|
list<unsigned>::iterator list_end = activeThreads.end();
|
|
|
|
|
|
|
|
unsigned high_thread = *list_begin;
|
|
|
|
|
|
|
|
activeThreads.erase(list_begin);
|
|
|
|
|
|
|
|
activeThreads.push_back(high_thread);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-06-05 09:25:26 +02:00
|
|
|
// Forward declaration of FullO3CPU.
|
|
|
|
template class FullO3CPU<AlphaSimpleImpl>;
|