--------------------------------------------------------------------------------
-- Company: 
-- Engineer:
--
-- Create Date:   14:06:49 12/08/2009
-- Design Name:   
-- Module Name:   C:/Users/mrbean/komunikace_UART2/test_DCM_example.vhd
-- Project Name:  komunikace_UART2
-- Target Device:  
-- Tool versions:  
-- Description:   
-- 
-- VHDL Test Bench Created by ISE for module: DCM_example
-- 
-- Dependencies:
-- 
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
-- Notes: 
-- This testbench has been automatically generated using types std_logic and
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends
-- that these types always be used for the top-level I/O of a design in order
-- to guarantee that the testbench will bind correctly to the post-implementation 
-- simulation model.
--------------------------------------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;
 
ENTITY test_DCM_example IS
END test_DCM_example;
 
ARCHITECTURE behavior OF test_DCM_example IS 
 
    -- Component Declaration for the Unit Under Test (UUT)
 
    COMPONENT DCM_example
    PORT(
         UART_OUT : OUT  std_logic;
         UART_IN : IN  std_logic;
         Q_OUT : OUT  std_logic_vector(7 downto 0);
         CLKIN : IN  std_logic
        );
    END COMPONENT;
    

   --Inputs
   signal UART_IN : std_logic := '0';
   signal CLKIN : std_logic := '0';

 	--Outputs
   signal UART_OUT : std_logic;
   signal Q_OUT : std_logic_vector(7 downto 0);

   -- Clock period definitions

BEGIN
 
	-- Instantiate the Unit Under Test (UUT)
   uut: DCM_example PORT MAP (
          UART_OUT => UART_OUT,
          UART_IN => UART_IN,
          Q_OUT => Q_OUT,
          CLKIN => CLKIN
        );

   -- Clock process definitions
   CLK_process :process
   begin
		CLKIN <= '0';
		wait for 10 ns;
		CLKIN <= '1';
		wait for 10 ns;
   end process;
 

   -- Stimulus process
   stim_proc: process
   begin

	UART_IN <= '1';
		wait for 1000 us;
	
		UART_IN <= '0';		--start
      wait for 25 us;		--T
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';		--stop
      wait for 25 us;
		
		UART_IN <= '0';		--start
      wait for 25 us;		--E
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';		--stop
      wait for 25 us;
		
		UART_IN <= '0';		--start
      wait for 25 us;		--S
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';		--stop
      wait for 25 us;
		
		UART_IN <= '0';		--start
      wait for 25 us;		--T
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';		--stop
      wait for 25 us;
	
		UART_IN <= '0';		--start
      wait for 25 us;		--LF
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';		--stop
      wait for 25 us;	
		
		UART_IN <= '0';		--start
      wait for 25 us;		--CR
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '1';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '0';
      wait for 25 us;	
		UART_IN <= '1';		--stop
      wait for 25 us;	


      -- insert stimulus here 

      wait;
   end process;

END;
