data.cache.write_only


template <
    typename Key,
    typename Word,
    auto WordCount,
    typename LUtime,
    auto Associativity,
    auto Depth,
    auto Banks = 1
    >
class cache §source

A cache that only supports write operations with word-enable bits.

Parameters

  • typename Key
    

    The type of key for looking up a value in the cache.

  • typename Word
    

    The type of a single word stored in the cache.

  • auto WordCount
    

    The maximum number of words that can be written at one time.

  • typename LUtime
    

    The type to use for storing the time a cache entry was most recently used. Using a wider type makes LRU eviction more accurate for a set associative cache, but for a direct cache where LRU does not apply, using uint1 saves space.

  • auto Associativity
    

    The number of entries to store for a given hash value, keeping the most recently used values. Pass 1 to create a directly mapped cache.

  • auto Depth
    

    The total number of entries to cache. Must be a multiple of Associativity.

  • auto Banks = 1
    

    The number of memory banks cache memory is split into.

Callbacks and Fields

  • (Key key, optional<Word>[WordCount] data) -> void store §source
    

    Function used to write to the backing store.

Methods

  • void initialize() §source
    

    Initialize the cache. This must be called before using the cache. The caller must ensure that intialize is not called concurrently with other methods.

  • void flush() §source
    

    Write any unwritten data out of the cache. The caller must ensure that flush is not called concurrently with other methods.

  • void
    write(
        Key key,
        cache::set_index_t set_index,
        optional<Word>[WordCount] words
        ) §source
    

    Write an array of words into the cache.

    Arguments

    • Key key
      

      Key to lookup.

    • cache::set_index_t set_index
      

      Hashed value of key.

    • optional<Word>[WordCount] words
      

      Values to store.