extractResourceMap(intReg32Ids, resources, intReg32IdxNameMap);
extractResourceMap(intReg64Ids, resources, intReg64IdxNameMap);
+ extractResourceMap(ccRegIds, resources, ccRegIdxNameMap);
+
extractResourceMap(vecRegIds, resources, vecRegIdxNameMap);
}
+RegVal
+CortexA76TC::readCCRegFlat(RegIndex idx) const
+{
+ RegVal result = Iris::ThreadContext::readCCRegFlat(idx);
+ switch (idx) {
+ case ArmISA::CCREG_NZ:
+ result = ((CPSR)result).nz;
+ break;
+ case ArmISA::CCREG_FP:
+ result = bits(result, 31, 28);
+ break;
+ default:
+ break;
+ }
+ return result;
+}
+
+void
+CortexA76TC::setCCRegFlat(RegIndex idx, RegVal val)
+{
+ switch (idx) {
+ case ArmISA::CCREG_NZ:
+ {
+ CPSR cpsr = readMiscRegNoEffect(ArmISA::MISCREG_CPSR);
+ cpsr.nz = val;
+ val = cpsr;
+ }
+ break;
+ case ArmISA::CCREG_FP:
+ {
+ FPSCR fpscr = readMiscRegNoEffect(ArmISA::MISCREG_FPSCR);
+ val = insertBits(fpscr, 31, 28, val);
+ }
+ break;
+ default:
+ break;
+ }
+ Iris::ThreadContext::setCCRegFlat(idx, val);
+}
+
iris::MemorySpaceId
CortexA76TC::getBpSpaceId(Addr pc) const
{
{ ArmISA::INTREG_SPX, "SP" },
});
+Iris::ThreadContext::IdxNameMap CortexA76TC::ccRegIdxNameMap({
+ { ArmISA::CCREG_NZ, "CPSR" },
+ { ArmISA::CCREG_C, "CPSR.C" },
+ { ArmISA::CCREG_V, "CPSR.V" },
+ { ArmISA::CCREG_GE, "CPSR.GE" },
+ { ArmISA::CCREG_FP, "FPSCR" },
+});
+
Iris::ThreadContext::IdxNameMap CortexA76TC::vecRegIdxNameMap({
{ 0, "V0" }, { 1, "V1" }, { 2, "V2" }, { 3, "V3" },
{ 4, "V4" }, { 5, "V5" }, { 6, "V6" }, { 7, "V7" },
static IdxNameMap miscRegIdxNameMap;
static IdxNameMap intReg32IdxNameMap;
static IdxNameMap intReg64IdxNameMap;
+ static IdxNameMap ccRegIdxNameMap;
static IdxNameMap vecRegIdxNameMap;
static iris::MemorySpaceId bpSpaceId;
void initFromIrisInstance(const ResourceMap &resources) override;
+ RegVal readCCRegFlat(RegIndex idx) const override;
+ void setCCRegFlat(RegIndex idx, RegVal val) override;
+
iris::MemorySpaceId getBpSpaceId(Addr pc) const override;
};
call().resource_write(_instId, result, intReg64Ids.at(reg_idx), val);
}
+RegVal
+ThreadContext::readCCRegFlat(RegIndex idx) const
+{
+ if (idx >= ccRegIds.size())
+ return 0;
+ iris::ResourceReadResult result;
+ call().resource_read(_instId, result, ccRegIds.at(idx));
+ return result.data.at(0);
+}
+
+void
+ThreadContext::setCCRegFlat(RegIndex idx, RegVal val)
+{
+ panic_if(idx >= ccRegIds.size(),
+ "CC reg %d is not supported by fast model.", idx);
+ iris::ResourceWriteResult result;
+ call().resource_write(_instId, result, ccRegIds.at(idx), val);
+}
+
const ArmISA::VecRegContainer &
ThreadContext::readVecReg(const RegId ®_id) const
{
ResourceIds miscRegIds;
ResourceIds intReg32Ids;
ResourceIds intReg64Ids;
+ ResourceIds ccRegIds;
iris::ResourceId pcRscId = iris::IRIS_UINT64_MAX;
iris::ResourceId icountRscId;
RegVal
readCCReg(RegIndex reg_idx) const override
{
- panic("%s not implemented.", __FUNCTION__);
+ return readCCRegFlat(reg_idx);
}
void setIntReg(RegIndex reg_idx, RegVal val) override;
void
setCCReg(RegIndex reg_idx, RegVal val) override
{
- panic("%s not implemented.", __FUNCTION__);
+ setCCRegFlat(reg_idx, val);
}
void pcStateNoRecord(const ArmISA::PCState &val) override { pcState(val); }
panic("%s not implemented.", __FUNCTION__);
}
- RegVal
- readCCRegFlat(RegIndex idx) const override
- {
- panic("%s not implemented.", __FUNCTION__);
- }
- void
- setCCRegFlat(RegIndex idx, RegVal val) override
- {
- panic("%s not implemented.", __FUNCTION__);
- }
+ RegVal readCCRegFlat(RegIndex idx) const override;
+ void setCCRegFlat(RegIndex idx, RegVal val) override;
/** @} */
};