iris::IrisConnectionInterface *iris_if,
const std::string &iris_path) :
ThreadContext(cpu, id, system, dtb, itb, iris_if, iris_path),
- pcRscId(iris::IRIS_UINT64_MAX)
+ vecRegs(TheISA::NumVecRegs), pcRscId(iris::IRIS_UINT64_MAX)
{}
void
extractResourceMap(intReg32Ids, resources, intReg32IdxNameMap);
extractResourceMap(intReg64Ids, resources, intReg64IdxNameMap);
+
+ extractResourceMap(vecRegIds, resources, vecRegIdxNameMap);
}
TheISA::PCState
call().resource_write(_instId, result, intReg64Ids.at(reg_idx), val);
}
+const ArmISA::VecRegContainer &
+ArmThreadContext::readVecReg(const RegId ®_id) const
+{
+ const RegIndex idx = reg_id.index();
+ ArmISA::VecRegContainer ® = vecRegs.at(idx);
+
+ iris::ResourceReadResult result;
+ call().resource_read(_instId, result, vecRegIds.at(idx));
+ size_t data_size = result.data.size() * (sizeof(*result.data.data()));
+ size_t size = std::min(data_size, reg.SIZE);
+ memcpy(reg.raw_ptr<void>(), (void *)result.data.data(), size);
+
+ return reg;
+}
+
Iris::ThreadContext::IdxNameMap ArmThreadContext::miscRegIdxNameMap({
{ ArmISA::MISCREG_CPSR, "CPSR" },
{ ArmISA::MISCREG_SPSR, "SPSR" },
{ ArmISA::INTREG_SPX, "SP" },
});
+Iris::ThreadContext::IdxNameMap ArmThreadContext::vecRegIdxNameMap({
+ { 0, "V0" }, { 1, "V1" }, { 2, "V2" }, { 3, "V3" },
+ { 4, "V4" }, { 5, "V5" }, { 6, "V6" }, { 7, "V7" },
+ { 8, "V8" }, { 9, "V9" }, { 10, "V10" }, { 11, "V11" },
+ { 12, "V12" }, { 13, "V13" }, { 14, "V14" }, { 15, "V15" },
+ { 16, "V16" }, { 17, "V17" }, { 18, "V18" }, { 19, "V19" },
+ { 20, "V20" }, { 21, "V21" }, { 22, "V22" }, { 23, "V23" },
+ { 24, "V24" }, { 25, "V25" }, { 26, "V26" }, { 27, "V27" },
+ { 28, "V28" }, { 29, "V29" }, { 30, "V30" }, { 31, "V31" }
+});
+
} // namespace Iris
static IdxNameMap miscRegIdxNameMap;
static IdxNameMap intReg32IdxNameMap;
static IdxNameMap intReg64IdxNameMap;
+ static IdxNameMap vecRegIdxNameMap;
+
+ // Temporary holding places for the vector reg accessors to return.
+ // These are not updated live, only when requested.
+ mutable std::vector<ArmISA::VecRegContainer> vecRegs;
public:
ArmThreadContext(::BaseCPU *cpu, int id, System *system,
ResourceIds intReg32Ids;
ResourceIds intReg64Ids;
+ ResourceIds vecRegIds;
void setIntReg(RegIndex reg_idx, RegVal val) override;
RegVal readIntReg(RegIndex reg_idx) const override;
{
panic("%s not implemented.", __FUNCTION__);
}
+
+ const VecRegContainer &readVecReg(const RegId ®) const override;
};
} // namespace Iris