Deleted Added
sdiff udiff text old ( 12109:f29e9c5418aa ) new ( 12749:223c83ed9979 )
full compact
1/*
2 * Copyright (c) 2011, 2016 ARM Limited
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

--- 230 unchanged lines hidden (view full) ---

239 Addr fetch_PC = thread->instAddr();
240 fetch_PC = (fetch_PC & PCMask) + fetchOffset;
241
242 MachInst machInst;
243
244 // If not in the middle of a macro instruction
245 if (!curMacroStaticInst) {
246 // set up memory request for instruction fetch
247 memReq = new Request(unverifiedInst->threadNumber, fetch_PC,
248 sizeof(MachInst),
249 0,
250 masterId,
251 fetch_PC, thread->contextId());
252 memReq->setVirt(0, fetch_PC, sizeof(MachInst),
253 Request::INST_FETCH, masterId, thread->instAddr());
254
255
256 fault = itb->translateFunctional(memReq, tc, BaseTLB::Execute);
257
258 if (fault != NoFault) {
259 if (unverifiedInst->getFault() == NoFault) {
260 // In this case the instruction was not a dummy
261 // instruction carrying an ITB fault. In the single
262 // threaded case the ITB should still be able to
263 // translate this instruction; in the SMT case it's
264 // possible that its ITB entry was kicked out.
265 warn("%lli: Instruction PC %s was not found in the "
266 "ITB!", curTick(), thread->pcState());
267 handleError(unverifiedInst);
268
269 // go to the next instruction
270 advancePC(NoFault);
271
272 // Give up on an ITB fault..
273 delete memReq;
274 unverifiedInst = NULL;
275 return;
276 } else {
277 // The instruction is carrying an ITB fault. Handle
278 // the fault and see if our results match the CPU on
279 // the next tick().
280 fault = unverifiedInst->getFault();
281 delete memReq;
282 break;
283 }
284 } else {
285 PacketPtr pkt = new Packet(memReq, MemCmd::ReadReq);
286
287 pkt->dataStatic(&machInst);
288 icachePort->sendFunctional(pkt);
289 machInst = gtoh(machInst);
290
291 delete memReq;
292 delete pkt;
293 }
294 }
295
296 if (fault == NoFault) {
297 TheISA::PCState pcState = thread->pcState();
298
299 if (isRomMicroPC(pcState.microPC())) {

--- 422 unchanged lines hidden ---