O3: At the end of an instruction, force fetchAddr to something sensible.
authorGabe Black <gblack@eecs.umich.edu>
Sat, 13 Aug 2011 20:36:37 +0000 (13:36 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Sat, 13 Aug 2011 20:36:37 +0000 (13:36 -0700)
It's possible (though until now very unlikely) for fetchAddr to get out of
sync with the actual PC of the current instruction. This change forcefull
resets fetchAddr at the end of every instruction.

src/cpu/o3/fetch_impl.hh

index 545969d828e66661ec37a5019588756f4b694a80..d186768d85e9fe96d396f82c40becc24165ad3ec 100644 (file)
@@ -1342,6 +1342,8 @@ DefaultFetch<Impl>::fetch(bool &status_change)
             thisPC = nextPC;
 
             if (newMacro) {
+                fetchAddr = thisPC.instAddr() & BaseCPU::PCMask;
+                blkOffset = (fetchAddr - cacheDataPC[tid]) / instSize;
                 pcOffset = 0;
                 curMacroop = NULL;
             }