cpu: Fixed a bug on where to fetch the next instruction from

Figure out if the next instruction to fetch comes from the micro-op ROM
or not. Otherwise, wrong instructions may be fetched.
This commit is contained in:
David Hashe 2015-07-20 09:15:18 -05:00
parent a2d9aae3c3
commit 8f71e667b3

View file

@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2010-2014 ARM Limited * Copyright (c) 2010-2014 ARM Limited
* Copyright (c) 2012-2013 AMD
* All rights reserved. * All rights reserved.
* *
* The license below extends only to copyright in the software and shall * The license below extends only to copyright in the software and shall
@ -1371,6 +1372,10 @@ DefaultFetch<Impl>::fetch(bool &status_change)
} while ((curMacroop || decoder[tid]->instReady()) && } while ((curMacroop || decoder[tid]->instReady()) &&
numInst < fetchWidth && numInst < fetchWidth &&
fetchQueue[tid].size() < fetchQueueSize); fetchQueue[tid].size() < fetchQueueSize);
// Re-evaluate whether the next instruction to fetch is in micro-op ROM
// or not.
inRom = isRomMicroPC(thisPC.microPC());
} }
if (predictedBranch) { if (predictedBranch) {