From: Daniel R. Carvalho Date: Wed, 6 Jun 2018 13:26:10 +0000 (+0200) Subject: mem-cache: Make packet const in insertBlock X-Git-Tag: v19.0.0.0~2066 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=285a919dc1067c32e5eac22aaa805f62beaac6c4;p=gem5.git mem-cache: Make packet const in insertBlock The packet should not be modified within insertBlock. Change-Id: If7d2b01fe131f9923194efd155c9e85eeab24d5a Reviewed-on: https://gem5-review.googlesource.com/10811 Reviewed-by: Nikos Nikoleris Maintainer: Nikos Nikoleris --- diff --git a/src/mem/cache/tags/base.cc b/src/mem/cache/tags/base.cc index caed594b8..9548d491a 100644 --- a/src/mem/cache/tags/base.cc +++ b/src/mem/cache/tags/base.cc @@ -80,7 +80,7 @@ BaseTags::setCache(BaseCache *_cache) } void -BaseTags::insertBlock(PacketPtr pkt, CacheBlk *blk) +BaseTags::insertBlock(const PacketPtr pkt, CacheBlk *blk) { assert(!blk->isValid()); diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh index 7ed90fbd9..30da40855 100644 --- a/src/mem/cache/tags/base.hh +++ b/src/mem/cache/tags/base.hh @@ -287,7 +287,7 @@ class BaseTags : public ClockedObject * @param pkt Packet holding the address to update * @param blk The block to update. */ - virtual void insertBlock(PacketPtr pkt, CacheBlk *blk); + virtual void insertBlock(const PacketPtr pkt, CacheBlk *blk); /** * Regenerate the block address. diff --git a/src/mem/cache/tags/base_set_assoc.hh b/src/mem/cache/tags/base_set_assoc.hh index 12b2efb2f..61a16584f 100644 --- a/src/mem/cache/tags/base_set_assoc.hh +++ b/src/mem/cache/tags/base_set_assoc.hh @@ -248,7 +248,7 @@ class BaseSetAssoc : public BaseTags * @param pkt Packet holding the address to update * @param blk The block to update. */ - void insertBlock(PacketPtr pkt, CacheBlk *blk) override + void insertBlock(const PacketPtr pkt, CacheBlk *blk) override { // Insert block BaseTags::insertBlock(pkt, blk); diff --git a/src/mem/cache/tags/fa_lru.cc b/src/mem/cache/tags/fa_lru.cc index 3a60e99f9..bcf785e27 100644 --- a/src/mem/cache/tags/fa_lru.cc +++ b/src/mem/cache/tags/fa_lru.cc @@ -208,7 +208,7 @@ FALRU::findVictim(Addr addr, const bool is_secure, } void -FALRU::insertBlock(PacketPtr pkt, CacheBlk *blk) +FALRU::insertBlock(const PacketPtr pkt, CacheBlk *blk) { FALRUBlk* falruBlk = static_cast(blk); diff --git a/src/mem/cache/tags/fa_lru.hh b/src/mem/cache/tags/fa_lru.hh index 7aec36a61..dee1af028 100644 --- a/src/mem/cache/tags/fa_lru.hh +++ b/src/mem/cache/tags/fa_lru.hh @@ -212,7 +212,7 @@ class FALRU : public BaseTags * @param pkt Packet holding the address to update * @param blk The block to update. */ - void insertBlock(PacketPtr pkt, CacheBlk *blk) override; + void insertBlock(const PacketPtr pkt, CacheBlk *blk) override; /** * Generate the tag from the addres. For fully associative this is just the diff --git a/src/mem/cache/tags/sector_tags.cc b/src/mem/cache/tags/sector_tags.cc index 27e89829d..cec7bd413 100644 --- a/src/mem/cache/tags/sector_tags.cc +++ b/src/mem/cache/tags/sector_tags.cc @@ -194,7 +194,7 @@ SectorTags::getPossibleLocations(Addr addr) const } void -SectorTags::insertBlock(PacketPtr pkt, CacheBlk *blk) +SectorTags::insertBlock(const PacketPtr pkt, CacheBlk *blk) { // Insert block BaseTags::insertBlock(pkt, blk); diff --git a/src/mem/cache/tags/sector_tags.hh b/src/mem/cache/tags/sector_tags.hh index 3fc8ae476..d0dc1f7e3 100644 --- a/src/mem/cache/tags/sector_tags.hh +++ b/src/mem/cache/tags/sector_tags.hh @@ -152,7 +152,7 @@ class SectorTags : public BaseTags * @param pkt Packet holding the address to update * @param blk The block to update. */ - void insertBlock(PacketPtr pkt, CacheBlk *blk) override; + void insertBlock(const PacketPtr pkt, CacheBlk *blk) override; /** * Finds the given address in the cache, do not update replacement data.