cache_pkg.vhd 777 B

123456789101112131415161718192021222324252627
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use work.mem_pkg.all;
  4. package cache_pkg is
  5. constant WAYS_LD : natural := 1;
  6. constant SETS_LD : natural := 3;
  7. constant INDEX_SIZE : natural := SETS_LD;
  8. constant TAG_SIZE : natural := ADDR_WIDTH - INDEX_SIZE;
  9. constant WAYS : natural := 2**WAYS_LD;
  10. constant SETS : natural := 2**SETS_LD;
  11. subtype ways_range is natural range 0 to WAYS - 1;
  12. subtype sets_range is natural range 0 to SETS - 1;
  13. subtype c_tag_type is std_logic_vector(TAG_SIZE - 1 downto 0);
  14. subtype c_index_type is std_logic_vector(INDEX_SIZE - 1 downto 0);
  15. subtype c_way_type is std_logic_vector(WAYS_LD - 1 downto 0);
  16. type c_mgmt_info is record
  17. valid : std_logic;
  18. dirty : std_logic;
  19. replace : std_logic;
  20. tag : c_tag_type;
  21. end record;
  22. end package;