Processeur/Processeur.srcs/sim_1/new/TestScreenDriver.vhd

87 lines
2.4 KiB
VHDL

----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 09.07.2021 11:39:21
-- Design Name:
-- Module Name: TestScreenDriver - 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 TestScreenDriver is
-- Port ( );
end TestScreenDriver;
architecture Behavioral of TestScreenDriver is
component ScreenDriver
Generic ( Nb_bits : Natural
);
Port ( CLK : in STD_LOGIC;
Value : in STD_LOGIC_VECTOR (Nb_Bits - 1 downto 0);
ValueAv : in STD_LOGIC;
IsInt : in STD_LOGIC;
OutData : out STD_LOGIC_VECTOR (0 to 6);
OutDataAv : out STD_LOGIC);
end component;
signal CLK : STD_LOGIC := '0';
signal Value : STD_LOGIC_VECTOR (15 downto 0) := (others => '0');
signal ValueAv : STD_LOGIC := '0';
signal IsInt : STD_LOGIC := '0';
signal OutData : STD_LOGIC_VECTOR (0 to 6) := (others => '0');
signal OutDataAv : STD_LOGIC := '0';
constant CLK_period : time := 10 ns;
begin
instance : ScreenDriver
Generic map ( Nb_bits => 16)
Port map ( CLK => CLK ,
Value => Value ,
ValueAv => ValueAv ,
IsInt => IsInt ,
OutData => OutData ,
OutDataAv => OutDataAv );
CLK_process : process
begin
CLK <= '1';
wait for CLK_period/2;
CLK <= '0';
wait for CLK_period/2;
end process;
process
begin
Value <= "0000000001010101" after 10 ns, "11111111111111111" after 80 ns;
ValueAv <= '1' after 10 ns, '0' after 30 ns, '1' after 80 ns, '0' after 90 ns;
IsInt <= '0' after 10 ns, '1' after 20 ns, '0' after 30 ns, '1' after 80 ns, '0' after 90 ns;
wait;
end process;
end Behavioral;