Skip to content

Commit 94c3b8a

Browse files
committed
cpu-o3: fix storeData uop squash
Change-Id: I146d1ac20d06015e98713f30bae71fef3f5d7bcf
1 parent 1391a92 commit 94c3b8a

File tree

5 files changed

+43
-0
lines changed

5 files changed

+43
-0
lines changed

src/cpu/o3/iew.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,6 +1553,11 @@ IEW::executeInsts()
15531553
// executing
15541554
ppExecute->notify(inst);
15551555

1556+
if (inst->isSplitStoreData() &&
1557+
ldstQueue.splitStoreAddrSquashed(inst)) {
1558+
inst->setSquashed();
1559+
}
1560+
15561561
// Check if the instruction is squashed; if so then skip it
15571562
if (inst->isSquashed()) {
15581563
DPRINTF(IEW, "Execute: Instruction was squashed. PC: %s, [tid:%i]"

src/cpu/o3/lsq.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,14 @@ LSQ::insertStore(const DynInstPtr &store_inst)
798798
thread[tid].insertStore(store_inst);
799799
}
800800

801+
bool
802+
LSQ::splitStoreAddrSquashed(const DynInstPtr &inst)
803+
{
804+
ThreadID tid = inst->threadNumber;
805+
806+
return thread[tid].splitStoreAddrSquashed(inst);
807+
}
808+
801809
void
802810
LSQ::issueToLoadPipe(const DynInstPtr &inst)
803811
{

src/cpu/o3/lsq.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ class LSQ
841841
void insertLoad(const DynInstPtr &load_inst);
842842
/** Inserts a store into the LSQ. */
843843
void insertStore(const DynInstPtr &store_inst);
844+
bool splitStoreAddrSquashed(const DynInstPtr &inst);
844845

845846
/** Executes an amo inst. */
846847
Fault executeAmo(const DynInstPtr &inst);

src/cpu/o3/lsq_unit.cc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,30 @@ LSQUnit::insertStore(const DynInstPtr& store_inst)
767767
storeQueue.back().set(store_inst);
768768
}
769769

770+
bool
771+
LSQUnit::splitStoreAddrSquashed(const DynInstPtr &inst)
772+
{
773+
if (!inst->isSplitStoreData()) {
774+
return false;
775+
}
776+
777+
if (!storeQueue.isValidIdx(inst->sqIdx)) {
778+
return true;
779+
}
780+
781+
auto sq_it = storeQueue.getIterator(inst->sqIdx);
782+
if (!sq_it->valid()) {
783+
return true;
784+
}
785+
786+
const auto &sta_inst = sq_it->instruction();
787+
if (!sta_inst || sta_inst->seqNum != inst->seqNum) {
788+
return true;
789+
}
790+
791+
return sta_inst->isSquashed();
792+
}
793+
770794
bool
771795
LSQUnit::pipeLineNukeCheck(const DynInstPtr &load_inst, const DynInstPtr &store_inst)
772796
{
@@ -1662,6 +1686,10 @@ LSQUnit::executeStorePipeSx()
16621686
continue;
16631687
}
16641688

1689+
if (splitStoreAddrSquashed(inst)) {
1690+
inst->setSquashed();
1691+
}
1692+
16651693
if (inst->isSquashed()) {
16661694
DPRINTF(StorePipeline, "Execute: Instruction was squashed. PC: %s, [tid:%i]"
16671695
" [sn:%llu]\n", inst->pcState(), inst->threadNumber,

src/cpu/o3/lsq_unit.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ class LSQUnit
304304
void insertLoad(const DynInstPtr &load_inst);
305305
/** Inserts a store instruction. */
306306
void insertStore(const DynInstPtr &store_inst);
307+
bool splitStoreAddrSquashed(const DynInstPtr &inst);
307308

308309
/** Check for ordering violations in the LSQ. For a store squash if we
309310
* ever find a conflicting load. For a load, only squash if we

0 commit comments

Comments
 (0)