summaryrefslogtreecommitdiff
path: root/src/mem/cache/tags/sector_tags.hh
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2018-03-09 15:16:41 +0100
committerDaniel Carvalho <odanrc@yahoo.com.br>2018-10-10 18:17:42 +0000
commitf32882d4fc78af3747f81375dfd1ec3e37596c2b (patch)
tree19695aa226b552751fbb672efb95ee6e75819073 /src/mem/cache/tags/sector_tags.hh
parent8f58d9fb87c521674f11c78b8939e5ffdf851d39 (diff)
downloadgem5-f32882d4fc78af3747f81375dfd1ec3e37596c2b.tar.xz
mem-cache: Split Tags for indexing policies
Split indexing functionality from tags, so that code duplication is reduced when adding new classes that use different indexing policies, such as set associative, skewed associative or other hash-based policies. An indexing policy defines the mapping between an address' set and its physical location. For example, a conventional set assoc cache maps an address to all ways in a set using an immutable function, that is, a set x is always mapped to set x. However, skewed assoc caches map an address to a different set for each way, using a skewing function. FALRU has been left unmodified as it is a specialization with its own complexity. Change-Id: I0838b41663f21eba0aeab7aeb7839e3703ca3324 Reviewed-on: https://gem5-review.googlesource.com/c/8885 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/mem/cache/tags/sector_tags.hh')
-rw-r--r--src/mem/cache/tags/sector_tags.hh59
1 files changed, 4 insertions, 55 deletions
diff --git a/src/mem/cache/tags/sector_tags.hh b/src/mem/cache/tags/sector_tags.hh
index c3c3bc8f9..518ab28a9 100644
--- a/src/mem/cache/tags/sector_tags.hh
+++ b/src/mem/cache/tags/sector_tags.hh
@@ -30,7 +30,7 @@
/**
* @file
- * Declaration of a sector set associative tag store.
+ * Declaration of a sector tag store.
*/
#ifndef __MEM_CACHE_TAGS_SECTOR_TAGS_HH__
@@ -58,11 +58,6 @@ class ReplaceableEntry;
class SectorTags : public BaseTags
{
protected:
- /** Typedef the set type used in this tag store. */
- typedef std::vector<SectorBlk*> SetType;
-
- /** The associativity of the cache. */
- const unsigned assoc;
/** The allocatable associativity of the cache (alloc mask). */
unsigned allocAssoc;
@@ -77,40 +72,19 @@ class SectorTags : public BaseTags
/** The number of sectors in the cache. */
const unsigned numSectors;
- /** The number of sets in the cache. */
- const unsigned numSets;
/** The cache blocks. */
std::vector<SectorSubBlk> blks;
/** The cache sector blocks. */
std::vector<SectorBlk> secBlks;
- /** The cache sets. */
- std::vector<SetType> sets;
- // Organization of an address: Tag | Set # | Sector Offset # | Offset #
+ // Organization of an address:
+ // Tag | Placement Location | Sector Offset # | Offset #
/** The amount to shift the address to get the sector tag. */
const int sectorShift;
- /** The amount to shift the address to get the set. */
- const int setShift;
- /** The amount to shift the address to get the tag. */
- const int tagShift;
/** Mask out all bits that aren't part of the sector tag. */
const unsigned sectorMask;
- /** Mask out all bits that aren't part of the set index. */
- const unsigned setMask;
-
- /**
- * Find all possible block locations for insertion and replacement of
- * an address. Should be called immediately before ReplacementPolicy's
- * findVictim() not to break cache resizing.
- * Returns sector blocks in all ways belonging to the set of the address.
- *
- * @param addr The addr to a find possible locations for.
- * @return The possible locations.
- */
- std::vector<ReplaceableEntry*> getPossibleLocations(const Addr addr) const
- override;
public:
/** Convenience typedef. */
@@ -178,15 +152,6 @@ class SectorTags : public BaseTags
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.
@@ -198,22 +163,6 @@ class SectorTags : public BaseTags
std::vector<CacheBlk*>& evict_blks) const override;
/**
- * Generate the sector tag from the given address.
- *
- * @param addr The address to get the sector tag from.
- * @return The sector tag of the address.
- */
- Addr extractTag(Addr addr) const override;
-
- /**
- * Calculate the set index from the address.
- *
- * @param addr The address to get the set from.
- * @return The set index of the address.
- */
- int extractSet(Addr addr) const;
-
- /**
* Calculate a block's offset in a sector from the address.
*
* @param addr The address to get the offset from.
@@ -222,7 +171,7 @@ class SectorTags : public BaseTags
int extractSectorOffset(Addr addr) const;
/**
- * Regenerate the block address from the tag and set.
+ * Regenerate the block address from the tag and location.
*
* @param block The block.
* @return the block address.