40 lines
8.8 KiB
VHDL
40 lines
8.8 KiB
VHDL
----------------------------------------------------------------------------------
|
|
-- Company: INSA-Toulouse
|
|
-- Engineer: Paul Faure
|
|
--
|
|
-- Create Date: 16.04.2021 14:35:04
|
|
-- Module Name: MemoireInstructions - Behavioral
|
|
-- Project Name: Processeur sécurisé
|
|
-- Target Devices: Basys 3 ARTIX7
|
|
-- Tool Versions: Vivado 2016.4
|
|
--
|
|
-- Description: Memoire d'instruction
|
|
-- - Accessible en lecture uniquement
|
|
--
|
|
-- Dependencies: None
|
|
--
|
|
-- Comments : Memoire circulaire, si l'adresse est utilisée modulo la taille de la mémoire
|
|
----------------------------------------------------------------------------------
|
|
|
|
|
|
library IEEE;
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
|
use IEEE.NUMERIC_STD.ALL;
|
|
|
|
entity MemoireInstructions is
|
|
Generic (Nb_bits : Natural; -- Taille d'une instruction en mémoire (Taille d'un code instruction + 3*Taille d'un mot binaire)
|
|
Addr_size : Natural; -- Nombre de bits pour adresser la mémoire
|
|
Mem_size : Natural); -- Taille de la mémoire (nombre d'instructions stockées)
|
|
Port ( Addr : in STD_LOGIC_VECTOR (Addr_size-1 downto 0); -- Une adresse
|
|
D_OUT : out STD_LOGIC_VECTOR (Nb_bits-1 downto 0) := (others => '0')); -- L'instruction presente a cette adresse
|
|
end MemoireInstructions;
|
|
|
|
architecture Behavioral of MemoireInstructions is
|
|
-- Do not touch until (-- Skadoosh)
|
|
-- Do not add any Skadoosh
|
|
signal MEMORY : STD_LOGIC_VECTOR ((Mem_Size * Nb_bits)-1 downto 0) := "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100000000000000000000000010001000000010000000000000000010000000000100000000000000000101000000000000000000000000010011010000100000001000000000100110000000100000010000000000101100000001000000010000000001011000000000000000000000000010010000000100000000000000000100100000000000000000000000010100000000000000000000000000010110000001100000011000000000101100000010000000100000000001011000000010000000100000000010110000000000000000000000000111101000100000000000000000001000000000010000001000000000000010000001000000010000000110100100000011000000010000000001000000000100000000100000000010000000000000000010000000000001000000010000000100000001101001000000110000001000000000010000000001000000000000000001010100010100000000000000000010001000000100000000000000000010000000001000000000000000001000001010110000000000000000000011000001000000010000000010010010000010000000000000000000010100000010000000100000001101001000000110000100000000000010000000001000000001000000000100100000001000000000000000001001000000000000000100000000101000000000000000000000000000101100000000000000000000000001111001101010000000000000000101010000101000000000000000001000100000000000000000000000001001000000000000000000000000101010000101000000000000000001000100000000000000000000000001001000000001111111100000000100000100000000000000000000000001100000001000000010000000001001000000010000000000000000010010000000000000001000000001010000000000000000000000000001011000010010000100100000000010110000100000001000000000000101100000111000010100000000001011000001100000011000000000010110000010100000101000000000101100000100000001000000000001011000000110000001100000000010110000001000000010000000000101100000001000000010000000001011000000000000000000000000011110001010000000000000000000100000000110000010100000000000001000010100000101000001000010010000100000000001000000000100000001010000001100000000001101000010100000100000000000010000000100000000101000000000000100001010000010100000100001010000010100000011100000000000100000100000001001000010000100100001001000000010000000000011000010000000100000001001010000000100100000110000000000100100001000000001010000000001110000001110000100100000000010010000100100000000000000001000000101010000000000000000000011000010010000100100000111010010000100100000000000000000010100000111000001110000100001001000010000000100000000000010000000011100000110000000000100100000110000000010000000010010000001010000000000000000101011100100000000000000000001000100000101000000000000000001001000001010000000000000000101010001010000000000000000001000100000101000000000000000001001000001011111111100000000101010001010000000000000000001000100000101000000000000000001001000001010000000000000000101010001010000000000000000001000100000101000000000000000001001000001011111111100000000010010000010000000000000000000100100000011000000000000000001001000000100000000000000000010010000000100000000000000000100100000000000000000000000001111010110110000000000000000";
|
|
-- Skadoosh
|
|
begin
|
|
D_OUT <= MEMORY (((to_integer(unsigned(Addr)) + 1) * Nb_bits) - 1 downto Nb_bits * to_integer(unsigned(Addr)));
|
|
end Behavioral;
|
|
|