2005-06-05 17:02:38 +02:00
|
|
|
/*
|
2006-05-23 22:51:16 +02:00
|
|
|
* Copyright (c) 2006 The Regents of The University of Michigan
|
2005-06-05 17:02:38 +02:00
|
|
|
* 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.
|
2006-06-01 01:26:56 +02:00
|
|
|
*
|
|
|
|
* Authors: Kevin Lim
|
|
|
|
* Nathan Binkert
|
2005-06-05 17:02:38 +02:00
|
|
|
*/
|
2005-02-26 00:00:49 +01:00
|
|
|
|
2006-06-23 05:33:26 +02:00
|
|
|
#include "config/full_system.hh"
|
|
|
|
#include "config/use_checker.hh"
|
2005-02-26 00:00:49 +01:00
|
|
|
|
2006-04-23 00:45:01 +02:00
|
|
|
#include "arch/isa_traits.hh" // For MachInst
|
|
|
|
#include "base/trace.hh"
|
|
|
|
#include "cpu/base.hh"
|
2006-10-02 17:58:09 +02:00
|
|
|
#include "cpu/simple_thread.hh"
|
2006-06-06 23:32:21 +02:00
|
|
|
#include "cpu/thread_context.hh"
|
2006-04-23 00:45:01 +02:00
|
|
|
#include "cpu/exetrace.hh"
|
|
|
|
#include "cpu/ozone/cpu.hh"
|
|
|
|
#include "cpu/quiesce_event.hh"
|
|
|
|
#include "cpu/static_inst.hh"
|
|
|
|
#include "sim/sim_object.hh"
|
|
|
|
#include "sim/stats.hh"
|
|
|
|
|
|
|
|
#if FULL_SYSTEM
|
|
|
|
#include "arch/faults.hh"
|
|
|
|
#include "arch/alpha/osfpal.hh"
|
2006-11-08 04:34:34 +01:00
|
|
|
#include "arch/tlb.hh"
|
|
|
|
#include "arch/types.hh"
|
|
|
|
#include "arch/kernel_stats.hh"
|
2006-04-23 00:45:01 +02:00
|
|
|
#include "arch/vtophys.hh"
|
|
|
|
#include "base/callback.hh"
|
|
|
|
#include "cpu/profile.hh"
|
2006-10-02 17:58:09 +02:00
|
|
|
#include "mem/physical.hh"
|
2006-04-23 00:45:01 +02:00
|
|
|
#include "sim/faults.hh"
|
|
|
|
#include "sim/sim_events.hh"
|
|
|
|
#include "sim/sim_exit.hh"
|
|
|
|
#include "sim/system.hh"
|
|
|
|
#else // !FULL_SYSTEM
|
|
|
|
#include "sim/process.hh"
|
|
|
|
#endif // FULL_SYSTEM
|
|
|
|
|
2006-06-23 05:33:26 +02:00
|
|
|
#if USE_CHECKER
|
|
|
|
#include "cpu/checker/thread_context.hh"
|
|
|
|
#endif
|
|
|
|
|
2006-04-23 00:45:01 +02:00
|
|
|
using namespace TheISA;
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
OzoneCPU<Impl>::TickEvent::TickEvent(OzoneCPU *c, int w)
|
|
|
|
: Event(&mainEventQueue, CPU_Tick_Pri), cpu(c), width(w)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::TickEvent::process()
|
|
|
|
{
|
|
|
|
cpu->tick();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
const char *
|
|
|
|
OzoneCPU<Impl>::TickEvent::description()
|
|
|
|
{
|
|
|
|
return "OzoneCPU tick event";
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
OzoneCPU<Impl>::OzoneCPU(Params *p)
|
|
|
|
#if FULL_SYSTEM
|
2006-06-23 05:33:26 +02:00
|
|
|
: BaseCPU(p), thread(this, 0), tickEvent(this, p->width),
|
2006-04-23 00:45:01 +02:00
|
|
|
#else
|
2006-10-31 20:33:56 +01:00
|
|
|
: BaseCPU(p), thread(this, 0, p->workload[0], 0),
|
2006-06-23 05:33:26 +02:00
|
|
|
tickEvent(this, p->width),
|
2006-04-23 00:45:01 +02:00
|
|
|
#endif
|
2006-10-31 20:33:56 +01:00
|
|
|
comm(5, 5)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
frontEnd = new FrontEnd(p);
|
|
|
|
backEnd = new BackEnd(p);
|
|
|
|
|
|
|
|
_status = Idle;
|
2006-05-23 22:51:16 +02:00
|
|
|
|
|
|
|
if (p->checker) {
|
2006-10-02 17:58:09 +02:00
|
|
|
#if USE_CHECKER
|
2006-05-23 22:51:16 +02:00
|
|
|
BaseCPU *temp_checker = p->checker;
|
|
|
|
checker = dynamic_cast<Checker<DynInstPtr> *>(temp_checker);
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
#if FULL_SYSTEM
|
|
|
|
checker->setSystem(p->system);
|
|
|
|
#endif
|
2006-06-06 23:32:21 +02:00
|
|
|
checkerTC = new CheckerThreadContext<OzoneTC>(&ozoneTC, checker);
|
|
|
|
thread.tc = checkerTC;
|
2006-06-23 05:33:26 +02:00
|
|
|
tc = checkerTC;
|
|
|
|
#else
|
|
|
|
panic("Checker enabled but not compiled in!");
|
|
|
|
#endif
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
} else {
|
2006-08-02 18:05:34 +02:00
|
|
|
// If checker is not being used, then the xcProxy points
|
|
|
|
// directly to the CPU's ExecContext.
|
2006-05-23 22:51:16 +02:00
|
|
|
checker = NULL;
|
2006-06-06 23:32:21 +02:00
|
|
|
thread.tc = &ozoneTC;
|
|
|
|
tc = &ozoneTC;
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
}
|
2006-04-23 00:45:01 +02:00
|
|
|
|
2006-06-06 23:32:21 +02:00
|
|
|
ozoneTC.cpu = this;
|
|
|
|
ozoneTC.thread = &thread;
|
2006-04-23 00:45:01 +02:00
|
|
|
|
2006-05-23 22:51:16 +02:00
|
|
|
thread.inSyscall = false;
|
|
|
|
|
2006-06-06 23:32:21 +02:00
|
|
|
thread.setStatus(ThreadContext::Suspended);
|
2006-04-23 00:45:01 +02:00
|
|
|
#if FULL_SYSTEM
|
2006-08-02 18:05:34 +02:00
|
|
|
// Setup thread state stuff.
|
2006-04-23 00:45:01 +02:00
|
|
|
thread.cpu = this;
|
2006-06-23 05:33:26 +02:00
|
|
|
thread.setTid(0);
|
2006-04-23 00:45:01 +02:00
|
|
|
|
2006-06-06 23:32:21 +02:00
|
|
|
thread.quiesceEvent = new EndQuiesceEvent(tc);
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
system = p->system;
|
|
|
|
itb = p->itb;
|
|
|
|
dtb = p->dtb;
|
|
|
|
physmem = p->system->physmem;
|
|
|
|
|
|
|
|
if (p->profile) {
|
|
|
|
thread.profile = new FunctionProfile(p->system->kernelSymtab);
|
2006-06-06 23:32:21 +02:00
|
|
|
// @todo: This might be better as an ThreadContext instead of OzoneTC
|
2006-04-23 00:45:01 +02:00
|
|
|
Callback *cb =
|
2006-06-06 23:32:21 +02:00
|
|
|
new MakeCallback<OzoneTC,
|
|
|
|
&OzoneTC::dumpFuncProfile>(&ozoneTC);
|
2006-04-23 00:45:01 +02:00
|
|
|
registerExitCallback(cb);
|
|
|
|
}
|
|
|
|
|
|
|
|
// let's fill with a dummy node for now so we don't get a segfault
|
|
|
|
// on the first cycle when there's no node available.
|
|
|
|
static ProfileNode dummyNode;
|
|
|
|
thread.profileNode = &dummyNode;
|
|
|
|
thread.profilePC = 3;
|
|
|
|
#else
|
|
|
|
thread.cpu = this;
|
|
|
|
#endif // !FULL_SYSTEM
|
2006-05-23 22:51:16 +02:00
|
|
|
|
2006-04-23 00:45:01 +02:00
|
|
|
numInst = 0;
|
|
|
|
startNumInst = 0;
|
|
|
|
|
2006-06-06 23:32:21 +02:00
|
|
|
threadContexts.push_back(tc);
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
frontEnd->setCPU(this);
|
|
|
|
backEnd->setCPU(this);
|
|
|
|
|
2006-06-06 23:32:21 +02:00
|
|
|
frontEnd->setTC(tc);
|
|
|
|
backEnd->setTC(tc);
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
frontEnd->setThreadState(&thread);
|
|
|
|
backEnd->setThreadState(&thread);
|
|
|
|
|
|
|
|
frontEnd->setCommBuffer(&comm);
|
|
|
|
backEnd->setCommBuffer(&comm);
|
|
|
|
|
|
|
|
frontEnd->setBackEnd(backEnd);
|
|
|
|
backEnd->setFrontEnd(frontEnd);
|
|
|
|
|
|
|
|
globalSeqNum = 1;
|
|
|
|
|
2006-08-02 18:05:34 +02:00
|
|
|
lockFlag = 0;
|
2006-04-23 00:45:01 +02:00
|
|
|
|
2006-08-02 18:05:34 +02:00
|
|
|
// Setup rename table, initializing all values to ready.
|
2006-04-23 00:45:01 +02:00
|
|
|
for (int i = 0; i < TheISA::TotalNumRegs; ++i) {
|
|
|
|
thread.renameTable[i] = new DynInst(this);
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
thread.renameTable[i]->setResultReady();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
frontEnd->renameTable.copyFrom(thread.renameTable);
|
|
|
|
backEnd->renameTable.copyFrom(thread.renameTable);
|
|
|
|
|
2006-10-31 20:33:56 +01:00
|
|
|
#if FULL_SYSTEM
|
2006-06-25 06:22:41 +02:00
|
|
|
Port *mem_port;
|
|
|
|
FunctionalPort *phys_port;
|
|
|
|
VirtualPort *virt_port;
|
|
|
|
phys_port = new FunctionalPort(csprintf("%s-%d-funcport",
|
|
|
|
name(), 0));
|
|
|
|
mem_port = system->physmem->getPort("functional");
|
|
|
|
mem_port->setPeer(phys_port);
|
|
|
|
phys_port->setPeer(mem_port);
|
|
|
|
|
|
|
|
virt_port = new VirtualPort(csprintf("%s-%d-vport",
|
|
|
|
name(), 0));
|
|
|
|
mem_port = system->physmem->getPort("functional");
|
|
|
|
mem_port->setPeer(virt_port);
|
|
|
|
virt_port->setPeer(mem_port);
|
|
|
|
|
|
|
|
thread.setPhysPort(phys_port);
|
|
|
|
thread.setVirtPort(virt_port);
|
2006-04-23 00:45:01 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
DPRINTF(OzoneCPU, "OzoneCPU: Created Ozone cpu object.\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
OzoneCPU<Impl>::~OzoneCPU()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-07-06 03:14:36 +02:00
|
|
|
OzoneCPU<Impl>::switchOut()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-10-02 17:58:09 +02:00
|
|
|
BaseCPU::switchOut();
|
2006-05-16 20:09:04 +02:00
|
|
|
switchCount = 0;
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
// Front end needs state from back end, so switch out the back end first.
|
|
|
|
backEnd->switchOut();
|
|
|
|
frontEnd->switchOut();
|
2006-05-16 20:09:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::signalSwitched()
|
|
|
|
{
|
2006-08-02 18:05:34 +02:00
|
|
|
// Only complete the switchout when both the front end and back
|
|
|
|
// end have signalled they are ready to switch.
|
2006-05-16 20:09:04 +02:00
|
|
|
if (++switchCount == 2) {
|
|
|
|
backEnd->doSwitchOut();
|
|
|
|
frontEnd->doSwitchOut();
|
2006-06-23 05:33:26 +02:00
|
|
|
#if USE_CHECKER
|
2006-05-16 20:09:04 +02:00
|
|
|
if (checker)
|
2006-07-06 03:14:36 +02:00
|
|
|
checker->switchOut();
|
2006-06-23 05:33:26 +02:00
|
|
|
#endif
|
|
|
|
|
2006-05-16 20:09:04 +02:00
|
|
|
_status = SwitchedOut;
|
2006-08-24 23:29:34 +02:00
|
|
|
#ifndef NDEBUG
|
|
|
|
// Loop through all registers
|
|
|
|
for (int i = 0; i < AlphaISA::TotalNumRegs; ++i) {
|
|
|
|
assert(thread.renameTable[i] == frontEnd->renameTable[i]);
|
|
|
|
|
|
|
|
assert(thread.renameTable[i] == backEnd->renameTable[i]);
|
|
|
|
|
|
|
|
DPRINTF(OzoneCPU, "Checking if register %i matches.\n", i);
|
|
|
|
}
|
|
|
|
#endif
|
2006-08-02 18:05:34 +02:00
|
|
|
|
2006-05-16 20:09:04 +02:00
|
|
|
if (tickEvent.scheduled())
|
|
|
|
tickEvent.squash();
|
|
|
|
}
|
|
|
|
assert(switchCount <= 2);
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::takeOverFrom(BaseCPU *oldCPU)
|
|
|
|
{
|
|
|
|
BaseCPU::takeOverFrom(oldCPU);
|
|
|
|
|
2006-08-11 23:42:59 +02:00
|
|
|
thread.trapPending = false;
|
|
|
|
thread.inSyscall = false;
|
|
|
|
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
backEnd->takeOverFrom();
|
|
|
|
frontEnd->takeOverFrom();
|
2006-09-28 06:14:15 +02:00
|
|
|
frontEnd->renameTable.copyFrom(thread.renameTable);
|
|
|
|
backEnd->renameTable.copyFrom(thread.renameTable);
|
2006-04-23 00:45:01 +02:00
|
|
|
assert(!tickEvent.scheduled());
|
|
|
|
|
2006-08-24 23:29:34 +02:00
|
|
|
#ifndef NDEBUG
|
|
|
|
// Check rename table.
|
|
|
|
for (int i = 0; i < TheISA::TotalNumRegs; ++i) {
|
|
|
|
assert(thread.renameTable[i]->isResultReady());
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
// @todo: Fix hardcoded number
|
|
|
|
// Clear out any old information in time buffer.
|
2006-08-24 23:29:34 +02:00
|
|
|
for (int i = 0; i < 15; ++i) {
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
comm.advance();
|
|
|
|
}
|
|
|
|
|
2006-06-06 23:32:21 +02:00
|
|
|
// if any of this CPU's ThreadContexts are active, mark the CPU as
|
2006-04-23 00:45:01 +02:00
|
|
|
// running and schedule its tick event.
|
2006-06-06 23:32:21 +02:00
|
|
|
for (int i = 0; i < threadContexts.size(); ++i) {
|
|
|
|
ThreadContext *tc = threadContexts[i];
|
|
|
|
if (tc->status() == ThreadContext::Active &&
|
2006-04-23 00:45:01 +02:00
|
|
|
_status != Running) {
|
|
|
|
_status = Running;
|
|
|
|
tickEvent.schedule(curTick);
|
|
|
|
}
|
|
|
|
}
|
2006-05-16 20:09:04 +02:00
|
|
|
// Nothing running, change status to reflect that we're no longer
|
|
|
|
// switched out.
|
|
|
|
if (_status == SwitchedOut) {
|
|
|
|
_status = Idle;
|
|
|
|
}
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::activateContext(int thread_num, int delay)
|
|
|
|
{
|
|
|
|
// Eventually change this in SMT.
|
|
|
|
assert(thread_num == 0);
|
|
|
|
|
|
|
|
assert(_status == Idle);
|
|
|
|
notIdleFraction++;
|
|
|
|
scheduleTickEvent(delay);
|
|
|
|
_status = Running;
|
2006-08-24 23:29:34 +02:00
|
|
|
#if FULL_SYSTEM
|
2006-08-11 23:42:59 +02:00
|
|
|
if (thread.quiesceEvent && thread.quiesceEvent->scheduled())
|
|
|
|
thread.quiesceEvent->deschedule();
|
2006-08-24 23:29:34 +02:00
|
|
|
#endif
|
2006-06-23 05:33:26 +02:00
|
|
|
thread.setStatus(ThreadContext::Active);
|
2006-04-24 23:10:06 +02:00
|
|
|
frontEnd->wakeFromQuiesce();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::suspendContext(int thread_num)
|
|
|
|
{
|
|
|
|
// Eventually change this in SMT.
|
|
|
|
assert(thread_num == 0);
|
2006-05-23 22:51:16 +02:00
|
|
|
// @todo: Figure out how to initially set the status properly so
|
|
|
|
// this is running.
|
2006-04-24 23:10:06 +02:00
|
|
|
// assert(_status == Running);
|
2006-04-23 00:45:01 +02:00
|
|
|
notIdleFraction--;
|
|
|
|
unscheduleTickEvent();
|
|
|
|
_status = Idle;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-07-10 22:31:42 +02:00
|
|
|
OzoneCPU<Impl>::deallocateContext(int thread_num, int delay)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
// for now, these are equivalent
|
|
|
|
suspendContext(thread_num);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::haltContext(int thread_num)
|
|
|
|
{
|
|
|
|
// for now, these are equivalent
|
|
|
|
suspendContext(thread_num);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::regStats()
|
|
|
|
{
|
|
|
|
using namespace Stats;
|
|
|
|
|
|
|
|
BaseCPU::regStats();
|
|
|
|
|
|
|
|
thread.numInsts
|
|
|
|
.name(name() + ".num_insts")
|
|
|
|
.desc("Number of instructions executed")
|
|
|
|
;
|
|
|
|
|
|
|
|
thread.numMemRefs
|
|
|
|
.name(name() + ".num_refs")
|
|
|
|
.desc("Number of memory references")
|
|
|
|
;
|
|
|
|
|
|
|
|
notIdleFraction
|
|
|
|
.name(name() + ".not_idle_fraction")
|
|
|
|
.desc("Percentage of non-idle cycles")
|
|
|
|
;
|
|
|
|
|
|
|
|
idleFraction
|
|
|
|
.name(name() + ".idle_fraction")
|
|
|
|
.desc("Percentage of idle cycles")
|
|
|
|
;
|
|
|
|
|
2006-04-24 23:40:00 +02:00
|
|
|
quiesceCycles
|
|
|
|
.name(name() + ".quiesce_cycles")
|
|
|
|
.desc("Number of cycles spent in quiesce")
|
|
|
|
;
|
|
|
|
|
2006-04-23 00:45:01 +02:00
|
|
|
idleFraction = constant(1.0) - notIdleFraction;
|
|
|
|
|
|
|
|
frontEnd->regStats();
|
|
|
|
backEnd->regStats();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::resetStats()
|
|
|
|
{
|
2006-08-24 23:29:34 +02:00
|
|
|
// startNumInst = numInst;
|
2006-04-23 00:45:01 +02:00
|
|
|
notIdleFraction = (_status != Idle);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::init()
|
|
|
|
{
|
|
|
|
BaseCPU::init();
|
|
|
|
|
|
|
|
// Mark this as in syscall so it won't need to squash
|
|
|
|
thread.inSyscall = true;
|
|
|
|
#if FULL_SYSTEM
|
2006-06-06 23:32:21 +02:00
|
|
|
for (int i = 0; i < threadContexts.size(); ++i) {
|
|
|
|
ThreadContext *tc = threadContexts[i];
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
// initialize CPU, including PC
|
2006-06-06 23:32:21 +02:00
|
|
|
TheISA::initCPU(tc, tc->readCpuId());
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
frontEnd->renameTable.copyFrom(thread.renameTable);
|
|
|
|
backEnd->renameTable.copyFrom(thread.renameTable);
|
|
|
|
|
|
|
|
thread.inSyscall = false;
|
|
|
|
}
|
|
|
|
|
2006-07-08 00:24:13 +02:00
|
|
|
template <class Impl>
|
|
|
|
Port *
|
|
|
|
OzoneCPU<Impl>::getPort(const std::string &if_name, int idx)
|
|
|
|
{
|
|
|
|
if (if_name == "dcache_port")
|
|
|
|
return backEnd->getDcachePort();
|
|
|
|
else if (if_name == "icache_port")
|
|
|
|
return frontEnd->getIcachePort();
|
|
|
|
else
|
|
|
|
panic("No Such Port\n");
|
|
|
|
}
|
|
|
|
|
2006-04-23 00:45:01 +02:00
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::serialize(std::ostream &os)
|
|
|
|
{
|
|
|
|
BaseCPU::serialize(os);
|
|
|
|
SERIALIZE_ENUM(_status);
|
2006-06-06 23:32:21 +02:00
|
|
|
nameOut(os, csprintf("%s.tc", name()));
|
|
|
|
ozoneTC.serialize(os);
|
2006-04-23 00:45:01 +02:00
|
|
|
nameOut(os, csprintf("%s.tickEvent", name()));
|
|
|
|
tickEvent.serialize(os);
|
2006-08-11 23:42:59 +02:00
|
|
|
|
|
|
|
// Use SimpleThread's ability to checkpoint to make it easier to
|
|
|
|
// write out the registers. Also make this static so it doesn't
|
|
|
|
// get instantiated multiple times (causes a panic in statistics).
|
2006-10-02 17:58:09 +02:00
|
|
|
static SimpleThread temp;
|
2006-08-11 23:42:59 +02:00
|
|
|
|
|
|
|
nameOut(os, csprintf("%s.xc.0", name()));
|
2006-10-02 17:58:09 +02:00
|
|
|
temp.copyTC(thread.getTC());
|
2006-08-11 23:42:59 +02:00
|
|
|
temp.serialize(os);
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::unserialize(Checkpoint *cp, const std::string §ion)
|
|
|
|
{
|
|
|
|
BaseCPU::unserialize(cp, section);
|
|
|
|
UNSERIALIZE_ENUM(_status);
|
2006-06-06 23:32:21 +02:00
|
|
|
ozoneTC.unserialize(cp, csprintf("%s.tc", section));
|
2006-04-23 00:45:01 +02:00
|
|
|
tickEvent.unserialize(cp, csprintf("%s.tickEvent", section));
|
2006-08-11 23:42:59 +02:00
|
|
|
|
|
|
|
// Use SimpleThread's ability to checkpoint to make it easier to
|
|
|
|
// read in the registers. Also make this static so it doesn't
|
|
|
|
// get instantiated multiple times (causes a panic in statistics).
|
2006-10-02 17:58:09 +02:00
|
|
|
static SimpleThread temp;
|
2006-08-11 23:42:59 +02:00
|
|
|
|
2006-10-02 17:58:09 +02:00
|
|
|
temp.copyTC(thread.getTC());
|
2006-08-11 23:42:59 +02:00
|
|
|
temp.unserialize(cp, csprintf("%s.xc.0", section));
|
2006-10-02 17:58:09 +02:00
|
|
|
thread.getTC()->copyArchRegs(temp.getTC());
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
Fault
|
|
|
|
OzoneCPU<Impl>::copySrcTranslate(Addr src)
|
|
|
|
{
|
|
|
|
panic("Copy not implemented!\n");
|
|
|
|
return NoFault;
|
|
|
|
#if 0
|
|
|
|
static bool no_warn = true;
|
|
|
|
int blk_size = (dcacheInterface) ? dcacheInterface->getBlockSize() : 64;
|
|
|
|
// Only support block sizes of 64 atm.
|
|
|
|
assert(blk_size == 64);
|
|
|
|
int offset = src & (blk_size - 1);
|
|
|
|
|
|
|
|
// Make sure block doesn't span page
|
|
|
|
if (no_warn &&
|
|
|
|
(src & TheISA::PageMask) != ((src + blk_size) & TheISA::PageMask) &&
|
|
|
|
(src >> 40) != 0xfffffc) {
|
|
|
|
warn("Copied block source spans pages %x.", src);
|
|
|
|
no_warn = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
memReq->reset(src & ~(blk_size - 1), blk_size);
|
|
|
|
|
|
|
|
// translate to physical address
|
2006-06-06 23:32:21 +02:00
|
|
|
Fault fault = tc->translateDataReadReq(memReq);
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
assert(fault != Alignment_Fault);
|
|
|
|
|
|
|
|
if (fault == NoFault) {
|
2006-06-06 23:32:21 +02:00
|
|
|
tc->copySrcAddr = src;
|
|
|
|
tc->copySrcPhysAddr = memReq->paddr + offset;
|
2006-04-23 00:45:01 +02:00
|
|
|
} else {
|
2006-06-06 23:32:21 +02:00
|
|
|
tc->copySrcAddr = 0;
|
|
|
|
tc->copySrcPhysAddr = 0;
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
return fault;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
Fault
|
|
|
|
OzoneCPU<Impl>::copy(Addr dest)
|
|
|
|
{
|
|
|
|
panic("Copy not implemented!\n");
|
|
|
|
return NoFault;
|
|
|
|
#if 0
|
|
|
|
static bool no_warn = true;
|
|
|
|
int blk_size = (dcacheInterface) ? dcacheInterface->getBlockSize() : 64;
|
|
|
|
// Only support block sizes of 64 atm.
|
|
|
|
assert(blk_size == 64);
|
|
|
|
uint8_t data[blk_size];
|
2006-06-06 23:32:21 +02:00
|
|
|
//assert(tc->copySrcAddr);
|
2006-04-23 00:45:01 +02:00
|
|
|
int offset = dest & (blk_size - 1);
|
|
|
|
|
|
|
|
// Make sure block doesn't span page
|
|
|
|
if (no_warn &&
|
|
|
|
(dest & TheISA::PageMask) != ((dest + blk_size) & TheISA::PageMask) &&
|
|
|
|
(dest >> 40) != 0xfffffc) {
|
|
|
|
no_warn = false;
|
|
|
|
warn("Copied block destination spans pages %x. ", dest);
|
|
|
|
}
|
|
|
|
|
|
|
|
memReq->reset(dest & ~(blk_size -1), blk_size);
|
|
|
|
// translate to physical address
|
2006-06-06 23:32:21 +02:00
|
|
|
Fault fault = tc->translateDataWriteReq(memReq);
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
assert(fault != Alignment_Fault);
|
|
|
|
|
|
|
|
if (fault == NoFault) {
|
|
|
|
Addr dest_addr = memReq->paddr + offset;
|
|
|
|
// Need to read straight from memory since we have more than 8 bytes.
|
2006-06-06 23:32:21 +02:00
|
|
|
memReq->paddr = tc->copySrcPhysAddr;
|
|
|
|
tc->mem->read(memReq, data);
|
2006-04-23 00:45:01 +02:00
|
|
|
memReq->paddr = dest_addr;
|
2006-06-06 23:32:21 +02:00
|
|
|
tc->mem->write(memReq, data);
|
2006-04-23 00:45:01 +02:00
|
|
|
if (dcacheInterface) {
|
|
|
|
memReq->cmd = Copy;
|
|
|
|
memReq->completionEvent = NULL;
|
2006-06-06 23:32:21 +02:00
|
|
|
memReq->paddr = tc->copySrcPhysAddr;
|
2006-04-23 00:45:01 +02:00
|
|
|
memReq->dest = dest_addr;
|
|
|
|
memReq->size = 64;
|
|
|
|
memReq->time = curTick;
|
|
|
|
dcacheInterface->access(memReq);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return fault;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#if FULL_SYSTEM
|
|
|
|
template <class Impl>
|
|
|
|
Addr
|
|
|
|
OzoneCPU<Impl>::dbg_vtophys(Addr addr)
|
|
|
|
{
|
2006-06-23 05:33:26 +02:00
|
|
|
return vtophys(tc, addr);
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
#endif // FULL_SYSTEM
|
|
|
|
|
|
|
|
#if FULL_SYSTEM
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::post_interrupt(int int_num, int index)
|
|
|
|
{
|
|
|
|
BaseCPU::post_interrupt(int_num, index);
|
|
|
|
|
2006-04-24 23:40:00 +02:00
|
|
|
if (_status == Idle) {
|
2006-04-23 00:45:01 +02:00
|
|
|
DPRINTF(IPI,"Suspended Processor awoke\n");
|
|
|
|
// thread.activate();
|
2006-06-06 23:32:21 +02:00
|
|
|
// Hack for now. Otherwise might have to go through the tc, or
|
2006-04-23 00:45:01 +02:00
|
|
|
// I need to figure out what's the right thing to call.
|
2006-06-23 05:33:26 +02:00
|
|
|
activateContext(thread.readTid(), 1);
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif // FULL_SYSTEM
|
|
|
|
|
|
|
|
/* start simulation, program loaded, processor precise state initialized */
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::tick()
|
|
|
|
{
|
|
|
|
DPRINTF(OzoneCPU, "\n\nOzoneCPU: Ticking cpu.\n");
|
|
|
|
|
2006-04-24 23:10:06 +02:00
|
|
|
_status = Running;
|
2006-04-23 00:45:01 +02:00
|
|
|
thread.renameTable[ZeroReg]->setIntResult(0);
|
|
|
|
thread.renameTable[ZeroReg+TheISA::FP_Base_DepTag]->
|
|
|
|
setDoubleResult(0.0);
|
|
|
|
|
|
|
|
comm.advance();
|
|
|
|
frontEnd->tick();
|
|
|
|
backEnd->tick();
|
|
|
|
|
|
|
|
// check for instruction-count-based events
|
|
|
|
comInstEventQueue[0]->serviceEvents(numInst);
|
|
|
|
|
2006-04-24 23:10:06 +02:00
|
|
|
if (!tickEvent.scheduled() && _status == Running)
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
tickEvent.schedule(curTick + cycles(1));
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::squashFromTC()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
thread.inSyscall = true;
|
2006-06-06 23:32:21 +02:00
|
|
|
backEnd->generateTCEvent();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#if !FULL_SYSTEM
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-23 05:33:26 +02:00
|
|
|
OzoneCPU<Impl>::syscall(uint64_t &callnum)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-06-06 23:32:21 +02:00
|
|
|
// Not sure this copy is needed, depending on how the TC proxy is made.
|
2006-04-23 00:45:01 +02:00
|
|
|
thread.renameTable.copyFrom(backEnd->renameTable);
|
|
|
|
|
|
|
|
thread.inSyscall = true;
|
|
|
|
|
|
|
|
thread.funcExeInst++;
|
|
|
|
|
|
|
|
DPRINTF(OzoneCPU, "FuncExeInst: %i\n", thread.funcExeInst);
|
|
|
|
|
2006-06-23 05:33:26 +02:00
|
|
|
thread.process->syscall(callnum, tc);
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
thread.funcExeInst--;
|
|
|
|
|
|
|
|
thread.inSyscall = false;
|
|
|
|
|
|
|
|
frontEnd->renameTable.copyFrom(thread.renameTable);
|
|
|
|
backEnd->renameTable.copyFrom(thread.renameTable);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::setSyscallReturn(SyscallReturn return_value, int tid)
|
|
|
|
{
|
|
|
|
// check for error condition. Alpha syscall convention is to
|
|
|
|
// indicate success/failure in reg a3 (r19) and put the
|
|
|
|
// return value itself in the standard return value reg (v0).
|
|
|
|
if (return_value.successful()) {
|
|
|
|
// no error
|
|
|
|
thread.renameTable[SyscallSuccessReg]->setIntResult(0);
|
2006-05-23 22:51:16 +02:00
|
|
|
thread.renameTable[ReturnValueReg]->setIntResult(
|
|
|
|
return_value.value());
|
2006-04-23 00:45:01 +02:00
|
|
|
} else {
|
|
|
|
// got an error, return details
|
|
|
|
thread.renameTable[SyscallSuccessReg]->setIntResult((IntReg) -1);
|
2006-05-23 22:51:16 +02:00
|
|
|
thread.renameTable[ReturnValueReg]->setIntResult(
|
|
|
|
-return_value.value());
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
template <class Impl>
|
|
|
|
Fault
|
|
|
|
OzoneCPU<Impl>::hwrei()
|
|
|
|
{
|
|
|
|
// Need to move this to ISA code
|
|
|
|
// May also need to make this per thread
|
|
|
|
|
2006-04-24 23:10:06 +02:00
|
|
|
lockFlag = false;
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
lockAddrList.clear();
|
2006-05-23 22:51:16 +02:00
|
|
|
thread.kernelStats->hwrei();
|
2006-04-24 23:10:06 +02:00
|
|
|
|
2006-04-23 00:45:01 +02:00
|
|
|
// FIXME: XXX check for interrupts? XXX
|
|
|
|
return NoFault;
|
|
|
|
}
|
|
|
|
|
2006-04-23 01:10:39 +02:00
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::processInterrupts()
|
|
|
|
{
|
|
|
|
// Check for interrupts here. For now can copy the code that
|
|
|
|
// exists within isa_fullsys_traits.hh. Also assume that thread 0
|
|
|
|
// is the one that handles the interrupts.
|
|
|
|
|
|
|
|
// Check if there are any outstanding interrupts
|
|
|
|
//Handle the interrupts
|
2006-11-13 02:15:30 +01:00
|
|
|
Fault interrupt = this->interrupts.getInterrupt(thread.getTC());
|
2006-04-23 01:10:39 +02:00
|
|
|
|
2006-11-13 02:15:30 +01:00
|
|
|
if (interrupt != NoFault) {
|
|
|
|
this->interrupts.updateIntrInfo(thread.getTC());
|
|
|
|
interrupt->invoke(thread.getTC());
|
2006-04-23 01:10:39 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-04-23 00:45:01 +02:00
|
|
|
template <class Impl>
|
|
|
|
bool
|
|
|
|
OzoneCPU<Impl>::simPalCheck(int palFunc)
|
|
|
|
{
|
|
|
|
// Need to move this to ISA code
|
|
|
|
// May also need to make this per thread
|
2006-06-06 23:32:21 +02:00
|
|
|
thread.kernelStats->callpal(palFunc, tc);
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
switch (palFunc) {
|
|
|
|
case PAL::halt:
|
2006-06-23 05:33:26 +02:00
|
|
|
haltContext(thread.readTid());
|
2006-04-23 00:45:01 +02:00
|
|
|
if (--System::numSystemsRunning == 0)
|
2006-06-23 05:33:26 +02:00
|
|
|
exitSimLoop("all cpus halted");
|
2006-04-23 00:45:01 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PAL::bpt:
|
|
|
|
case PAL::bugchk:
|
|
|
|
if (system->breakpoint())
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
BaseCPU *
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::getCpuPtr()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
return cpu;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::setCpuId(int id)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
cpu->cpuId = id;
|
2006-06-23 05:33:26 +02:00
|
|
|
thread->setCpuId(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
#if FULL_SYSTEM
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::OzoneTC::delVirtPort(VirtualPort *vp)
|
|
|
|
{
|
|
|
|
delete vp->getPeer();
|
|
|
|
delete vp;
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
2006-06-23 05:33:26 +02:00
|
|
|
#endif
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::setStatus(Status new_status)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-06-23 05:33:26 +02:00
|
|
|
thread->setStatus(new_status);
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::activate(int delay)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-06-23 05:33:26 +02:00
|
|
|
cpu->activateContext(thread->readTid(), delay);
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Set the status to Suspended.
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::suspend()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-06-23 05:33:26 +02:00
|
|
|
cpu->suspendContext(thread->readTid());
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Set the status to Unallocated.
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-07-10 22:31:42 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::deallocate(int delay)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-07-10 22:31:42 +02:00
|
|
|
cpu->deallocateContext(thread->readTid(), delay);
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Set the status to Halted.
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::halt()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-06-23 05:33:26 +02:00
|
|
|
cpu->haltContext(thread->readTid());
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#if FULL_SYSTEM
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::dumpFuncProfile()
|
2006-08-24 23:29:34 +02:00
|
|
|
{
|
|
|
|
thread->dumpFuncProfile();
|
|
|
|
}
|
2006-04-23 00:45:01 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::takeOverFrom(ThreadContext *old_context)
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
{
|
|
|
|
// some things should already be set up
|
|
|
|
#if FULL_SYSTEM
|
|
|
|
assert(getSystemPtr() == old_context->getSystemPtr());
|
|
|
|
#else
|
|
|
|
assert(getProcessPtr() == old_context->getProcessPtr());
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// copy over functional state
|
|
|
|
setStatus(old_context->status());
|
|
|
|
copyArchRegs(old_context);
|
|
|
|
setCpuId(old_context->readCpuId());
|
2006-05-23 22:51:16 +02:00
|
|
|
|
2006-10-02 17:58:09 +02:00
|
|
|
thread->setInst(old_context->getInst());
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
#if !FULL_SYSTEM
|
|
|
|
setFuncExeInst(old_context->readFuncExeInst());
|
2006-05-19 20:27:46 +02:00
|
|
|
#else
|
2006-05-16 20:09:04 +02:00
|
|
|
EndQuiesceEvent *other_quiesce = old_context->getQuiesceEvent();
|
|
|
|
if (other_quiesce) {
|
2006-06-06 23:32:21 +02:00
|
|
|
// Point the quiesce event's TC at this TC so that it wakes up
|
2006-05-16 20:09:04 +02:00
|
|
|
// the proper CPU.
|
2006-06-06 23:32:21 +02:00
|
|
|
other_quiesce->tc = this;
|
2006-05-16 20:09:04 +02:00
|
|
|
}
|
|
|
|
if (thread->quiesceEvent) {
|
2006-06-06 23:32:21 +02:00
|
|
|
thread->quiesceEvent->tc = this;
|
2006-05-16 20:09:04 +02:00
|
|
|
}
|
2006-05-23 22:51:16 +02:00
|
|
|
|
2006-08-02 18:05:34 +02:00
|
|
|
// Copy kernel stats pointer from old context.
|
2006-05-23 22:51:16 +02:00
|
|
|
thread->kernelStats = old_context->getKernelStats();
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
// storeCondFailures = 0;
|
|
|
|
cpu->lockFlag = false;
|
2006-05-19 20:27:46 +02:00
|
|
|
#endif
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
|
2006-06-06 23:32:21 +02:00
|
|
|
old_context->setStatus(ThreadContext::Unallocated);
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
}
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::regStats(const std::string &name)
|
2006-05-23 22:51:16 +02:00
|
|
|
{
|
|
|
|
#if FULL_SYSTEM
|
2006-11-07 11:36:54 +01:00
|
|
|
thread->kernelStats = new TheISA::Kernel::Statistics(cpu->system);
|
2006-05-23 22:51:16 +02:00
|
|
|
thread->kernelStats->regStats(name + ".kern");
|
|
|
|
#endif
|
|
|
|
}
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::serialize(std::ostream &os)
|
2006-08-02 18:05:34 +02:00
|
|
|
{
|
|
|
|
// Once serialization is added, serialize the quiesce event and
|
|
|
|
// kernel stats. Will need to make sure there aren't multiple
|
|
|
|
// things that serialize them.
|
|
|
|
}
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::unserialize(Checkpoint *cp, const std::string §ion)
|
2006-04-23 00:45:01 +02:00
|
|
|
{ }
|
|
|
|
|
|
|
|
#if FULL_SYSTEM
|
|
|
|
template <class Impl>
|
2006-05-16 20:09:04 +02:00
|
|
|
EndQuiesceEvent *
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::getQuiesceEvent()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
return thread->quiesceEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
Tick
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::readLastActivate()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
return thread->lastActivate;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
Tick
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::readLastSuspend()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
return thread->lastSuspend;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::profileClear()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-08-24 23:29:34 +02:00
|
|
|
thread->profileClear();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::profileSample()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-08-24 23:29:34 +02:00
|
|
|
thread->profileSample();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
int
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::getThreadNum()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-06-23 05:33:26 +02:00
|
|
|
return thread->readTid();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
TheISA::MachInst
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::getInst()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-06-23 05:33:26 +02:00
|
|
|
return thread->getInst();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::copyArchRegs(ThreadContext *tc)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-06-06 23:32:21 +02:00
|
|
|
thread->PC = tc->readPC();
|
|
|
|
thread->nextPC = tc->readNextPC();
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
cpu->frontEnd->setPC(thread->PC);
|
|
|
|
cpu->frontEnd->setNextPC(thread->nextPC);
|
|
|
|
|
2006-08-24 23:29:34 +02:00
|
|
|
// First loop through the integer registers.
|
|
|
|
for (int i = 0; i < TheISA::NumIntRegs; ++i) {
|
|
|
|
/* DPRINTF(OzoneCPU, "Copying over register %i, had data %lli, "
|
|
|
|
"now has data %lli.\n",
|
|
|
|
i, thread->renameTable[i]->readIntResult(),
|
2006-10-01 05:43:23 +02:00
|
|
|
tc->readIntReg(i));
|
2006-08-24 23:29:34 +02:00
|
|
|
*/
|
2006-10-01 05:43:23 +02:00
|
|
|
thread->renameTable[i]->setIntResult(tc->readIntReg(i));
|
2006-08-24 23:29:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Then loop through the floating point registers.
|
|
|
|
for (int i = 0; i < TheISA::NumFloatRegs; ++i) {
|
|
|
|
int fp_idx = i + TheISA::FP_Base_DepTag;
|
2006-10-01 05:43:23 +02:00
|
|
|
thread->renameTable[fp_idx]->setIntResult(tc->readFloatRegBits(i));
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#if !FULL_SYSTEM
|
2006-06-06 23:32:21 +02:00
|
|
|
thread->funcExeInst = tc->readFuncExeInst();
|
2006-04-23 00:45:01 +02:00
|
|
|
#endif
|
|
|
|
|
2006-06-06 23:32:21 +02:00
|
|
|
// Need to copy the TC values into the current rename table,
|
2006-04-23 00:45:01 +02:00
|
|
|
// copy the misc regs.
|
2006-06-23 05:33:26 +02:00
|
|
|
copyMiscRegs(tc, this);
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::clearArchRegs()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
panic("Unimplemented!");
|
|
|
|
}
|
2005-02-26 00:00:49 +01:00
|
|
|
|
|
|
|
template <class Impl>
|
2006-04-23 00:45:01 +02:00
|
|
|
uint64_t
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::readIntReg(int reg_idx)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
return thread->renameTable[reg_idx]->readIntResult();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
2006-06-23 05:33:26 +02:00
|
|
|
TheISA::FloatReg
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::readFloatReg(int reg_idx, int width)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
int idx = reg_idx + TheISA::FP_Base_DepTag;
|
2006-06-03 00:15:20 +02:00
|
|
|
switch(width) {
|
|
|
|
case 32:
|
|
|
|
return thread->renameTable[idx]->readFloatResult();
|
|
|
|
case 64:
|
|
|
|
return thread->renameTable[idx]->readDoubleResult();
|
|
|
|
default:
|
|
|
|
panic("Unsupported width!");
|
|
|
|
return 0;
|
|
|
|
}
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
double
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::readFloatReg(int reg_idx)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
int idx = reg_idx + TheISA::FP_Base_DepTag;
|
2006-06-03 00:15:20 +02:00
|
|
|
return thread->renameTable[idx]->readFloatResult();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
uint64_t
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::readFloatRegBits(int reg_idx, int width)
|
2006-06-03 00:15:20 +02:00
|
|
|
{
|
|
|
|
int idx = reg_idx + TheISA::FP_Base_DepTag;
|
|
|
|
return thread->renameTable[idx]->readIntResult();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
uint64_t
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::readFloatRegBits(int reg_idx)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
int idx = reg_idx + TheISA::FP_Base_DepTag;
|
|
|
|
return thread->renameTable[idx]->readIntResult();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::setIntReg(int reg_idx, uint64_t val)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
thread->renameTable[reg_idx]->setIntResult(val);
|
|
|
|
|
|
|
|
if (!thread->inSyscall) {
|
2006-06-06 23:32:21 +02:00
|
|
|
cpu->squashFromTC();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::setFloatReg(int reg_idx, FloatReg val, int width)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-06-03 00:15:20 +02:00
|
|
|
int idx = reg_idx + TheISA::FP_Base_DepTag;
|
|
|
|
switch(width) {
|
|
|
|
case 32:
|
|
|
|
panic("Unimplemented!");
|
|
|
|
break;
|
|
|
|
case 64:
|
|
|
|
thread->renameTable[idx]->setDoubleResult(val);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
panic("Unsupported width!");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!thread->inSyscall) {
|
2006-06-06 23:32:21 +02:00
|
|
|
cpu->squashFromTC();
|
2006-06-03 00:15:20 +02:00
|
|
|
}
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::setFloatReg(int reg_idx, FloatReg val)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
Fixes for ozone CPU to successfully boot and run linux.
cpu/base_dyn_inst.hh:
Remove snoop function (did not mean to commit it).
cpu/ozone/back_end_impl.hh:
Set instruction as having its result ready, not completed.
cpu/ozone/cpu.hh:
Fixes for store conditionals. Use an additional lock addr list to make sure that the access is valid. I don't know if this is fully necessary, but it gives me a peace of mind (at some performance cost).
Make sure to schedule for cycles(1) and not just 1 cycle in the future as tick = 1ps.
Also support the new Checker.
cpu/ozone/cpu_builder.cc:
Add parameter for maxOutstandingMemOps so it can be set through the config.
Also add in the checker. Right now it's a BaseCPU simobject, but that may change in the future.
cpu/ozone/cpu_impl.hh:
Add support for the checker. For now there's a dynamic cast to convert the simobject passed back from the builder to the proper Checker type. It's ugly, but only happens at startup, and is probably a justified use of dynamic cast.
Support switching out/taking over from other CPUs.
Correct indexing problem for float registers.
cpu/ozone/dyn_inst.hh:
Add ability for instructions to wait on memory instructions in addition to source register instructions. This is needed for memory dependence predictors and memory barriers.
cpu/ozone/dyn_inst_impl.hh:
Support waiting on memory operations.
Use "resultReady" to differentiate an instruction having its registers produced vs being totally completed.
cpu/ozone/front_end.hh:
Support switching out.
Also record if an interrupt is pending.
cpu/ozone/front_end_impl.hh:
Support switching out. Also support stalling the front end if an interrupt is pending.
cpu/ozone/lw_back_end.hh:
Add checker in.
Support switching out.
Support memory barriers.
cpu/ozone/lw_back_end_impl.hh:
Lots of changes to get things to work right.
Faults, traps, interrupts all wait until all stores have written back (important).
Memory barriers are supported, as is the general ability for instructions to be dependent on other memory instructions.
cpu/ozone/lw_lsq.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
cpu/ozone/lw_lsq_impl.hh:
Support switching out.
Also use store writeback events in all cases, not just dcache misses.
Support the checker CPU. Marks instructions as completed once the functional access is done (which has to be done for the checker to be able to verify results).
cpu/ozone/simple_params.hh:
Add max outstanding mem ops parameter.
python/m5/objects/OzoneCPU.py:
Add max outstanding mem ops, checker.
--HG--
extra : convert_revision : f4d408e1bb1f25836a097b6abe3856111e950c59
2006-05-12 01:18:36 +02:00
|
|
|
int idx = reg_idx + TheISA::FP_Base_DepTag;
|
|
|
|
|
|
|
|
thread->renameTable[idx]->setDoubleResult(val);
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
if (!thread->inSyscall) {
|
2006-06-06 23:32:21 +02:00
|
|
|
cpu->squashFromTC();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::setFloatRegBits(int reg_idx, FloatRegBits val,
|
2006-06-03 00:15:20 +02:00
|
|
|
int width)
|
|
|
|
{
|
|
|
|
panic("Unimplemented!");
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::setFloatRegBits(int reg_idx, FloatRegBits val)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
panic("Unimplemented!");
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::setPC(Addr val)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
thread->PC = val;
|
|
|
|
cpu->frontEnd->setPC(val);
|
|
|
|
|
|
|
|
if (!thread->inSyscall) {
|
2006-06-06 23:32:21 +02:00
|
|
|
cpu->squashFromTC();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::setNextPC(Addr val)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
thread->nextPC = val;
|
|
|
|
cpu->frontEnd->setNextPC(val);
|
|
|
|
|
|
|
|
if (!thread->inSyscall) {
|
2006-06-06 23:32:21 +02:00
|
|
|
cpu->squashFromTC();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
TheISA::MiscReg
|
2007-03-07 21:04:31 +01:00
|
|
|
OzoneCPU<Impl>::OzoneTC::readMiscRegNoEffect(int misc_reg)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2007-03-07 21:04:31 +01:00
|
|
|
return thread->miscRegFile.readRegNoEffect(misc_reg);
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
TheISA::MiscReg
|
2007-03-07 21:04:31 +01:00
|
|
|
OzoneCPU<Impl>::OzoneTC::readMiscReg(int misc_reg)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2007-03-07 21:04:31 +01:00
|
|
|
return thread->miscRegFile.readReg(misc_reg, this);
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
2006-11-01 22:44:45 +01:00
|
|
|
void
|
2007-03-07 21:04:31 +01:00
|
|
|
OzoneCPU<Impl>::OzoneTC::setMiscRegNoEffect(int misc_reg, const MiscReg &val)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
// Needs to setup a squash event unless we're in syscall mode
|
2007-03-07 21:04:31 +01:00
|
|
|
thread->miscRegFile.setRegNoEffect(misc_reg, val);
|
2006-04-23 00:45:01 +02:00
|
|
|
|
|
|
|
if (!thread->inSyscall) {
|
2006-06-06 23:32:21 +02:00
|
|
|
cpu->squashFromTC();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
}
|
2005-02-26 00:00:49 +01:00
|
|
|
|
|
|
|
template <class Impl>
|
2006-11-01 22:44:45 +01:00
|
|
|
void
|
2007-03-07 21:04:31 +01:00
|
|
|
OzoneCPU<Impl>::OzoneTC::setMiscReg(int misc_reg, const MiscReg &val)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
// Needs to setup a squash event unless we're in syscall mode
|
2007-03-07 21:04:31 +01:00
|
|
|
thread->miscRegFile.setReg(misc_reg, val, this);
|
2005-02-26 00:00:49 +01:00
|
|
|
|
2006-04-23 00:45:01 +02:00
|
|
|
if (!thread->inSyscall) {
|
2006-06-06 23:32:21 +02:00
|
|
|
cpu->squashFromTC();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
}
|