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) := "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100000000000000000000000010001000000010000000000000000010000000000100000000000000000101000000000000000000000000010011010000100000001000000000100110000000100000010000000000101100000001000000010000000001011000000000000000000000000010010000000100000000000000000100100000000000000000000000010100000000000000000000000000010110000001100000011000000000101100000010000000100000000001011000000010000000100000000010110000000000000000000000000111101000100000000000000000001000000000010000001000000000000010000001000000010000000110100100000011000000010000000001000000000100000000100000000010000000000000000010000000000001000000010000000100000001101001000000110000001000000000010000000001000000000000000001010100010100000000000000000010001000000100000000000000000010000000001000000000000000001000001010110000000000000000000011000001000000010000000010010010000010000000000000000000010100000010000000100000001101001000000110000100000000000010000000001000000001000000000100100000001000000000000000001001000000000000000100000000101000000000000000000000000000101100000000000000000000000001111001101010000000000000000101010000101000000000000000001000100000000000000000000000001001000000000000000000000000101010000101000000000000000001000100000000000000000000000001001000000001111111100000000100000100000000000000000000000001100000001000000010000000001001000000010000000000000000010010000000000000001000000001010000000000000000000000000001011000010010000100100000000010110000100000001000000000000101100000111000010100000000001011000001100000011000000000010110000010100000101000000000101100000100000001000000000001011000000110000001100000000010110000001000000010000000000101100000001000000010000000001011000000000000000000000000011110001010000000000000000000100000000110000010100000000000001000010100000101000001000010010000100000000001000000000100000001010000001100000000001101000010100000100000000000010000000100000000101000000000000100001010000010100000100001010000010100000011100000000000100000100000001001000010000100100001001000000010000000000011000010000000100000001001010000000100100000110000000000100100001000000001010000000001110000001110000100100000000010010000100100000000000000001000000101010000000000000000000011000010010000100100000111010010000100100000000000000000010100000111000001110000100001001000010000000100000000000010000000011100000110000000000100100000110000000010000000010010000001010000000000000000101011100100000000000000000001000100000101000000000000000001001000001010000000000000000101010001010000000000000000001000100000101000000000000000001001000001011111111100000000101010001010000000000000000001000100000101000000000000000001001000001010000000000000000101010001010000000000000000001000100000101000000000000000001001000001011111111100000000010010000010000000000000000000100100000011000000000000000001001000000100000000000000000010010000000100000000000000000100100000000000000000000000001111010110110000000000000000";
  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;