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 8.8KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. -- Do not touch until (-- Skadoosh)
  30. -- Do not add any Skadoosh
  31. signal MEMORY : STD_LOGIC_VECTOR ((Mem_Size * Nb_bits)-1 downto 0) := "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101010000000000000000000000001000100000000000000000000000001010000000000000101100000000100110011001100001011000000000101100001100000000000000000001001000000000000101000000000011100000101100000000000000000100100000000000000000000000010011000000010000101100000000010110000110000000001000000000101100001011000000000000000001011000010100000001000000000011110110000000000000000000000100000000010000000000000000000001000000000000000000000001010010000000100000001000000000100000000000000000100000000001010000000100000101000000000011010000000000000001000000000101000000001000011000000000001010000000000000101100000000100110010101100001100000000000101100001101000000110000000001011000011000000001000000000010110000101100000100000000000101100001010000000000000000000001000001000000010000000010010100000010000001011000000000001000000010000000110000001001001000000110000000100000000010000000001000000000000000000111000001011000000110000000001001000000110000000000000000100000111101100000000000000000001100000011000000110000000101001000000110000000000000000001010000000100000001000000100100100000010000010100000000001000000000010000000000000000010010000000000000000000000001010000000000000000000000000001011000001110000011100000000010110000011000000110000000000101100000101000001000000000001011000001000000001000000000010110000001100000001000000000101100000010000000000000000001011000000000000010100000000010000000010100000010000000000100000000010000000010000000001111001101010000000000000000010000000000000000010000000000000100000010000000100000010001001000001000000000100000000010000000001000000000000000000111101010000000000000000000001000000000010000010000000000011000000010000000100000000000000100000100000001100000010000010000001000000011100000100010010000011100000001000000000100000000110000001010000000001000000001000000000000000000100000101000000000000000000000001100000111000001110000001001001000001110000000000000000001100000001000000010000001000100000000100000000010000000001100000000100000001000000000000010000001000000100000000100001000000010000001100000001001001000001100000000100000000010000000010000000101000000000101000000101000000000000000001000000000100000000000000000100000101010100000000000000000001100000101000001010000001001001000001010000000000000000001010000001000000010000001000100000000100000000110000000001010000000110000000100000000010000000001000000000000000000100100000001000000000000000001001000000000000000000000000101000000000000000000000000000101100000001000000010000000001011000000000000000000000000010000000000000000001000000000100000000001000000000000000010010000000000000000000000000101010000101000000000000000001001100010110000000000000000010100000000000000000000000000010110000001000000010000000000101100000001000000010000000001011000000000000000000000000011110001011100000000000000000100000000000000000010000000000001000000010000000100000010010010000001000000001000000000100000000001000000000000000010001000000010000000000000000010010000000101010101000000001010100000010000000000000000010001000000010000000000000000010010000000110101010000000001000000100111000000000000000000011000000110000001100000001010010000001100000000000000000010100000001000000010000001001001000000100000010100000000010000000000100000000000000000100100000000000000000000000010100000000000000000000000000010110000001000000010000000000101100000001000000010000000001011000000000000000000000000011110000001000000000000000000100000000000000000010000000000001000000010000000100000010010010000001000000001000000000100000000001000000000000000010001000000010000000000000000010010000000100000000000000001010100000010000000000000000010001000000010000000000000000010010000000111111111000000001000000010010000000000000000000011000000110000001100000001010010000001100000000000000000010100000001000000010000001001001000000100000010100000000010000000000100000000000000000100100000000000000000000000001111010111110000000000000000";
  32. -- Skadoosh
  33. begin
  34. D_OUT <= MEMORY (((to_integer(unsigned(Addr)) + 1) * Nb_bits) - 1 downto Nb_bits * to_integer(unsigned(Addr)));
  35. end Behavioral;