DynamoRIO
|
#include <cache_replacement_policy.h>

Public Member Functions | |
virtual void | access_update (int set_idx, int way, cache_access_outcome_t access_type)=0 |
Informs the replacement policy that an access has occurred. | |
virtual void | eviction_update (int set_idx, int way)=0 |
Informs the replacement policy that an eviction has occurred. | |
virtual void | invalidation_update (int set_idx, int way)=0 |
Informs the replacement policy that an invalidation has occurred. | |
virtual std::string | get_name () const =0 |
Returns the name of the replacement policy. | |
Detailed Description
An interface for cache replacement policies.
Holds the necessary information to implement a cache replacement policy, and provides a replacement-specific get_next_way_to_replace() method for caching_device_t
.
The policy receives the following updates:
- When an existing way is accessed,
access_update()
is called. - When a way is evicted,
eviction_update()
is called on the evicted way, andaccess_update()
is called on the new way immediately after. Can be called on invalid ways. - When a way is invalidated,
invalidation_update()
is called.
The policy also provides a get_next_way_to_replace()
method that returns the next way to replace in the block. This function assumes that all ways are valid, and is called by caching_device_t
when it cannot just replace an invalid way.
Note that the policy receives the set index, not the block index as it is in caching_device_t
, which is the index of the first way in the set when all ways are stored in a contiguous array. This can be obtained with compute_set_index()
in caching_device_t.
The documentation for this class was generated from the following file:
- /home/runner/work/dynamorio/dynamorio/build_release-64/clients/include/drmemtrace/cache_replacement_policy.h