From 649c239ceef2d107fae253b1008c6f214f242d73 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Tue, 13 Sep 2011 12:58:08 -0400 Subject: LSQ: Only trigger a memory violation with a load/load if the value changes. Only create a memory ordering violation when the value could have changed between two subsequent loads, instead of just when loads go out-of-order to the same address. While not very common in the case of Alpha, with an architecture with a hardware table walker this can happen reasonably frequently beacuse a translation will miss and start a table walk and before the CPU re-schedules the faulting instruction another one will pass it to the same address (or cache block depending on the dendency checking). This patch has been tested with a couple of self-checking hand crafted programs to stress ordering between two cores. The performance improvement on SPEC benchmarks can be substantial (2-10%). --- src/cpu/o3/lsq_unit.hh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/cpu/o3/lsq_unit.hh') diff --git a/src/cpu/o3/lsq_unit.hh b/src/cpu/o3/lsq_unit.hh index 693bee82c..af926759c 100644 --- a/src/cpu/o3/lsq_unit.hh +++ b/src/cpu/o3/lsq_unit.hh @@ -115,12 +115,20 @@ class LSQUnit { /** Inserts a store instruction. */ void insertStore(DynInstPtr &store_inst); - /** Check for ordering violations in the LSQ + /** Check for ordering violations in the LSQ. For a store squash if we + * ever find a conflicting load. For a load, only squash if we + * an external snoop invalidate has been seen for that load address * @param load_idx index to start checking at * @param inst the instruction to check */ Fault checkViolations(int load_idx, DynInstPtr &inst); + /** Check if an incoming invalidate hits in the lsq on a load + * that might have issued out of order wrt another load beacuse + * of the intermediate invalidate. + */ + void checkSnoop(PacketPtr pkt); + /** Executes a load instruction. */ Fault executeLoad(DynInstPtr &inst); @@ -417,6 +425,9 @@ class LSQUnit { //list mshrSeqNums; + /** Address Mask for a cache block (e.g. ~(cache_block_size-1)) */ + Addr cacheBlockMask; + /** Wire to read information from the issue stage time queue. */ typename TimeBuffer::wire fromIssue; -- cgit v1.2.3