126 if ((completed_inst->isSerializing() ||
127 completed_inst->isSerializeBefore()) &&
129 (instList.front()->seqNum != completed_inst->seqNum) : 0)) {
130 panic(
"%lli: Instruction sn:%lli at PC %s is serializing before but is"
131 " entering instList with other instructions\n",
curTick(),
132 completed_inst->seqNum, completed_inst->pcState());
140 if (!instList.empty()) {
141 if (youngestSN < completed_inst->seqNum) {
143 completed_inst->seqNum, completed_inst->
pcState());
144 instList.push_back(completed_inst);
145 youngestSN = completed_inst->seqNum;
148 if (!instList.front()->isCompleted()) {
151 inst = instList.front();
152 instList.pop_front();
155 if (!completed_inst->isCompleted()) {
156 if (youngestSN < completed_inst->seqNum) {
158 completed_inst->seqNum, completed_inst->
pcState());
159 instList.push_back(completed_inst);
160 youngestSN = completed_inst->seqNum;
164 if (youngestSN < completed_inst->seqNum) {
165 inst = completed_inst;
166 youngestSN = completed_inst->seqNum;
175 if (inst->isSerializeAfter() && !instList.empty()) {
176 panic(
"%lli: Instruction sn:%lli at PC %s is serializing after but is"
177 " exiting instList with other instructions\n",
curTick(),
178 completed_inst->seqNum, completed_inst->pcState());
180 unverifiedInst = inst;
183 auto &
decoder = thread->decoder;
191 unverifiedInst->seqNum, unverifiedInst->
pcState());
192 unverifiedReq = NULL;
193 unverifiedReq = unverifiedInst->reqToVerify;
194 unverifiedMemData = unverifiedInst->memData;
196 while (!result.empty()) {
199 baseStats.numCycles++;
210 if (*newPCState == thread->pcState()) {
213 warn(
"%lli: Changed PC does not match expected PC, "
214 "changed: %s, expected: %s",
215 curTick(), thread->pcState(), *newPCState);
218 willChangePC =
false;
224 uint64_t fetchOffset = 0;
225 bool fetchDone =
false;
227 Addr fetch_PC = thread->pcState().instAddr();
228 fetch_PC = (fetch_PC & pc_mask) + fetchOffset;
231 if (!curMacroStaticInst) {
233 auto mem_req = std::make_shared<Request>(
234 fetch_PC,
decoder->moreBytesSize(), 0, requestorId,
235 fetch_PC, thread->contextId());
237 mem_req->setVirt(fetch_PC,
decoder->moreBytesSize(),
239 thread->pcState().instAddr());
241 fault = mmu->translateFunctional(
245 if (unverifiedInst->getFault() ==
NoFault) {
251 warn(
"%lli: Instruction PC %s was not found in the "
252 "ITB!",
curTick(), thread->pcState());
253 handleError(unverifiedInst);
259 unverifiedInst = NULL;
265 fault = unverifiedInst->getFault();
272 icachePort->sendFunctional(pkt);
279 std::unique_ptr<PCStateBase> pc_state(
280 thread->pcState().clone());
284 curStaticInst =
decoder->fetchRomMicroop(
285 pc_state->microPC(),
nullptr);
286 }
else if (!curMacroStaticInst) {
293 (pc_state->instAddr() & pc_mask) + fetchOffset;
294 decoder->moreBytes(*pc_state, fetch_pc);
301 instPtr =
decoder->decode(*pc_state);
302 thread->pcState(*pc_state);
305 fetchOffset +=
decoder->moreBytesSize();
311 curMacroStaticInst = instPtr;
315 curStaticInst = instPtr;
330 Fault unverifiedFault;
332 unverifiedFault = unverifiedInst->getFault();
336 validateInst(unverifiedInst);
348 if (!unverifiedInst->isUnverifiable()) {
354 fault = curStaticInst->execute(
this, traceData);
363 validateExecution(unverifiedInst);
365 if (curStaticInst->isLoad()) {
369 panic(
"%lli: sn: %lli at PC: %s took a fault in checker "
370 "but not in driver CPU\n",
curTick(),
371 unverifiedInst->seqNum, unverifiedInst->pcState());
373 panic(
"%lli: sn: %lli at PC: %s took a fault in driver "
374 "CPU but not in checker\n",
curTick(),
375 unverifiedInst->seqNum, unverifiedInst->pcState());
382 fault->invoke(tc, curStaticInst);
384 set(newPCState, thread->pcState());
399 oldpc = thread->pcState().instAddr();
400 thread->pcEventQueue.service(oldpc, tc);
402 }
while (oldpc != thread->pcState().instAddr());
405 set(newPCState, thread->pcState());
416 if (instList.empty()) {
418 }
else if (instList.front()->isCompleted()) {
419 unverifiedInst = NULL;
420 unverifiedInst = instList.front();
421 instList.pop_front();
426 unverifiedInst = NULL;