#include "arch/power/isa.hh"
+#include "arch/power/miscregs.hh"
+#include "cpu/base.hh"
#include "params/PowerISA.hh"
namespace PowerISA
return dynamic_cast<const Params *>(_params);
}
+MiscReg
+ISA::readMiscRegNoEffect(int misc_reg) const
+{
+ assert(isValidMiscReg(misc_reg));
+ return regVal[misc_reg];
+}
+
+void
+ISA::setMiscRegNoEffect(int misc_reg, const MiscReg &val)
+{
+ assert(isValidMiscReg(misc_reg));
+ regVal[misc_reg] = val;
+}
+
}
PowerISA::ISA *
#define __ARCH_POWER_ISA_HH__
#include "arch/generic/isa.hh"
+#include "arch/power/miscregs.hh"
#include "arch/power/registers.hh"
#include "arch/power/types.hh"
#include "base/logging.hh"
class ISA : public BaseISA
{
protected:
- RegVal dummy;
- RegVal miscRegs[NumMiscRegs];
+ MiscReg regVal[NumMiscRegs];
+ MiscReg dummy;
public:
typedef PowerISAParams Params;
-
- void clear() {}
-
- public:
- RegVal
- readMiscRegNoEffect(int misc_reg) const
+ void
+ clear()
{
- fatal("Power does not currently have any misc regs defined\n");
- return dummy;
+ memset(regVal, 0, NumMiscRegs * sizeof(MiscReg));
}
+ MiscReg readMiscRegNoEffect(int misc_reg) const;
+
RegVal
readMiscReg(int misc_reg)
{
return dummy;
}
- void
- setMiscRegNoEffect(int misc_reg, RegVal val)
- {
- fatal("Power does not currently have any misc regs defined\n");
- }
+ void setMiscRegNoEffect(int misc_reg, const MiscReg &val);
void
setMiscReg(int misc_reg, RegVal val)
#include <vector>
#include "arch/power/faults.hh"
+#include "arch/power/miscregs.hh"
#include "arch/power/pagetable.hh"
+#include "arch/power/registers.hh"
#include "arch/power/utility.hh"
#include "base/inifile.hh"
#include "base/str.hh"
Fault
TLB::translateAtomic(const RequestPtr &req, ThreadContext *tc, Mode mode)
{
- panic_if(FullSystem,
- "translateAtomic not yet implemented for full system.");
-
+ if (FullSystem){
+ Msr msr = tc->readIntReg(MISCREG_MSR);
+ if (mode == Execute){
+ if (msr.ir)
+ fatal("Translate Atomic not Implemented for POWER");
+ else{
+ Addr vaddr = req->getVaddr();
+ DPRINTF(TLB, "Translating vaddr %#x.\n", vaddr);
+ Addr paddr = vaddr;
+ DPRINTF(TLB, "Translated %#x -> %#x.\n", vaddr, paddr);
+ req->setPaddr(paddr);
+ return NoFault;
+ }
+ }
+ else{
+ if (msr.dr)
+ fatal("Translate Atomic not Implemented for POWER");
+ else{
+ Addr vaddr = req->getVaddr();
+ DPRINTF(TLB, "Translating vaddr %#x.\n", vaddr);
+ Addr paddr = vaddr;
+ DPRINTF(TLB, "Translated %#x -> %#x.\n", vaddr, paddr);
+ req->setPaddr(paddr);
+ return NoFault;
+ }
+ }
+ }
if (mode == Execute)
- return translateInst(req, tc);
- else
+ return translateInst(req, tc);
+ else{
+ std::cout<<"translateData"<<std::endl;
return translateData(req, tc, mode == Write);
+ }
}
Fault