#include "sim/stats.hh"
#include "sim/system.hh"
-using namespace TheISA;
-
BaseSimpleCPU::BaseSimpleCPU(const BaseSimpleCPUParams &p)
: BaseCPU(p),
curThread(0),
// set up memory request for instruction fetch
DPRINTF(Fetch, "Fetch: Inst PC:%08p, Fetch PC:%08p\n", instAddr, fetchPC);
- req->setVirt(fetchPC, sizeof(MachInst), Request::INST_FETCH,
+ req->setVirt(fetchPC, sizeof(TheISA::MachInst), Request::INST_FETCH,
instRequestorId(), instAddr);
}
SimpleThread* thread = t_info.thread;
// maintain $r0 semantics
- thread->setIntReg(ZeroReg, 0);
+ thread->setIntReg(TheISA::ZeroReg, 0);
// resets predicates
t_info.setPredicate(true);
thread->pcState(pcState);
} else {
t_info.stayAtPC = true;
- t_info.fetchOffset += sizeof(MachInst);
+ t_info.fetchOffset += sizeof(TheISA::MachInst);
}
//If we decoded an instruction and it's microcoded, start pulling
void
serialize(const ThreadContext &tc, CheckpointOut &cp)
{
- using namespace TheISA;
-
- RegVal floatRegs[NumFloatRegs];
- for (int i = 0; i < NumFloatRegs; ++i)
+ RegVal floatRegs[TheISA::NumFloatRegs];
+ for (int i = 0; i < TheISA::NumFloatRegs; ++i)
floatRegs[i] = tc.readFloatRegFlat(i);
// This is a bit ugly, but needed to maintain backwards
// compatibility.
- arrayParamOut(cp, "floatRegs.i", floatRegs, NumFloatRegs);
+ arrayParamOut(cp, "floatRegs.i", floatRegs, TheISA::NumFloatRegs);
- std::vector<TheISA::VecRegContainer> vecRegs(NumVecRegs);
- for (int i = 0; i < NumVecRegs; ++i) {
+ std::vector<TheISA::VecRegContainer> vecRegs(TheISA::NumVecRegs);
+ for (int i = 0; i < TheISA::NumVecRegs; ++i) {
vecRegs[i] = tc.readVecRegFlat(i);
}
SERIALIZE_CONTAINER(vecRegs);
- std::vector<TheISA::VecPredRegContainer> vecPredRegs(NumVecPredRegs);
- for (int i = 0; i < NumVecPredRegs; ++i) {
+ std::vector<TheISA::VecPredRegContainer>
+ vecPredRegs(TheISA::NumVecPredRegs);
+ for (int i = 0; i < TheISA::NumVecPredRegs; ++i) {
vecPredRegs[i] = tc.readVecPredRegFlat(i);
}
SERIALIZE_CONTAINER(vecPredRegs);
- RegVal intRegs[NumIntRegs];
- for (int i = 0; i < NumIntRegs; ++i)
+ RegVal intRegs[TheISA::NumIntRegs];
+ for (int i = 0; i < TheISA::NumIntRegs; ++i)
intRegs[i] = tc.readIntRegFlat(i);
- SERIALIZE_ARRAY(intRegs, NumIntRegs);
+ SERIALIZE_ARRAY(intRegs, TheISA::NumIntRegs);
- if (NumCCRegs) {
- RegVal ccRegs[NumCCRegs];
- for (int i = 0; i < NumCCRegs; ++i)
+ if (TheISA::NumCCRegs) {
+ RegVal ccRegs[TheISA::NumCCRegs];
+ for (int i = 0; i < TheISA::NumCCRegs; ++i)
ccRegs[i] = tc.readCCRegFlat(i);
- SERIALIZE_ARRAY(ccRegs, NumCCRegs);
+ SERIALIZE_ARRAY(ccRegs, TheISA::NumCCRegs);
}
tc.pcState().serialize(cp);
void
unserialize(ThreadContext &tc, CheckpointIn &cp)
{
- using namespace TheISA;
-
- RegVal floatRegs[NumFloatRegs];
+ RegVal floatRegs[TheISA::NumFloatRegs];
// This is a bit ugly, but needed to maintain backwards
// compatibility.
- arrayParamIn(cp, "floatRegs.i", floatRegs, NumFloatRegs);
- for (int i = 0; i < NumFloatRegs; ++i)
+ arrayParamIn(cp, "floatRegs.i", floatRegs, TheISA::NumFloatRegs);
+ for (int i = 0; i < TheISA::NumFloatRegs; ++i)
tc.setFloatRegFlat(i, floatRegs[i]);
- std::vector<TheISA::VecRegContainer> vecRegs(NumVecRegs);
+ std::vector<TheISA::VecRegContainer> vecRegs(TheISA::NumVecRegs);
UNSERIALIZE_CONTAINER(vecRegs);
- for (int i = 0; i < NumVecRegs; ++i) {
+ for (int i = 0; i < TheISA::NumVecRegs; ++i) {
tc.setVecRegFlat(i, vecRegs[i]);
}
- std::vector<TheISA::VecPredRegContainer> vecPredRegs(NumVecPredRegs);
+ std::vector<TheISA::VecPredRegContainer>
+ vecPredRegs(TheISA::NumVecPredRegs);
UNSERIALIZE_CONTAINER(vecPredRegs);
- for (int i = 0; i < NumVecPredRegs; ++i) {
+ for (int i = 0; i < TheISA::NumVecPredRegs; ++i) {
tc.setVecPredRegFlat(i, vecPredRegs[i]);
}
- RegVal intRegs[NumIntRegs];
- UNSERIALIZE_ARRAY(intRegs, NumIntRegs);
- for (int i = 0; i < NumIntRegs; ++i)
+ RegVal intRegs[TheISA::NumIntRegs];
+ UNSERIALIZE_ARRAY(intRegs, TheISA::NumIntRegs);
+ for (int i = 0; i < TheISA::NumIntRegs; ++i)
tc.setIntRegFlat(i, intRegs[i]);
- if (NumCCRegs) {
- RegVal ccRegs[NumCCRegs];
- UNSERIALIZE_ARRAY(ccRegs, NumCCRegs);
- for (int i = 0; i < NumCCRegs; ++i)
+ if (TheISA::NumCCRegs) {
+ RegVal ccRegs[TheISA::NumCCRegs];
+ UNSERIALIZE_ARRAY(ccRegs, TheISA::NumCCRegs);
+ for (int i = 0; i < TheISA::NumCCRegs; ++i)
tc.setCCRegFlat(i, ccRegs[i]);
}
- PCState pcState;
+ TheISA::PCState pcState;
pcState.unserialize(cp);
tc.pcState(pcState);
#include "sim/full_system.hh"
#include "sim/redirect_path.hh"
-using namespace TheISA;
-
std::vector<System *> System::systemList;
void
# if THE_ISA != NULL_ISA
int port = getRemoteGDBPort();
if (port) {
- t.gdb = new RemoteGDB(sys, tc, port + id);
+ t.gdb = new TheISA::RemoteGDB(sys, tc, port + id);
t.gdb->listen();
}
# endif
Addr
System::allocPhysPages(int npages)
{
- Addr return_addr = pagePtr << PageShift;
+ Addr return_addr = pagePtr << TheISA::PageShift;
pagePtr += npages;
- Addr next_return_addr = pagePtr << PageShift;
+ Addr next_return_addr = pagePtr << TheISA::PageShift;
if (_m5opRange.contains(next_return_addr)) {
warn("Reached m5ops MMIO region\n");
return_addr = 0xffffffff;
- pagePtr = 0xffffffff >> PageShift;
+ pagePtr = 0xffffffff >> TheISA::PageShift;
}
- if ((pagePtr << PageShift) > physmem.totalSize())
+ if ((pagePtr << TheISA::PageShift) > physmem.totalSize())
fatal("Out of memory, please increase size of physical memory.");
return return_addr;
}
Addr
System::freeMemSize() const
{
- return physmem.totalSize() - (pagePtr << PageShift);
+ return physmem.totalSize() - (pagePtr << TheISA::PageShift);
}
bool