PoC.sort.LeastRecentlyUsed_Cache

This is an optimized implementation of sort_LeastRecentlyUsed_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  port (
 2    Clock   : in  std_logic;
 3    Reset   : in  std_logic;
 4
 5    Insert   : in  std_logic;
 6    Free     : in  std_logic;
 7    KeyIn     : in  std_logic_vector(log2ceilnz(ELEMENTS) - 1 downto 0);
 8
 9    KeyOut   : out std_logic_vector(log2ceilnz(ELEMENTS) - 1 downto 0)
10  );
11end entity;
12
13
14architecture rtl of sort_LeastRecentlyUsed_Cache is
15  constant KEY_BITS : positive := log2ceilnz(ELEMENTS);