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-05-23 22:51:16 +02:00
|
|
|
//#include <cstdio>
|
|
|
|
//#include <cstdlib>
|
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 "config/full_system.hh"
|
|
|
|
#include "cpu/base.hh"
|
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
|
|
|
#include "cpu/checker/exec_context.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"
|
2006-05-23 22:51:16 +02:00
|
|
|
//#include "mem/base_mem.hh"
|
2006-04-23 00:45:01 +02:00
|
|
|
#include "mem/mem_interface.hh"
|
|
|
|
#include "sim/sim_object.hh"
|
|
|
|
#include "sim/stats.hh"
|
|
|
|
|
|
|
|
#if FULL_SYSTEM
|
|
|
|
#include "arch/faults.hh"
|
|
|
|
#include "arch/alpha/osfpal.hh"
|
|
|
|
#include "arch/alpha/tlb.hh"
|
|
|
|
#include "arch/vtophys.hh"
|
|
|
|
#include "base/callback.hh"
|
2006-05-23 22:51:16 +02:00
|
|
|
//#include "base/remote_gdb.hh"
|
2006-04-23 00:45:01 +02:00
|
|
|
#include "cpu/profile.hh"
|
|
|
|
#include "kern/kernel_stats.hh"
|
|
|
|
#include "mem/functional/memory_control.hh"
|
|
|
|
#include "mem/functional/physical.hh"
|
|
|
|
#include "sim/faults.hh"
|
|
|
|
#include "sim/sim_events.hh"
|
|
|
|
#include "sim/sim_exit.hh"
|
|
|
|
#include "sim/system.hh"
|
|
|
|
#else // !FULL_SYSTEM
|
|
|
|
#include "mem/functional/functional.hh"
|
|
|
|
#include "sim/process.hh"
|
|
|
|
#endif // FULL_SYSTEM
|
|
|
|
|
|
|
|
using namespace TheISA;
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
template<typename T>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::trace_data(T data) {
|
|
|
|
if (traceData) {
|
|
|
|
traceData->setData(data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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-05-23 22:51:16 +02:00
|
|
|
: BaseCPU(p), thread(this, 0, p->mem), tickEvent(this, p->width),
|
|
|
|
mem(p->mem),
|
2006-04-23 00:45:01 +02:00
|
|
|
#else
|
|
|
|
: BaseCPU(p), thread(this, 0, p->workload[0], 0), tickEvent(this, p->width),
|
2006-04-24 23:10:06 +02:00
|
|
|
mem(p->workload[0]->getMemory()),
|
2006-04-23 00:45:01 +02:00
|
|
|
#endif
|
|
|
|
comm(5, 5)
|
|
|
|
{
|
|
|
|
frontEnd = new FrontEnd(p);
|
|
|
|
backEnd = new BackEnd(p);
|
|
|
|
|
|
|
|
_status = Idle;
|
2006-05-23 22:51:16 +02:00
|
|
|
|
|
|
|
if (p->checker) {
|
|
|
|
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
|
|
|
checker->setMemory(mem);
|
|
|
|
#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;
|
|
|
|
tc = checkerXC;
|
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-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
|
|
|
|
/***** All thread state stuff *****/
|
|
|
|
thread.cpu = this;
|
|
|
|
thread.tid = 0;
|
|
|
|
thread.mem = p->mem;
|
|
|
|
|
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;
|
|
|
|
memctrl = p->system->memctrl;
|
|
|
|
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;
|
|
|
|
thread.tid = 0;
|
|
|
|
thread.process = p->workload[0];
|
|
|
|
thread.asid = 0;
|
|
|
|
#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);
|
|
|
|
|
|
|
|
decoupledFrontEnd = p->decoupledFrontEnd;
|
|
|
|
|
|
|
|
globalSeqNum = 1;
|
|
|
|
|
|
|
|
checkInterrupts = false;
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
#if !FULL_SYSTEM
|
2006-04-24 23:10:06 +02:00
|
|
|
// pTable = p->pTable;
|
2006-04-23 00:45:01 +02:00
|
|
|
#endif
|
|
|
|
|
2006-04-24 23:10:06 +02:00
|
|
|
lockFlag = 0;
|
|
|
|
|
2006-04-23 00:45:01 +02:00
|
|
|
DPRINTF(OzoneCPU, "OzoneCPU: Created Ozone cpu object.\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
OzoneCPU<Impl>::~OzoneCPU()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-05-16 20:09:04 +02:00
|
|
|
OzoneCPU<Impl>::switchOut(Sampler *_sampler)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
2006-05-16 20:09:04 +02:00
|
|
|
sampler = _sampler;
|
|
|
|
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()
|
|
|
|
{
|
|
|
|
if (++switchCount == 2) {
|
|
|
|
backEnd->doSwitchOut();
|
|
|
|
frontEnd->doSwitchOut();
|
|
|
|
if (checker)
|
|
|
|
checker->switchOut(sampler);
|
|
|
|
_status = SwitchedOut;
|
|
|
|
if (tickEvent.scheduled())
|
|
|
|
tickEvent.squash();
|
|
|
|
sampler->signalSwitched();
|
|
|
|
}
|
|
|
|
assert(switchCount <= 2);
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
|
|
|
OzoneCPU<Impl>::takeOverFrom(BaseCPU *oldCPU)
|
|
|
|
{
|
|
|
|
BaseCPU::takeOverFrom(oldCPU);
|
|
|
|
|
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-04-23 00:45:01 +02:00
|
|
|
assert(!tickEvent.scheduled());
|
|
|
|
|
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.
|
|
|
|
for (int i = 0; i < 6; ++i) {
|
|
|
|
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-06-06 23:32:21 +02:00
|
|
|
thread._status = 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
|
|
|
|
OzoneCPU<Impl>::deallocateContext(int thread_num)
|
|
|
|
{
|
|
|
|
// 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()
|
|
|
|
{
|
|
|
|
startNumInst = numInst;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
|
|
|
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-06 23:32:21 +02:00
|
|
|
return vtophys(tcProxy, 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.
|
|
|
|
activateContext(thread.tid, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#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
|
|
|
|
OzoneCPU<Impl>::syscall()
|
|
|
|
{
|
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-06 23:32:21 +02:00
|
|
|
thread.process->syscall(yc);
|
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
|
|
|
|
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
|
|
|
checkInterrupts = true;
|
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
|
|
|
|
int ipl = 0;
|
|
|
|
int summary = 0;
|
|
|
|
|
|
|
|
checkInterrupts = false;
|
|
|
|
|
|
|
|
if (thread.readMiscReg(IPR_ASTRR))
|
|
|
|
panic("asynchronous traps not implemented\n");
|
|
|
|
|
|
|
|
if (thread.readMiscReg(IPR_SIRR)) {
|
|
|
|
for (int i = INTLEVEL_SOFTWARE_MIN;
|
|
|
|
i < INTLEVEL_SOFTWARE_MAX; i++) {
|
|
|
|
if (thread.readMiscReg(IPR_SIRR) & (ULL(1) << i)) {
|
|
|
|
// See table 4-19 of the 21164 hardware reference
|
|
|
|
ipl = (i - INTLEVEL_SOFTWARE_MIN) + 1;
|
|
|
|
summary |= (ULL(1) << i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
uint64_t interrupts = intr_status();
|
|
|
|
|
|
|
|
if (interrupts) {
|
|
|
|
for (int i = INTLEVEL_EXTERNAL_MIN;
|
|
|
|
i < INTLEVEL_EXTERNAL_MAX; i++) {
|
|
|
|
if (interrupts & (ULL(1) << i)) {
|
|
|
|
// See table 4-19 of the 21164 hardware reference
|
|
|
|
ipl = i;
|
|
|
|
summary |= (ULL(1) << i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ipl && ipl > thread.readMiscReg(IPR_IPLR)) {
|
|
|
|
thread.setMiscReg(IPR_ISR, summary);
|
|
|
|
thread.setMiscReg(IPR_INTID, ipl);
|
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: Make this more transparent
|
|
|
|
if (checker) {
|
2006-05-16 20:09:04 +02:00
|
|
|
checker->cpuXCBase()->setMiscReg(IPR_ISR, summary);
|
|
|
|
checker->cpuXCBase()->setMiscReg(IPR_INTID, ipl);
|
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 01:10:39 +02:00
|
|
|
Fault fault = new InterruptFault;
|
2006-06-06 23:32:21 +02:00
|
|
|
fault->invoke(thread.getTC());
|
2006-04-23 01:10:39 +02:00
|
|
|
DPRINTF(Flow, "Interrupt! IPLR=%d ipl=%d summary=%x\n",
|
|
|
|
thread.readMiscReg(IPR_IPLR), ipl, summary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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:
|
|
|
|
haltContext(thread.tid);
|
|
|
|
if (--System::numSystemsRunning == 0)
|
|
|
|
new SimExitEvent("all cpus halted");
|
|
|
|
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;
|
|
|
|
thread->cpuId = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
{
|
|
|
|
thread->_status = new_status;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
{
|
|
|
|
cpu->activateContext(thread->tid, delay);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// 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
|
|
|
{
|
|
|
|
cpu->suspendContext(thread->tid);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Set the status to Unallocated.
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::deallocate()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
cpu->deallocateContext(thread->tid);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// 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
|
|
|
{
|
|
|
|
cpu->haltContext(thread->tid);
|
|
|
|
}
|
|
|
|
|
|
|
|
#if FULL_SYSTEM
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::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
|
|
|
|
assert(getMemPtr() == old_context->getMemPtr());
|
|
|
|
#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
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
|
thread->kernelStats = new Kernel::Statistics(cpu->system);
|
|
|
|
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-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
|
|
|
{
|
|
|
|
if (thread->profile)
|
|
|
|
thread->profile->clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
void
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::profileSample()
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
if (thread->profile)
|
|
|
|
thread->profile->sample(thread->profileNode, thread->profilePC);
|
|
|
|
}
|
|
|
|
#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
|
|
|
{
|
|
|
|
return thread->tid;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Also somewhat obnoxious. Really only used for the TLB fault.
|
|
|
|
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
|
|
|
{
|
|
|
|
return thread->inst;
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
for (int i = 0; i < TheISA::TotalNumRegs; ++i) {
|
|
|
|
if (i < TheISA::FP_Base_DepTag) {
|
2006-06-06 23:32:21 +02:00
|
|
|
thread->renameTable[i]->setIntResult(tc->readIntReg(i));
|
2006-04-23 00:45:01 +02:00
|
|
|
} else if (i < (TheISA::FP_Base_DepTag + TheISA::NumFloatRegs)) {
|
|
|
|
int fp_idx = i - TheISA::FP_Base_DepTag;
|
|
|
|
thread->renameTable[i]->setDoubleResult(
|
2006-06-06 23:32:21 +02:00
|
|
|
tc->readFloatRegDouble(fp_idx));
|
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-06 23:32:21 +02:00
|
|
|
thread->regs.miscRegs.copyMiscRegs(tc);
|
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>
|
|
|
|
float
|
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
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::readMiscReg(int misc_reg)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
return thread->regs.miscRegs.readReg(misc_reg);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
TheISA::MiscReg
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::readMiscRegWithEffect(int misc_reg, Fault &fault)
|
2006-04-23 00:45:01 +02:00
|
|
|
{
|
|
|
|
return thread->regs.miscRegs.readRegWithEffect(misc_reg,
|
|
|
|
fault, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Impl>
|
|
|
|
Fault
|
2006-06-06 23:32:21 +02: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
|
|
|
|
Fault ret_fault = thread->regs.miscRegs.setReg(misc_reg, val);
|
|
|
|
|
|
|
|
if (!thread->inSyscall) {
|
2006-06-06 23:32:21 +02:00
|
|
|
cpu->squashFromTC();
|
2006-04-23 00:45:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret_fault;
|
|
|
|
}
|
2005-02-26 00:00:49 +01:00
|
|
|
|
|
|
|
template <class Impl>
|
2006-04-23 00:45:01 +02:00
|
|
|
Fault
|
2006-06-06 23:32:21 +02:00
|
|
|
OzoneCPU<Impl>::OzoneTC::setMiscRegWithEffect(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
|
|
|
|
Fault ret_fault = thread->regs.miscRegs.setRegWithEffect(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
|
|
|
}
|
2005-02-26 00:00:49 +01:00
|
|
|
|
2006-04-23 00:45:01 +02:00
|
|
|
return ret_fault;
|
|
|
|
}
|