summaryrefslogtreecommitdiff
path: root/src/arch/mips/regfile/int_regfile.cc
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2007-11-13 16:58:16 -0500
committerKorey Sewell <ksewell@umich.edu>2007-11-13 16:58:16 -0500
commit269259004943b80916ec9b6354f2fc00c811c88b (patch)
tree4a01b0300aef6692a787f85d42280a1dbdb086e6 /src/arch/mips/regfile/int_regfile.cc
parent422ab8bec0034a6b703578ec2c92350c6382875a (diff)
downloadgem5-269259004943b80916ec9b6354f2fc00c811c88b.tar.xz
Add in files from merge-bare-iron, get them compiling in FS and SE mode
--HG-- extra : convert_revision : d4e19afda897bc3797868b40469ce2ec7ec7d251
Diffstat (limited to 'src/arch/mips/regfile/int_regfile.cc')
-rw-r--r--src/arch/mips/regfile/int_regfile.cc56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/arch/mips/regfile/int_regfile.cc b/src/arch/mips/regfile/int_regfile.cc
index 70c71fa24..81511b67c 100644
--- a/src/arch/mips/regfile/int_regfile.cc
+++ b/src/arch/mips/regfile/int_regfile.cc
@@ -35,6 +35,61 @@
using namespace MipsISA;
using namespace std;
+
+void
+IntRegFile::clear()
+{
+ bzero(&regs, sizeof(regs));
+ currShadowSet=0;
+}
+
+void
+IntRegFile::setShadowSet(int css)
+{
+ DPRINTF(MipsPRA,"Setting Shadow Set to :%d (%s)\n",css,currShadowSet);
+ currShadowSet = css;
+}
+
+IntReg
+IntRegFile::readReg(int intReg)
+{
+ if(intReg < NumIntRegs)
+ { // Regular GPR Read
+ DPRINTF(MipsPRA,"Reading Reg: %d, CurrShadowSet: %d\n",intReg,currShadowSet);
+ if(intReg >= NumIntArchRegs*NumShadowRegSets){
+ return regs[intReg+NumIntRegs*currShadowSet];
+ }
+ else {
+ return regs[(intReg + NumIntArchRegs*currShadowSet) % NumIntArchRegs];
+ }
+ }
+ else
+ { // Read from shadow GPR .. probably called by RDPGPR
+ return regs[intReg];
+ }
+}
+
+Fault
+IntRegFile::setReg(int intReg, const IntReg &val)
+{
+ if (intReg != ZeroReg) {
+
+ if(intReg < NumIntRegs)
+ {
+ if(intReg >= NumIntArchRegs*NumShadowRegSets){
+ regs[intReg] = val;
+ }
+ else{
+ regs[intReg+NumIntRegs*currShadowSet] = val;
+ }
+ }
+ else{
+ regs[intReg] = val;
+ }
+ }
+ return NoFault;
+}
+
void
IntRegFile::serialize(std::ostream &os)
{
@@ -46,3 +101,4 @@ IntRegFile::unserialize(Checkpoint *cp, const std::string &section)
{
UNSERIALIZE_ARRAY(regs, NumIntRegs);
}
+