43 #include "debug/ArmTme.hh"
50 using namespace ArmISA;
52 namespace ArmISAInst {
56 Trace::InstRecord *traceData)
const
59 const uint64_t htm_depth = xc->getHtmTransactionalDepth();
61 DPRINTF(ArmTme,
"tme depth is %d\n", htm_depth);
65 const uint64_t htm_uid = xc->getHtmTransactionUid();
66 fault = std::make_shared<GenericHtmFailureFault>(
81 fault = xc->initiateHtmCmd(memAccessFlags);
89 Trace::InstRecord *traceData)
const
94 ThreadContext *tc = xc->tcBase();
95 const uint64_t htm_depth = xc->getHtmTransactionalDepth();
101 fault = std::make_shared<IllegalInstSetStateFault>();
105 if (!xc->inHtmTransactionalState()) {
106 fault = std::make_shared<IllegalInstSetStateFault>();
113 if (htm_depth == 1) {
116 HTMCheckpoint *armcpt =
117 dynamic_cast<HTMCheckpoint*
>(cpt.get());
118 assert(armcpt !=
nullptr);
121 armcpt->destinationRegister(dest);
126 xc->setIntRegOperand(
this, 0, (Dest64) &
mask(intWidth));
129 uint64_t final_val = Dest64;
130 if (traceData) { traceData->setData(final_val); }
141 const uint64_t htm_depth = xc->getHtmTransactionalDepth();
145 fault = std::make_shared<IllegalInstSetStateFault>();
153 assert(!xc->inHtmTransactionalState());
155 assert(xc->inHtmTransactionalState());
158 uint64_t final_val = Dest64;
159 xc->setIntRegOperand(
this, 0, (Dest64) &
mask(intWidth));
160 if (traceData) { traceData->setData(final_val); }
172 if (!xc->inHtmTransactionalState()) {
173 fault = std::make_shared<IllegalInstSetStateFault>();
179 fault = xc->initiateHtmCmd(memAccessFlags);
186 Trace::InstRecord *traceData)
const
195 fault = std::make_shared<IllegalInstSetStateFault>();
199 auto tme_checkpoint =
static_cast<HTMCheckpoint*
>(
200 xc->tcBase()->getHtmCheckpointPtr().get());
201 tme_checkpoint->cancelReason(
imm);
203 fault = std::make_shared<GenericHtmFailureFault>(
204 xc->getHtmTransactionUid(),
213 Trace::InstRecord *traceData)
const
216 const uint64_t htm_depth = xc->getHtmTransactionalDepth();
219 if (!xc->inHtmTransactionalState()) {
220 fault = std::make_shared<IllegalInstSetStateFault>();
223 DPRINTF(ArmTme,
"tme depth is %d\n", htm_depth);
235 fault = xc->initiateHtmCmd(memAccessFlags);
242 Trace::InstRecord *traceData)
const
246 ThreadContext *tc = xc->tcBase();
247 const uint64_t htm_depth = xc->getHtmTransactionalDepth();
253 fault = std::make_shared<IllegalInstSetStateFault>();
257 if (htm_depth == 1) {
258 auto tme_checkpoint =
static_cast<HTMCheckpoint*
>(
259 xc->tcBase()->getHtmCheckpointPtr().get());
261 assert(tme_checkpoint);
262 assert(tme_checkpoint->valid());
264 tme_checkpoint->reset();