PoC.sort.lru_listΒΆ

List storing (key, value) pairs. The least-recently inserted pair is outputed on DataOut if Valid = '1'. If Valid = '0', then the list empty.

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

Supported operations:
  • Insert: Insert DataIn as recently used (key, value) pair. If key is already within the list, then the corresponding value is updated and the pair is moved to the recently used position.
  • Remove: Remove (key, value) pair with the given key. The list is not modified if key is not within the list.

Entity Declaration:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
entity sort_lru_list is
  generic (
    ELEMENTS                  : positive                        := 16;
    KEY_BITS                  : positive                        := 4;
    DATA_BITS                 : positive                        := 8;
    INITIAL_ELEMENTS          : T_SLM                           := (0 to 15 => (0 to 7 => '0'));
    INITIAL_VALIDS            : std_logic_vector                := (0 to 15 => '0')
  );
  port (
    Clock                     : in  std_logic;
    Reset                     : in  std_logic;

    Insert                    : in  std_logic;
    Remove                    : in  std_logic;
    DataIn                    : in  std_logic_vector(DATA_BITS - 1 downto 0);

    Valid                     : out std_logic;
    DataOut                   : out std_logic_vector(DATA_BITS - 1 downto 0)
  );
end entity;