From 519808c02f2d5d780bf09589d2e29803a5af1ade Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Sat, 18 Jan 2020 16:19:53 +0100 Subject: mem-cache: Fix invalidation of prefetchers Add an invalidation function to the AssociativeSet, so that entries can be properly invalidated by also invalidating their replacement data. Both setInvalid and reset have been merged into invalidate to indicate users that they are using an incorrect approach by generating compilation errors, and to match CacheBlk's naming convention. Change-Id: I568076a3b5adda8b1311d9498b086c0dab457a14 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24529 Reviewed-by: Nikos Nikoleris Maintainer: Nikos Nikoleris Tested-by: kokoro --- src/mem/cache/prefetch/irregular_stream_buffer.hh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/mem/cache/prefetch/irregular_stream_buffer.hh') diff --git a/src/mem/cache/prefetch/irregular_stream_buffer.hh b/src/mem/cache/prefetch/irregular_stream_buffer.hh index c97fde84d..fefebc5d2 100644 --- a/src/mem/cache/prefetch/irregular_stream_buffer.hh +++ b/src/mem/cache/prefetch/irregular_stream_buffer.hh @@ -79,13 +79,18 @@ class IrregularStreamBufferPrefetcher : public QueuedPrefetcher * Maps a set of contiguous addresses to another set of (not necessarily * contiguos) addresses, with their corresponding confidence counters */ - struct AddressMappingEntry : public TaggedEntry { + struct AddressMappingEntry : public TaggedEntry + { std::vector mappings; AddressMappingEntry(size_t num_mappings, unsigned counter_bits) - : mappings(num_mappings, counter_bits) - {} - void reset() override + : TaggedEntry(), mappings(num_mappings, counter_bits) + { + } + + void + invalidate() override { + TaggedEntry::invalidate(); for (auto &entry : mappings) { entry.address = 0; entry.counter.reset(); -- cgit v1.2.3