From d695a3c4c4478f08673bff255250444857d48094 Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Sat, 1 Sep 2018 15:38:13 +0100 Subject: [PATCH] mem-cache: Fix bug in handleAtomicReqMiss "4976ff5 mem-cache: Refactor the recvAtomic function" introduced a bug where if an atomic request that fills in using the tempBlock it will not evict it when it finishes handling the request as it should. This triggers an assertion. This change fixes this bug. Change-Id: I73c808a7e15237eddb36b5448ef6728f7bcf7fd9 Reviewed-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/12644 Reviewed-by: Jason Lowe-Power Reviewed-by: Daniel Carvalho Maintainer: Nikos Nikoleris --- src/mem/cache/base.hh | 2 +- src/mem/cache/cache.cc | 2 +- src/mem/cache/cache.hh | 2 +- src/mem/cache/noncoherent_cache.cc | 2 +- src/mem/cache/noncoherent_cache.hh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mem/cache/base.hh b/src/mem/cache/base.hh index 4ba256b95..4ebc52493 100644 --- a/src/mem/cache/base.hh +++ b/src/mem/cache/base.hh @@ -506,7 +506,7 @@ class BaseCache : public MemObject * @param writebacks A list with packets for any performed writebacks * @return Cycles for handling the request */ - virtual Cycles handleAtomicReqMiss(PacketPtr pkt, CacheBlk *blk, + virtual Cycles handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk, PacketList &writebacks) = 0; /** diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc index 9b1612904..1b5316383 100644 --- a/src/mem/cache/cache.cc +++ b/src/mem/cache/cache.cc @@ -560,7 +560,7 @@ Cache::createMissPacket(PacketPtr cpu_pkt, CacheBlk *blk, Cycles -Cache::handleAtomicReqMiss(PacketPtr pkt, CacheBlk *blk, +Cache::handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk, PacketList &writebacks) { // deal with the packets that go through the write path of diff --git a/src/mem/cache/cache.hh b/src/mem/cache/cache.hh index 32752a5e6..f8eccfee6 100644 --- a/src/mem/cache/cache.hh +++ b/src/mem/cache/cache.hh @@ -110,7 +110,7 @@ class Cache : public BaseCache void recvTimingSnoopResp(PacketPtr pkt) override; - Cycles handleAtomicReqMiss(PacketPtr pkt, CacheBlk *blk, + Cycles handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk, PacketList &writebacks) override; Tick recvAtomic(PacketPtr pkt) override; diff --git a/src/mem/cache/noncoherent_cache.cc b/src/mem/cache/noncoherent_cache.cc index 50738375e..fb8193a99 100644 --- a/src/mem/cache/noncoherent_cache.cc +++ b/src/mem/cache/noncoherent_cache.cc @@ -170,7 +170,7 @@ NoncoherentCache::createMissPacket(PacketPtr cpu_pkt, CacheBlk *blk, Cycles -NoncoherentCache::handleAtomicReqMiss(PacketPtr pkt, CacheBlk *blk, +NoncoherentCache::handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk, PacketList &writebacks) { PacketPtr bus_pkt = createMissPacket(pkt, blk, true); diff --git a/src/mem/cache/noncoherent_cache.hh b/src/mem/cache/noncoherent_cache.hh index 09012ba10..2a60f4c5e 100644 --- a/src/mem/cache/noncoherent_cache.hh +++ b/src/mem/cache/noncoherent_cache.hh @@ -98,7 +98,7 @@ class NoncoherentCache : public BaseCache panic("Unexpected timing snoop response %s", pkt->print()); } - Cycles handleAtomicReqMiss(PacketPtr pkt, CacheBlk *blk, + Cycles handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk, PacketList &writebacks) override; Tick recvAtomic(PacketPtr pkt) override; -- 2.30.2