diff options
author | Nikos Nikoleris <nikos.nikoleris@arm.com> | 2018-05-04 16:54:48 +0100 |
---|---|---|
committer | Nikos Nikoleris <nikos.nikoleris@arm.com> | 2018-05-31 15:11:23 +0000 |
commit | d5c4dd986a48f13cc774e487993634d8c2b68e10 (patch) | |
tree | 67f26b37882fc292c060ca81acf3b8093cb71514 /src/mem/cache/cache.hh | |
parent | a8ac84cdd39b7a37c0c9966e49eb3927f2e6abec (diff) | |
download | gem5-d5c4dd986a48f13cc774e487993634d8c2b68e10.tar.xz |
mem-cache: Add helper function to perform evictions
Change-Id: I2df24eb1a8516220bec9b685c8c09bf55be18681
Reviewed-on: https://gem5-review.googlesource.com/10430
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/mem/cache/cache.hh')
-rw-r--r-- | src/mem/cache/cache.hh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mem/cache/cache.hh b/src/mem/cache/cache.hh index 4a56f14f1..86ec2a2a5 100644 --- a/src/mem/cache/cache.hh +++ b/src/mem/cache/cache.hh @@ -496,6 +496,26 @@ class Cache : public BaseCache bool is_timing, bool is_deferred, bool pending_inval); /** + * Evict a cache block. + * + * Performs a writeback if necesssary and invalidates the block + * + * @param blk Block to invalidate + * @return A packet with the writeback, can be nullptr + */ + M5_NODISCARD virtual PacketPtr evictBlock(CacheBlk *blk); + + /** + * Evict a cache block. + * + * Performs a writeback if necesssary and invalidates the block + * + * @param blk Block to invalidate + * @param writebacks Return a list of packets with writebacks + */ + virtual void evictBlock(CacheBlk *blk, PacketList &writebacks); + + /** * Create a writeback request for the given block. * @param blk The block to writeback. * @return The writeback request for the block. |