diff options
author | Iru Cai <mytbk920423@gmail.com> | 2019-04-17 10:14:47 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2019-05-31 16:03:29 +0800 |
commit | 3d837e922175e0d9cfdea8c94a75f9e7178576d6 (patch) | |
tree | 8c928bfcf4c78ba194c0d394c4a3b90071bb852c | |
parent | decb0e28b9d3e912aa40645b157357c09e84a03a (diff) | |
download | gem5-3d837e922175e0d9cfdea8c94a75f9e7178576d6.tar.xz |
IFT for fence scheme
-rw-r--r-- | src/cpu/o3/lsq_unit_impl.hh | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/cpu/o3/lsq_unit_impl.hh b/src/cpu/o3/lsq_unit_impl.hh index a45048ff9..f22383506 100644 --- a/src/cpu/o3/lsq_unit_impl.hh +++ b/src/cpu/o3/lsq_unit_impl.hh @@ -1021,13 +1021,33 @@ LSQUnit<Impl>::updateVisibleState() inst->seqNum, inst->pcState()); } inst->fenceDelay(false); - }else { - if (!inst->fenceDelay()){ - DPRINTF(LSQUnit, "Deffering an inst [sn:%lli] PC %s" - " due to virtual fence\n", - inst->seqNum, inst->pcState()); + } else { + if (!useIFT) { + if (!inst->fenceDelay()){ + DPRINTF(LSQUnit, "Deffering an inst [sn:%lli] PC %s" + " due to virtual fence\n", + inst->seqNum, inst->pcState()); + } + inst->fenceDelay(true); + } else { + /* set taint for dst registers */ + inst->taintDestRegs(true, "unsafe load"); + bool doSpecLoad = false; + if (inst->afterTaintedBranch) { + doSpecLoad = true; + DPRINTF(LSQUnit, "load inst [sn:%lli] %s is after a tainted branch.\n", inst->seqNum, inst->pcState()); + } else if (inst->srcTainted()) { + doSpecLoad = true; + DPRINTF(LSQUnit, "source registers of load inst [sn:%lli] %s is tainted.\n", inst->seqNum, inst->pcState()); + } + if (doSpecLoad) { + DPRINTF(LSQUnit, "load inst [sn:%lli] %s not safe, defer it.\n", inst->seqNum, inst->pcState()); + inst->fenceDelay(true); + } else { + DPRINTF(LSQUnit, "load inst [sn:%lli] %s is an unsafe speculated load, but source registers are not tainted.\n", inst->seqNum, inst->pcState()); + inst->fenceDelay(false); + } } - inst->fenceDelay(true); } inst->readyToExpose(true); } else if (loadInExec && isInvisibleSpec){ |