LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
use IEEE.std_logic_unsigned.all;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
USE ieee.numeric_std.ALL;
ENTITY fir3_testbench IS
END fir3_testbench;
ARCHITECTURE fir3_testbench_arch OF fir3_testbench IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT fir3
PORT(
x : IN std_logic_vector(3 downto 0);
clk : IN std_logic;
rst : IN std_logic;
y : OUT std_logic_vector(7 downto 0)
);
END COMPONENT;
--Inputs
signal x : std_logic_vector(3 downto 0) := (others => '0');
signal clk : std_logic := '0';
signal rst : std_logic := '0';
--Outputs
signal y : std_logic_vector(7 downto 0);
-- Clock period definitions
constant clk_period : time := 11 ns;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: fir3 PORT MAP (
x => x,
clk => clk,
rst => rst,
y => y
);
-- Clock process definitions
clk_process
rocess
begin
clk <= '0';
wait for clk_period/2;
clk <= '1';
wait for clk_period/2;
end process;
x <= "0000",
"0101" after 11 ns,
"1010" after 22 ns,
"1111" after 33 ns,
"0000" after 44 ns;
END fir3_testbench_arch;