No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MemoireInstructions.vhd 28KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ----------------------------------------------------------------------------------
  2. -- Company: INSA-Toulouse
  3. -- Engineer: Paul Faure
  4. --
  5. -- Create Date: 16.04.2021 14:35:04
  6. -- Module Name: MemoireInstructions - Behavioral
  7. -- Project Name: Processeur sécurisé
  8. -- Target Devices: Basys 3 ARTIX7
  9. -- Tool Versions: Vivado 2016.4
  10. --
  11. -- Description: Memoire d'instruction
  12. -- - Accessible en lecture uniquement
  13. --
  14. -- Dependencies: None
  15. --
  16. -- Comments : Memoire circulaire, si l'adresse est utilisée modulo la taille de la mémoire
  17. ----------------------------------------------------------------------------------
  18. library IEEE;
  19. use IEEE.STD_LOGIC_1164.ALL;
  20. use IEEE.NUMERIC_STD.ALL;
  21. entity MemoireInstructions is
  22. Generic (Nb_bits : Natural; -- Taille d'une instruction en mémoire (Taille d'un code instruction + 3*Taille d'un mot binaire)
  23. Addr_size : Natural; -- Nombre de bits pour adresser la mémoire
  24. Mem_size : Natural); -- Taille de la mémoire (nombre d'instructions stockées)
  25. Port ( Addr : in STD_LOGIC_VECTOR (Addr_size-1 downto 0); -- Une adresse
  26. D_OUT : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0) := (others => '0')); -- L'instruction presente a cette adresse
  27. end MemoireInstructions;
  28. architecture Behavioral of MemoireInstructions is
  29. signal MEMORY : STD_LOGIC_VECTOR ((Mem_Size * Nb_bits)-1 downto 0) := "1011000000000000000000000000000000000000000000000000010010000000000000000000000000000000000000000000000000010010000000000000000000000000000101000000000000000001000100000000000000000000000000000000000000000000000001000000000000000000000000000000000100000000000000000010100000000000000010000000000000000000000000000000001001000000000000000010000000000000000000000000000000010010000000000000000000000000000000000000000000000000010010000000000000001000000000011110100000000000000000100100000000000000000000000001100001000000000000000010100000000010111110100000000000000100000000000000000101000000000000000001000000000000001000000000000000000101100000000000100110000000000000011000000000000000001011000000000001001000000000000000100000000000000000010110000000000010001000000000000000100000000000000000101100000000000100000000000000000000000000000000000001011000000000000111100000000000011110000000000000000010110000000000001110000000000000111000000000000000000101100000000000011010000000000001101000000000000000001011000000000000110000000000000011000000000000000000010110000000000001011000000000000101100000000000000000101100000000000010100000000000001010000000000000000001011000000000000100100000000000010010000000000000000010110000000000001000000000000000100000000000000000000101100000000000001110000000000000111000000000000000001011000000000000011000000000000001100000000000000000010110000000000000001000000000000010100000000000000000101100000000000000000000000000000100000000000000000001001000000000000010100000000000000000000000000000000010110000000000000101000000000000010100000000000000000100100000000000001000000000000000000000000000000000001011000000000000010000000000000001000000000000000000100100000000000000011000000000000000000000000000000001001000000000000000100000000000000000000000000000000010010000000000000000100000000000000000000000000000000100100000000000000000000000000000000000000000000000000100100000000000000110000000000001010000000000000000001011000000000000001100000000000000110000000000000000010010000000000000010000000000000101000000000000000000101100000000000000100000000000000010000000000000000001001000000000000000100000000011001010000000000000000010110000000000000001000000000000000100000000000000000100100000000000000000000000001101101000000000000000001011000000000000000000000000000000000000000000000000100100000000000001111000000000000000000000000000000001001000000000000011100000000000000000000000000000000010010000000000000110100000000000000000000000000000000100100000000000001100000000000000000000000000000000000100100000000000011110000000001101101000000000000000001001000000000000111000000000011000010000000000000000010010000000000001101000000000111001000000000000000000100100000000000011000000000001100111000000000000000010010000000000000101100000000000000000000000000000000100100000000000001010000000000000000000000000000000001001000000000000010010000000000000000000000000000000010010000000000000100000000000000000000000000000000000010010000000000001011000000000110111100000000000000000100100000000000010100000000001110010000000000000000001001000000000000100100000000011100000000000000000000010010000000000001000000000000010000000000000000000001001000000000000001110000000000000000000000000000000010010000000000000011000000000000000000000000000000000100100000000000000101000000000000000000000000000000001001000000000000001000000000000000000000000000000000001001000000000000011100000000011101010000000000000000010010000000000000110000000000110010000000000000000000100100000000000001010000000000100000000000000000000001001000000000000010000000000011101000000000000000000100100000000000000011000000000000000000000000000000001001000000000000000100000000000000000000000000000000010010000000000000000100000000000000000000000000000000100100000000000000000000000000000000000000000000000000100100000000000000110000000001110101000000000000000001001000000000000001000000000011000100000000000000000010010000000000000001000000000110010100000000000000000100100000000000000000000000001000100000000000000000010101000000000000000000000000000000000000000000000000010110000000000010001000000000000000100000000000000000101100000000000100000000000000000000000000000000000001011000000000000111100000000000011110000000000000000010110000000000001110000000000000111000000000000000000101100000000000011010000000000001101000000000000000001011000000000000110000000000000011000000000000000000010110000000000001011000000000000101100000000000000000101100000000000010100000000000001010000000000000000001011000000000000100100000000000010010000000000000000010110000000000001000000000000000100000000000000000000101100000000000001110000000000000111000000000000000001011000000000000011000000000000001100000000000000000010110000000000000101000000000000010100000000000000000101100000000000001000000000000000100000000000000000001011000000000000001100000000000000110000000000000000010110000000000000010000000000000001000000000000000001001000000000000000010000000000000000000000000000000010010000000000000000000000000000000000000000000000000010010000000000000001000000000000101000000000000000000101100000000000000010000000000000001000000000000000001001000000000000000000000000011001010000000000000000010110000000000000000000000000000000000000000000000001001000000000000011110000000000000000000000000000000010010000000000000111000000000000000000000000000000000100100000000000001101000000000000000000000000000000001001000000000000011000000000000000000000000000000000001001000000000000111100000000011011010000000000000000010010000000000001110000000000110100100000000000000000100100000000000011010000000001110100000000000000000001001000000000000110000000000011010010000000000000000100100000000000001011000000000000000000000000000000001001000000000000010100000000000000000000000000000000010010000000000000100100000000000000000000000000000000100100000000000001000000000000000000000000000000000000100100000000000010110000000001100111000000000000000001001000000000000101000000000011001010000000000000000010010000000000001001000000000110110000000000000000000100100000000000010000000000000100000000000000000000010010000000000000011100000000000000000000000000000000100100000000000000110000000000000000000000000000000001001000000000000001010000000000000000000000000000000010010000000000000010000000000000000000000000000000000010010000000000000111000000000110111000000000000000000100100000000000001100000000001101111000000000000000001001000000000000010100000000011010010000000000000000010010000000000000100000000000111010000000000000000001001000000000000000110000000000000000000000000000000010010000000000000001000000000000000000000000000000000100100000000000000001000000000000000000000000000000001001000000000000000000000000000000000000000000000000001001000000000000001100000000011000110000000000000000010010000000000000010000000000110111000000000000000000100100000000000000010000000001101111000000000000000001001000000000000000000000000010001100000000000000000101010000000000000000000000000000000000000000000000000101100000000000011110000000000000111000000000000000001011000000000000111000000000000001100000000000000000010110000000000001101000000000000010100000000000000000101100000000000011000000000000000100000000000000000001011000000000000101100000000000000110000000000000000010110000000000001010000000000000001000000000000000000101100000000000010010000000000000001000000000000000001011000000000000100000000000000000000000000000000000010110000000000000111000000000000111100000000000000000101100000000000001100000000000001110000000000000000001011000000000000010100000000000011010000000000000000010110000000000000100000000000000110000000000000000000101100000000000000110000000000001011000000000000000001011000000000000001000000000000010100000000000000000010110000000000000000000000000000100000000000000000000111100000001011001110000000000000000000000000000000010000000000010110110100000000000000000000000000000000000110000000000001001000000000000100100000000000010000100100000000000010010000000000000000000000000000000001011000000000000000100000000000010010000000000000000010010000000000001000000000000000000100000000000000001001000000000000001110000000000000000000000000000000010010000000000000011000000000000000000000000000000000100100000000000000101000000000000000000000000000000001001000000000000001000000000000000000000000000000000001001000000000000011100000000011010110000000000000000010110000000000010000000000000000011100000000000000000100100000000000001100000000001110010000000000000000001011000000000000111100000000000001100000000000000000010010000000000000101000000000110000100000000000000000101100000000000011100000000000000101000000000000000001001000000000000010000000000010110010000000000000000010110000000000001101000000000000010000000000000000001001000000000000000110000000000000000000000000000000010010000000000000001000000000000000000000000000000000100100000000000000001000000000000000000000000000000001001000000000000000000000000000000000000000000000000001001000000000000001100000000001000000000000000000000010110000000000001100000000000000001100000000000000000100100000000000000100000000001101011000000000000000001011000000000000101100000000000000100000000000000000010010000000000000001000000000111001000000000000000000101100000000000010100000000000000001000000000000000001001000000000000000000000000011000010000000000000000010110000000000001001000000000000000000000000000000001001000000000000011110000000000000000000000000000000010010000000000000111000000000000000000000000000000000100100000000000001101000000000000000000000000000000001001000000000000011000000000000000000000000000000000001001000000000000111100000000010110010000000000000000010110000000000001000000000000000111100000000000000000100100000000000011100000000000100000000000000000000001011000000000000011100000000000011100000000000000000010010000000000001101000000000110101100000000000000000101100000000000001100000000000001101000000000000000001001000000000000110000000000011100100000000000000000010110000000000000101000000000000110000000000000000001001000000000000010110000000000000000000000000000000010010000000000000101000000000000000000000000000000000100100000000000001001000000000000000000000000000000001001000000000000010000000000000000000000000000000000001001000000000000101100000000011000010000000000000000010110000000000000100000000000000101100000000000000000100100000000000010100000000001011001000000000000000001011000000000000001100000000000010100000000000000000010010000000000001001000000000010000000000000000000000101100000000000000100000000000001001000000000000000001001000000000000100000000000001000000000000000000000010110000000000000001000000000000100000000000000000001001000000000000001110000000000000000000000000000000001001000000000000011100000000000010100000000000000000010110000000000000000000000000000011100000000000000001001000000000000001100000000000000000000000000000000010010000000000000010100000000000000000000000000000000100100000000000000100000000000000000000000000000000001001000000000000000110000000000000000000000000000000001001000000000000011000000000000010100000000000000000010110000000000010110000000000000011000000000000000000100100000000000001010000000000101111000000000000000001011000000000001010100000000000001010000000000000000010010000000000000100000000000101111100000000000000000100100000000000000110000000001011111000000000000000010010000000000000001000000000000000000000000000000000100100000000000000001000000000000000000000000000000001001000000000000000000000000000000000000000000000000010010000000000000111100000000000000000000000000000000010010000000000000010000000000101110000000000000000000100100000000000000010000000001111100000000000000000001001000000000000000000000000010111110000000000000000010010000000000001111000000000010000000000000000000001001000000000000011100000000000000000000000000000000010010000000000000110100000000000000000000000000000000100100000000000001100000000000000000000000000000000001001000000000000010110000000000000000000000000000000001001000000000000111000000000011111000000000000000000010010000000000001101000000000101111100000000000000000100100000000000011000000000000100000000000000000000001001000000000000101100000000011111000000000000000000100100000000000001010000000000000000000000000000000001001000000000000010010000000000000000000000000000000010010000000000000100000000000000000000000000000000000100100000000000000111000000000000000000000000000000000100100000000000010100000000000100000000000000000000001001000000000000100100000000001000000000000000000000010010000000000001000000000000010000000000000000000000100100000000000001110000000000100000000000000000000010010000000000000010000000000000000000000000000000000100100000000000000011000000000000000000000000000000000100100000000000001000000000000001010000000000000000001011000000000001010000000000000001000000000000000000010010000000000000011000000000010000000000000000000000101100000000000100110000000000000011000000000000000010010000000000000001000000000000000000000000000000000100100000000000000001000000000000000000000000000000001001000000000000000000000000000000000000000000000000010010000000000000111100000000000000000000000000000000010010000000000000010000000000010000000000000000000000100100000000000000010000000000101001000000000000000001001000000000000000000000000010111110000000000000000010010000000000001111000000000101111100000000000000001001000000000000011100000000000000000000000000000000010010000000000000110100000000000000000000000000000000100100000000000001100000000000000000000000000000000001001000000000000010110000000000000000000000000000000001001000000000000111000000000001010000000000000000000010010000000000001101000000000010110100000000000000000100100000000000011000000000000101101000000000000000001001000000000000101100000000011111000000000000000000100100000000000001010000000000000000000000000000000001001000000000000010010000000000000000000000000000000010010000000000000100000000000000000000000000000000000100100000000000000111000000000000000000000000000000000100100000000000010100000000000100000000000000000000001001000000000000100100000000001000000000000000000000010010000000000001000000000000010000000000000000000000100100000000000001110000000000100000000000000000000010010000000000000001000000000000000000000000000000000100100000000000000001000000000000000000000000000000001001000000000000000000000000000000000000000000000000010010000000000000111100000000000000000000000000000000010010000000000000010000000000000101000000000000000000100100000000000000010000000000101001000000000000000001001000000000000000000000000001100000000000000000000010010000000000001111000000000011000000000000000000001001000000000000011100000000000000000000000000000000010010000000000000110100000000000000000000000000000000100100000000000001100000000000000000000000000000000001001000000000000010110000000000000000000000000000000001001000000000000111000000000001010000000000000000000010010000000000001101000000000010000000000000000000000100100000000000011000000000000101001000000000000000001001000000000000101100000000011111000000000000000000100100000000000001010000000000000000000000000000000001001000000000000010010000000000000000000000000000000010010000000000000100000000000000000000000000000000000100100000000000000111000000000000000000000000000000000100100000000000010100000000000101000000000000000000001001000000000000100100000000001000000000000000000000010010000000000001000000000000010000000000000000000000100100000000000001110000000000100000000000000000000010010000000000000001000000000000000000000000000000000100100000000000000001000000000000000000000000000000001001000000000000000000000000000000000000000000000000010010000000000000111100000000000000000000000000000000010010000000000000010000000000000101000000000000000000101100000000000100100000000000000010000000000000000001001000000000000000100000000001010010000000000000000010110000000000010001000000000000000100000000000000000100100000000000000000000000001011111000000000000000001011000000000001000000000000000000000000000000000000010010000000000001111000000000101111100000000000000000101100000000000011110000000000001111000000000000000010010000000000000111000000000000000000000000000000000100100000000000001101000000000000000000000000000000001001000000000000011000000000000000000000000000000000010010000000000000101100000000000000000000000000000000010010000000000001110000000000010100000000000000000000101100000000000011100000000000001110000000000000000001001000000000000110100000000001000000000000000000000010110000000000001101000000000000110100000000000000000100100000000000011000000000000100000000000000000000001011000000000000110000000000000011000000000000000000010010000000000001011000000000010000000000000000000000101100000000000010110000000000001011000000000000000010010000000000000101000000000000000000000000000000000100100000000000001001000000000000000000000000000000001001000000000000010000000000000000000000000000000000010010000000000000011100000000000000000000000000000000010010000000000001010000000000010000000000000000000000101100000000000010100000000000001010000000000000000001001000000000000100100000000001000000000000000000000010110000000000001001000000000000100100000000000000000100100000000000010000000000000100000000000000000000001011000000000000100000000000000010000000000000000000010010000000000000111000000000010000000000000000000000101100000000000001110000000000000111000000000000000010010000000000000011000000000000000000000000000000000100100000000000000101000000000000000000000000000000001001000000000000001000000000000000000000000000000000001001000000000000011000000000000010100000000000000000010110000000000000110000000000000011000000000000000000100100000000000001010000000000001010000000000000000001011000000000000010100000000000001010000000000000000010010000000000000100000000000100010000000000000000000101100000000000001000000000000000100000000000000000010010000000000000001100000000000000000000000000000000100100000000000000010000000000000000000000000000000001001000000000000000010000000000000000000000000000000010010000000000000000000000000000000000000000000000000010010000000000000011000000000100010100000000000000000101100000000000000110000000000000011000000000000000001001000000000000001000000000010010110000000000000000010110000000000000010000000000000001000000000000000000100100000000000000010000000001000011000000000000000001011000000000000000100000000000000010000000000000000010010000000000000000000000000100000100000000000000000101100000000000000000000000000000000000000000000000010010000000000000111100000000000000000000000000000000100100000000000001110000000000000000000000000000000001001000000000000011010000000000000000000000000000000010010000000000000110000000000000000000000000000000000010010000000000001111000000000100100000000000000000000100100000000000011100000000000100000000000000000000001001000000000000110100000000010011100000000000000000010010000000000001100000000000100010100000000000000001001000000000000010110000000000000000000000000000000010010000000000000101000000000000000000000000000000000100100000000000001001000000000000000000000000000000001001000000000000010000000000000000000000000000000000001001000000000000101100000000010001010000000000000000010010000000000001010000000000100001000000000000000000100100000000000010010000000000100000000000000000000001001000000000000100000000000010001010000000000000000100100000000000000111000000000000000000000000000000001001000000000000001100000000000000000000000000000000010010000000000000010100000000000000000000000000000000100100000000000000100000000000000000000000000000000000100100000000000001110000000001010110000000000000000001001000000000000011000000000001001110000000000000000010010000000000000101000000000101010100000000000000000100100000000000001000000000001001111000000000000000010010000000000000001100000000000000000000000000000000100100000000000000010000000000000000000000000000000001001000000000000000010000000000000000000000000000000010010000000000000000000000000000000000000000000000000010010000000000000011000000000101100100000000000000000100100000000000000100000000000001010000000000000000001001000000000000000100000000000010100000000000000000010010000000000000000000000000000000000000000000000001010100000000000000000000000000000000000000000000000001011000000000010001000000000000000100000000000000000010110000000000100001000000000000000100000000000000000101100000000001000000000000000000000000000000000000001011000000000001111100000000000011110000000000000000010110000000000011110000000000000111000000000000000000101100000000000111010000000000001101000000000000000001011000000000001110000000000000011000000000000000000010110000000000011011000000000000101100000000000000000101100000000000110100000000000001010000000000000000001011000000000001100100000000000010010000000000000000010110000000000001001000000000000011100000000000000000101100000000000010000000000000000110000000000000000001011000000000000011100000000000010000000000000000000010110000000000000110000000000000010000000000000000000101100000000000001010000000000000011000000000000000001111000000000101100100000000000000000000000000000000010000000000000000100000000000000100000000000000000000000100000000000010000000000000001000000000000000011001001000000000000011000000000000000010000000000000000010000000000000001000000000000000010000000000000000000110100000000000010000000000000000110000000000000000001000000000000000011000000000000000110000000000000000000010000000000001000000000000000100000000000000001100101000000000000010000000000000000111000000000000000001011000000000001100000000000000010000000000000000000000100000000000000110000000000000011100000000000001100100100000000000001110000000000000001000000000000000000011000000000000011000000000000001100000000000000111010000000000000000111000000000000010000000000000000000100100000000000001100000000000000101000000000000000001110000000000000011100000000000001110000000000000000010010000000000000111000000000000000000000000000000001000000000000011100110000000000000000000000000000000000011000000000000011100000000000001110000000000000101010010000000000000111000000000000000000000000000000000101100000000000101110000000000000111000000000000000000101000000000000010100000000000001010000000000000110010010000000000000110000000000000100000000000000000000101100000000000101100000000000000110000000000000000001000000000000000010100000000000001000000000000000000010110000000000010101000000000000010100000000000000000100100000000000001000000000000000001000000000000000001011000000000001010000000000000001000000000000000000100110000000000000011000000000000000000000000000000000101100000000000100110000000000000011000000000000000010010000000000000001000000000000000000000000000000000100100000000000000001000000000000000000000000000000000100100000000000000100000000000001010000000000000000001011000000000001001000000000000000100000000000000000010010000000000000001000000000011101000000000000000000101100000000000100010000000000000001000000000000000010010000000000000000000000000000000000000000000000000100100000000000001111000000000000000000000000000000001001000000000000011100000000000000000000000000000000010010000000000000110100000000000000000000000000000000010010000000000000000000000000010000000000000000000000101100000000000100000000000000000000000000000000000001001000000000000111100000000011100100000000000000000010110000000000001111000000000000111100000000000000000100100000000000011100000000001110101000000000000000001011000000000000111000000000000011100000000000000000010010000000000001101000000000110010100000000000000000101100000000000011010000000000001101000000000000000010010000000000000110000000000000000000000000000000000100100000000000001011000000000000000000000000000000001001000000000000010100000000000000000000000000000000010010000000000000100100000000000000000000000000000000010010000000000001100000000000110110000000000000000000101100000000000011000000000000001100000000000000000001001000000000000101100000000011000010000000000000000010110000000000001011000000000000101100000000000000000100100000000000010100000000001110110000000000000000001011000000000000101000000000000010100000000000000000010010000000000001001000000000010000000000000000000000101100000000000010010000000000001001000000000000000010010000000000000100000000000000000000000000000000000100100000000000000111000000000000000000000000000000001001000000000000001100000000000000000000000000000000010010000000000000010100000000000000000000000000000000010010000000000001000000000000110010100000000000000000101100000000000010000000000000001000000000000000000001001000000000000011100000000011011100000000000000000010110000000000000111000000000000011100000000000000000100100000000000001100000000001110101000000000000000001011000000000000011000000000000001100000000000000000010010000000000000101000000000000101000000000000000000101100000000000001010000000000000101000000000000000010010000000000000010000000000000000000000000000000000100100000000000000011000000000000000000000000000000001001000000000000000100000000000000000000000000000000010010000000000000000100000000000000000000000000000000010010000000000000100000000000010000000000000000000000101100000000000001000000000000000100000000000000000001001000000000000001100000000011100100000000000000000010110000000000000011000000000000001100000000000000000100100000000000000100000000001101001000000000000000001011000000000000001000000000000000100000000000000000010010000000000000001000000000111001100000000000000000101100000000000000010000000000000001000000000000000010010000000000000000000000000000000000000000000000000100100000000000001111000000000000000000000000000000001001000000000000011100000000000000000000000000000000010010000000000000110100000000000000000000000000000000010010000000000000000000000000110100100000000000000000101100000000000000000000000000000000000000000000000001001000000000000111100000000011000010000000000000000010010000000000001110000000000111001100000000000000000100100000000000011010000000000100000000000000000000010010000000000000110000000000000000000000000000000000100100000000000001011000000000000000000000000000000001001000000000000010100000000000000000000000000000000010010000000000000100100000000000000000000000000000000010010000000000001100000000000111101000000000000000000100100000000000010110000000001100101000000000000000001001000000000000101000000000011011000000000000000000010010000000000001001000000000110110000000000000000001001000000000000010000000000000000000000000000000000010010000000000000011100000000000000000000000000000000100100000000000000110000000000000000000000000000000001001000000000000001010000000000000000000000000000000001001000000000000100000000000011010010000000000000000010010000000000000111000000000111010100000000000000000100100000000000001100000000001100101000000000000000001001000000000000010100000000010101100000000000000000010010000000000000100000000000000000000000000000000000100100000000000000110000000000000000000000000000000001001000000000000001000000000000000000000000000000000010010000000000000001000000000000000000000000000000000100100000000000000000000000000000000000000000000000001111000000011011010000000000000000000000000000000000";
  30. begin
  31. D_OUT <= MEMORY (((to_integer(unsigned(Addr)) + 1) * Nb_bits) - 1 downto Nb_bits * to_integer(unsigned(Addr)));
  32. end Behavioral;