base, mem-cache: Rewrite TaggedEntry code
The only difference between the TaggedEntry and the newly defined CacheEntry is the presence of the secure flag in the first case. The need to tag a cache entry according to the security bit required the overloading of the matching methods in the TaggedEntry class to take security into account (See matchTag [1]), and the persistance after PR #745 of the AssociativeSet class which is basically identical to its AssociativeCache superclass, only it overrides its virtual method to match the tag according to the secure bit as well. The introduction of the KeyType parameter in the previous commit will smoothe the differences and help unifying the interface. Rather than overloading and overriding to account for a different signature, we embody the difference in the KeyType class. A CacheEntry will match with KeyType = Addr, whereas a TaggedEntry will use the following lookup type proposed in this patch: struct KeyType { Addr address; bool secure; } This patch is partly reverting the changes in #745 which were reimplementing TaggedEntry on top of the CacheEntry. Instead we keep them separate as the plan is to allow different entry types with templatization rather than polymorphism. As a final note, I believe a separate commit will have to change the naming of our entries; the CacheEntry should probably be renamed into TaggedEntry and the current TaggedEntry into something that reflect the presence of the security bit alongside the traditional address tag [1]: https://github.com/gem5/gem5/blob/stable/\ src/mem/cache/tags/tagged_entry.hh#L81 Change-Id: Ifc104c8d0c1d64509f612d87b80d442e0764f7ca Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
6
src/base/cache/cache_entry.hh
vendored
6
src/base/cache/cache_entry.hh
vendored
@@ -122,12 +122,6 @@ class CacheEntry : public ReplaceableEntry
|
||||
isValid(), ReplaceableEntry::print());
|
||||
}
|
||||
|
||||
void
|
||||
setIndexingPolicy(BaseIndexingPolicy *ip)
|
||||
{
|
||||
indexingPolicy = ip;
|
||||
}
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Set tag associated to this block.
|
||||
|
||||
Reference in New Issue
Block a user