84 lines
2.5 KiB
VHDL
84 lines
2.5 KiB
VHDL
----------------------------------------------------------------------------------
|
|
-- Company:
|
|
-- Engineer:
|
|
--
|
|
-- Create Date: 19.04.2021 17:35:57
|
|
-- Design Name:
|
|
-- Module Name: Test_Pipeline - Behavioral
|
|
-- Project Name:
|
|
-- Target Devices:
|
|
-- Tool Versions:
|
|
-- Description:
|
|
--
|
|
-- Dependencies:
|
|
--
|
|
-- Revision:
|
|
-- Revision 0.01 - File Created
|
|
-- Additional Comments:
|
|
--
|
|
----------------------------------------------------------------------------------
|
|
|
|
|
|
library IEEE;
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
|
|
|
-- Uncomment the following library declaration if using
|
|
-- arithmetic functions with Signed or Unsigned values
|
|
--use IEEE.NUMERIC_STD.ALL;
|
|
|
|
-- Uncomment the following library declaration if instantiating
|
|
-- any Xilinx leaf cells in this code.
|
|
--library UNISIM;
|
|
--use UNISIM.VComponents.all;
|
|
|
|
entity Test_Pipeline is
|
|
-- Port ( );
|
|
end Test_Pipeline;
|
|
|
|
architecture Behavioral of Test_Pipeline is
|
|
|
|
component Pipeline is
|
|
Generic (Nb_bits : Natural := 8;
|
|
Instruction_En_Memoire_Size : Natural := 29;
|
|
Addr_Memoire_Instruction_Size : Natural := 3;
|
|
Memoire_Instruction_Size : Natural := 8;
|
|
Instruction_Bus_Size : Natural := 5;
|
|
Nb_Instructions : Natural := 32;
|
|
Nb_Registres : Natural := 16;
|
|
Memoire_Size : Natural := 32);
|
|
Port (CLK : STD_LOGIC;
|
|
RST : STD_LOGIC;
|
|
STD_IN : in STD_LOGIC_VECTOR (Nb_bits - 1 downto 0);
|
|
STD_OUT : out STD_LOGIC_VECTOR (Nb_bits - 1 downto 0));
|
|
end component;
|
|
|
|
signal my_CLK : STD_LOGIC := '0';
|
|
signal my_RST : STD_LOGIC := '1';
|
|
signal my_STD_IN : STD_LOGIC_VECTOR (8 - 1 downto 0) := (others => '0');
|
|
signal my_STD_OUT : STD_LOGIC_VECTOR (8 - 1 downto 0) := (others => '0');
|
|
|
|
constant CLK_period : time := 10 ns;
|
|
|
|
begin
|
|
instance : Pipeline
|
|
generic map (Addr_Memoire_Instruction_Size => 8,
|
|
Memoire_Instruction_Size => 256)
|
|
port map (CLK => my_CLK,
|
|
RST => my_RST,
|
|
STD_IN => my_STD_IN,
|
|
STD_OUT => my_STD_OUT);
|
|
|
|
CLK_process :process
|
|
begin
|
|
my_CLK <= '1';
|
|
wait for CLK_period/2;
|
|
my_CLK <= '0';
|
|
wait for CLK_period/2;
|
|
end process;
|
|
|
|
process
|
|
begin
|
|
my_STD_IN <= "00000001" after 300 us, "00000010" after 710 us, "00000011" after 1120 us, "00000100" after 1530 us, "00000101" after 1940 us, "00000110" after 2350 us, "00000111" after 2760 us, "00001000" after 3170 us, "00001001" after 3580 us, "00000000" after 3990 us;
|
|
wait;
|
|
end process;
|
|
end Behavioral;
|