[gem5-dev] Change in gem5/gem5[master]: mem-cache: Remove findBlockBySetAndWay
Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/12765 Change subject: mem-cache: Remove findBlockBySetAndWay .. mem-cache: Remove findBlockBySetAndWay Remove findBlockBySetAndWay from the tags classes, as they imply the existence of sets and ways, which are placement policy concepts. Change-Id: I51a95fb9479b8ae12c86d1579a0d82ce43e07d07 --- M src/mem/cache/tags/base.hh M src/mem/cache/tags/base_set_assoc.cc M src/mem/cache/tags/base_set_assoc.hh M src/mem/cache/tags/fa_lru.cc M src/mem/cache/tags/fa_lru.hh M src/mem/cache/tags/sector_tags.cc M src/mem/cache/tags/sector_tags.hh 7 files changed, 0 insertions(+), 55 deletions(-) diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh index b2c0adb..4f7b4ff 100644 --- a/src/mem/cache/tags/base.hh +++ b/src/mem/cache/tags/base.hh @@ -220,15 +220,6 @@ virtual CacheBlk *findBlock(Addr addr, bool is_secure) const; /** - * Find a block given set and way. - * - * @param set The set of the block. - * @param way The way of the block. - * @return The block. - */ -virtual ReplaceableEntry* findBlockBySetAndWay(int set, int way) const = 0; - -/** * Align an address to the block size. * @param addr the address to align. * @return The block address. diff --git a/src/mem/cache/tags/base_set_assoc.cc b/src/mem/cache/tags/base_set_assoc.cc index 0d74eb9..a7b8638 100644 --- a/src/mem/cache/tags/base_set_assoc.cc +++ b/src/mem/cache/tags/base_set_assoc.cc @@ -125,12 +125,6 @@ replacementPolicy->invalidate(blk->replacementData); } -ReplaceableEntry* -BaseSetAssoc::findBlockBySetAndWay(int set, int way) const -{ -return sets[set][way]; -} - Addr BaseSetAssoc::getSetFromIndex(const Addr index) const { diff --git a/src/mem/cache/tags/base_set_assoc.hh b/src/mem/cache/tags/base_set_assoc.hh index 886c735..2973c70 100644 --- a/src/mem/cache/tags/base_set_assoc.hh +++ b/src/mem/cache/tags/base_set_assoc.hh @@ -186,15 +186,6 @@ } /** - * Find a block given set and way. - * - * @param set The set of the block. - * @param way The way of the block. - * @return The block. - */ -ReplaceableEntry* findBlockBySetAndWay(int set, int way) const override; - -/** * Find replacement victim based on address. The list of evicted blocks * only contains the victim. * diff --git a/src/mem/cache/tags/fa_lru.cc b/src/mem/cache/tags/fa_lru.cc index 3739994..2bf3a70 100644 --- a/src/mem/cache/tags/fa_lru.cc +++ b/src/mem/cache/tags/fa_lru.cc @@ -201,13 +201,6 @@ return blk; } -ReplaceableEntry* -FALRU::findBlockBySetAndWay(int set, int way) const -{ -assert(set == 0); -return [way]; -} - CacheBlk* FALRU::findVictim(Addr addr, const bool is_secure, std::vector& evict_blks) const diff --git a/src/mem/cache/tags/fa_lru.hh b/src/mem/cache/tags/fa_lru.hh index 55fc3eb..2827d99 100644 --- a/src/mem/cache/tags/fa_lru.hh +++ b/src/mem/cache/tags/fa_lru.hh @@ -207,15 +207,6 @@ CacheBlk* findBlock(Addr addr, bool is_secure) const override; /** - * Find a block given set and way. - * - * @param set The set of the block. - * @param way The way of the block. - * @return The block. - */ -ReplaceableEntry* findBlockBySetAndWay(int set, int way) const override; - -/** * Find replacement victim based on address. The list of evicted blocks * only contains the victim. * diff --git a/src/mem/cache/tags/sector_tags.cc b/src/mem/cache/tags/sector_tags.cc index 6a47db7..a0c4f1d 100644 --- a/src/mem/cache/tags/sector_tags.cc +++ b/src/mem/cache/tags/sector_tags.cc @@ -260,12 +260,6 @@ return nullptr; } -ReplaceableEntry* -SectorTags::findBlockBySetAndWay(int set, int way) const -{ -return sets[set][way]; -} - CacheBlk* SectorTags::findVictim(Addr addr, const bool is_secure, std::vector& evict_blks) const diff --git a/src/mem/cache/tags/sector_tags.hh b/src/mem/cache/tags/sector_tags.hh index 6f34db3..b8295f5 100644 --- a/src/mem/cache/tags/sector_tags.hh +++ b/src/mem/cache/tags/sector_tags.hh @@ -178,15 +178,6 @@ CacheBlk* findBlock(Addr addr, bool is_secure) const override; /** - * Find a sector block given set and way. - * - * @param set The set of the block. - * @param way The way of the block. - * @return The block. - */ -ReplaceableEntry* findBlockBySetAndWay(int set, int way) const override; - -/** * Find replacement victim based on address. * * @param addr Address to find a victim for. -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12765 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master
[gem5-dev] Change in gem5/gem5[master]: mem-cache: Remove findBlockBySetAndWay
Hello Jason Lowe-Power, Nikos Nikoleris, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/10141 to look at the new patch set (#2). Change subject: mem-cache: Remove findBlockBySetAndWay .. mem-cache: Remove findBlockBySetAndWay With a sector cache you can't find a block using only its set and way, as there is the sector offset to take into account. As it is not used anywhere in the code, I've opted to remove it, but I could make it return a SectorBlk instead. Change-Id: I4730a2b4ebb5738f7fc118201e208a1b9c3ba8e8 --- M src/mem/cache/tags/base.hh M src/mem/cache/tags/base_set_assoc.cc M src/mem/cache/tags/base_set_assoc.hh M src/mem/cache/tags/fa_lru.cc M src/mem/cache/tags/fa_lru.hh 5 files changed, 0 insertions(+), 37 deletions(-) -- To view, visit https://gem5-review.googlesource.com/10141 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I4730a2b4ebb5738f7fc118201e208a1b9c3ba8e8 Gerrit-Change-Number: 10141 Gerrit-PatchSet: 2 Gerrit-Owner: Daniel CarvalhoGerrit-Reviewer: Daniel Carvalho Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Nikos Nikoleris Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: mem-cache: Remove findBlockBySetAndWay
Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/10141 Change subject: mem-cache: Remove findBlockBySetAndWay .. mem-cache: Remove findBlockBySetAndWay With a sector cache you can't find a block using only its set and way, as there is the sector offset to take into account. As it is not used anywhere in the code, I've opted to remove it, but I could make it return a SectorBlk instead. Change-Id: I4730a2b4ebb5738f7fc118201e208a1b9c3ba8e8 --- M src/mem/cache/tags/base.hh M src/mem/cache/tags/base_set_assoc.cc M src/mem/cache/tags/base_set_assoc.hh M src/mem/cache/tags/fa_lru.cc M src/mem/cache/tags/fa_lru.hh 5 files changed, 0 insertions(+), 37 deletions(-) diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh index 4cf6774..29b9606 100644 --- a/src/mem/cache/tags/base.hh +++ b/src/mem/cache/tags/base.hh @@ -214,14 +214,6 @@ } /** - * Find the cache block given set and way - * @param set The set of the block. - * @param way The way of the block. - * @return The cache block. - */ -virtual CacheBlk *findBlockBySetAndWay(int set, int way) const = 0; - -/** * Limit the allocation for the cache ways. * @param ways The maximum number of ways available for replacement. */ diff --git a/src/mem/cache/tags/base_set_assoc.cc b/src/mem/cache/tags/base_set_assoc.cc index 49a6e9d..1761109 100644 --- a/src/mem/cache/tags/base_set_assoc.cc +++ b/src/mem/cache/tags/base_set_assoc.cc @@ -116,12 +116,6 @@ return blk; } -CacheBlk* -BaseSetAssoc::findBlockBySetAndWay(int set, int way) const -{ -return sets[set].blks[way]; -} - std::string BaseSetAssoc::print() const { std::string cache_state; diff --git a/src/mem/cache/tags/base_set_assoc.hh b/src/mem/cache/tags/base_set_assoc.hh index 06e9583..ad04f0b 100644 --- a/src/mem/cache/tags/base_set_assoc.hh +++ b/src/mem/cache/tags/base_set_assoc.hh @@ -119,14 +119,6 @@ virtual ~BaseSetAssoc() {}; /** - * Find the cache block given set and way - * @param set The set of the block. - * @param way The way of the block. - * @return The cache block. - */ -CacheBlk *findBlockBySetAndWay(int set, int way) const override; - -/** * Access block and update replacement data. May not succeed, in which case * nullptr is returned. This has all the implications of a cache * access and should only be used as such. Returns the access latency as a diff --git a/src/mem/cache/tags/fa_lru.cc b/src/mem/cache/tags/fa_lru.cc index 43d3498..2a1c9b9 100644 --- a/src/mem/cache/tags/fa_lru.cc +++ b/src/mem/cache/tags/fa_lru.cc @@ -190,13 +190,6 @@ } CacheBlk* -FALRU::findBlockBySetAndWay(int set, int way) const -{ -assert(set == 0); -return [way]; -} - -CacheBlk* FALRU::findVictim(Addr addr) { return tail; diff --git a/src/mem/cache/tags/fa_lru.hh b/src/mem/cache/tags/fa_lru.hh index d3f8662..98369df 100644 --- a/src/mem/cache/tags/fa_lru.hh +++ b/src/mem/cache/tags/fa_lru.hh @@ -197,14 +197,6 @@ void insertBlock(PacketPtr pkt, CacheBlk *blk) override; /** - * Find the cache block given set and way - * @param set The set of the block. - * @param way The way of the block. - * @return The cache block. - */ -CacheBlk* findBlockBySetAndWay(int set, int way) const override; - -/** * Generate the tag from the addres. For fully associative this is just the * block address. * @param addr The address to get the tag from. -- To view, visit https://gem5-review.googlesource.com/10141 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I4730a2b4ebb5738f7fc118201e208a1b9c3ba8e8 Gerrit-Change-Number: 10141 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel CarvalhoGerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev