summaryrefslogtreecommitdiff
path: root/src/arch/sparc/intregfile.cc
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-10-31 14:44:23 -0500
committerKevin Lim <ktlim@umich.edu>2006-10-31 14:44:23 -0500
commit2fa535f7407ad2a7e1e2ec807b72d11a81fa25aa (patch)
tree29a33ada141edad37b9304227f411a0195520869 /src/arch/sparc/intregfile.cc
parente912080d12666482a942eae354e783c3d666c6c9 (diff)
parent7f39644609e19ada9e94c9bbb09c3e625fa6e8ed (diff)
downloadgem5-2fa535f7407ad2a7e1e2ec807b72d11a81fa25aa.tar.xz
Merge ktlim@zizzer:/bk/newmem
into zamp.eecs.umich.edu:/z/ktlim2/clean/o3-merge/newmem --HG-- extra : convert_revision : 88fa7ae5cc32be068787ee381fae9d8de0e9bd0f
Diffstat (limited to 'src/arch/sparc/intregfile.cc')
-rw-r--r--src/arch/sparc/intregfile.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/arch/sparc/intregfile.cc b/src/arch/sparc/intregfile.cc
index bef62f6ae..164f194dd 100644
--- a/src/arch/sparc/intregfile.cc
+++ b/src/arch/sparc/intregfile.cc
@@ -75,8 +75,14 @@ IntRegFile::IntRegFile()
IntReg IntRegFile::readReg(int intReg)
{
- IntReg val =
- regView[intReg >> FrameOffsetBits][intReg & FrameOffsetMask];
+ IntReg val;
+ if(intReg < NumRegularIntRegs)
+ val = regView[intReg >> FrameOffsetBits][intReg & FrameOffsetMask];
+ else if((intReg -= NumRegularIntRegs) < NumMicroIntRegs)
+ val = microRegs[intReg];
+ else
+ panic("Tried to read non-existant integer register\n");
+
DPRINTF(Sparc, "Read register %d = 0x%x\n", intReg, val);
return val;
}
@@ -86,7 +92,12 @@ Fault IntRegFile::setReg(int intReg, const IntReg &val)
if(intReg)
{
DPRINTF(Sparc, "Wrote register %d = 0x%x\n", intReg, val);
- regView[intReg >> FrameOffsetBits][intReg & FrameOffsetMask] = val;
+ if(intReg < NumRegularIntRegs)
+ regView[intReg >> FrameOffsetBits][intReg & FrameOffsetMask] = val;
+ else if((intReg -= NumRegularIntRegs) < NumMicroIntRegs)
+ microRegs[intReg] = val;
+ else
+ panic("Tried to set non-existant integer register\n");
}
return NoFault;
}
@@ -123,6 +134,7 @@ void IntRegFile::serialize(std::ostream &os)
SERIALIZE_ARRAY(regGlobals[x], RegsPerFrame);
for(x = 0; x < 2 * NWindows; x++)
SERIALIZE_ARRAY(regSegments[x], RegsPerFrame);
+ SERIALIZE_ARRAY(microRegs, NumMicroIntRegs);
}
void IntRegFile::unserialize(Checkpoint *cp, const std::string &section)
@@ -132,4 +144,5 @@ void IntRegFile::unserialize(Checkpoint *cp, const std::string &section)
UNSERIALIZE_ARRAY(regGlobals[x], RegsPerFrame);
for(unsigned int x = 0; x < 2 * NWindows; x++)
UNSERIALIZE_ARRAY(regSegments[x], RegsPerFrame);
+ UNSERIALIZE_ARRAY(microRegs, NumMicroIntRegs);
}