PoC.sort.lru_cache

This is an optimized implementation of sort_lru_list to be used for caches. Only keys are stored within this list, and these keys are the index of the cache lines. The list initially contains all indizes from 0 to ELEMENTS-1. The least-recently used index KeyOut is always valid.

The first outputed least-recently used index will be ELEMENTS-1.

The inputs Insert, Free, KeyIn, and Reset are synchronous to the rising-edge of the clock clock. All control signals are high-active.

Supported operations:
  • Insert: Mark index KeyIn as recently used, e.g., when a cache-line was accessed.

  • Free: Mark index KeyIn as least-recently used. Apply this operation, when a cache-line gets invalidated.

Entity Declaration:

 1  generic (
 2    ELEMENTS       : positive         := 32
 3  );
 4  port (
 5    Clock   : in std_logic;
 6    Reset   : in std_logic;
 7
 8    Insert  : in  std_logic;
 9    Free    : in  std_logic;
10    KeyIn   : in  std_logic_vector(log2ceilnz(ELEMENTS) - 1 downto 0);
11
12    KeyOut  : out std_logic_vector(log2ceilnz(ELEMENTS) - 1 downto 0)
13  );
14end entity;