Hier ist die Testbech, wobei sich das entscheidende im Stimulus process
abspielt,
ENTITY Top_tb IS
END Top_tb;
ARCHITECTURE behavior OF Top_tb IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT TOP
PORT(
clk : IN std_logic;
rst : IN std_logic;
enable_w : IN std_logic;
enable_r : IN std_logic;
d_out : OUT std_logic_vector(17 downto 0)
);
END COMPONENT;
--Inputs
signal clk : std_logic := '0';
signal rst : std_logic := '0';
signal enable_w : std_logic := '0';
signal enable_r : std_logic := '0';
--Outputs
signal d_out : std_logic_vector(17 downto 0);
-- Clock period definitions
constant clk_period : time := 10 ns;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: TOP PORT MAP (
clk => clk,
rst => rst,
enable_w => enable_w,
enable_r => enable_r,
d_out => d_out
);
-- Clock process definitions
clk_process :process
begin
clk <= '0';
wait for clk_period/2;
clk <= '1';
wait for clk_period/2;
end process;
-- Stimulus process
stim_proc: process
begin
-- hold reset state for 100 ns.
wait for 10 ns;
rst <= '1';
wait for 100 ns;
rst <= '0';
wait for 50 ns;
enable_w <= '1';
wait for 50 ns;
enable_r <= '1';
wait for 50 ns;
enable_w <= '0';
wait for 50 ns;
enable_r <= '0';
wait for clk_period*10;
-- insert stimulus here
wait;
end process;
END;