bench.vhd


1
-------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   11:33:42 02/26/2010
6
-- Design Name:   
7
-- Module Name:   C:/Xilinx/Simulator/Simulator_Version01/Bench.vhd
8
-- Project Name:  Simulator_Version01
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: Flanken_Detektierung_AD_Wandler
14
-- 
15
-- Dependencies:
16
-- 
17
-- Revision:
18
-- Revision 0.01 - File Created
19
-- Additional Comments:
20
--
21
-- Notes: 
22
-- This testbench has been automatically generated using types std_logic and
23
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends
24
-- that these types always be used for the top-level I/O of a design in order
25
-- to guarantee that the testbench will bind correctly to the post-implementation 
26
-- simulation model.
27
--------------------------------------------------------------------------------
28
LIBRARY ieee;
29
USE ieee.std_logic_1164.ALL;
30
USE ieee.numeric_std.ALL;
31
 
32
ENTITY Bench IS
33
END Bench;
34
 
35
ARCHITECTURE behavior OF Bench IS 
36
 
37
    -- Component Declaration for the Unit Under Test (UUT)
38
 
39
    COMPONENT Flanken_Detektierung_AD_Wandler
40
    PORT(
41
         Eingang_Flanken_Detektierung_AD_Wandler      : IN  std_logic_vector(11 downto 0);
42
         Clk_20Mhz_Flanken_Detektierung               : IN  std_logic;
43
         Analoge_Maximale_Amplitude_AD_Wandler        : OUT std_logic_vector(11 downto 0);
44
         Analoge_Flanke_wurde_erkannt_vom_AD_Wandler  : OUT std_logic
45
        );
46
    END COMPONENT;
47
    
48
49
   --Inputs
50
   signal Eingang_Flanken_Detektierung_AD_Wandler     : std_logic_vector(11 downto 0) := (others => '0');
51
   signal Clk_20Mhz_Flanken_Detektierung              : std_logic := '0';
52
53
   --Outputs
54
   signal Analoge_Maximale_Amplitude_AD_Wandler       : std_logic_vector(11 downto 0);
55
   signal Analoge_Flanke_wurde_erkannt_vom_AD_Wandler : std_logic;
56
57
   -- Clock period definitions
58
   constant Clk_20Mhz_Flanken_Detektierung_period     : time := 50000 ps;
59
 
60
BEGIN
61
 
62
  -- Instantiate the Unit Under Test (UUT)
63
   uut: Flanken_Detektierung_AD_Wandler PORT MAP (
64
          Eingang_Flanken_Detektierung_AD_Wandler     => Eingang_Flanken_Detektierung_AD_Wandler,
65
          Clk_20Mhz_Flanken_Detektierung              => Clk_20Mhz_Flanken_Detektierung,
66
          Analoge_Maximale_Amplitude_AD_Wandler       => Analoge_Maximale_Amplitude_AD_Wandler,
67
          Analoge_Flanke_wurde_erkannt_vom_AD_Wandler => Analoge_Flanke_wurde_erkannt_vom_AD_Wandler
68
        );
69
70
   -- Clock process definitions
71
   Clk_20Mhz_Flanken_Detektierung <= not Clk_20Mhz_Flanken_Detektierung after Clk_20Mhz_Flanken_Detektierung_period/2;
72
 
73
74
   -- Stimulus process
75
   stim_proc: process
76
   begin    
77
      -- hold reset state for 10 clock cycles
78
      wait for Clk_20Mhz_Flanken_Detektierung_period*10;  
79
80
      -- insert stimulus here 
81
      for count in 1 to 10 loop
82
        -- generate triangle wave
83
        for i in 0 to 2**12-1 loop
84
          Eingang_Flanken_Detektierung_AD_Wandler <= std_logic_vector(to_unsigned(i, Eingang_Flanken_Detektierung_AD_Wandler'length));
85
          wait until rising_edge(Clk_20Mhz_Flanken_Detektierung);
86
        end loop;
87
        for i in 2**12-1 downto 0 loop
88
          Eingang_Flanken_Detektierung_AD_Wandler <= std_logic_vector(to_unsigned(i, Eingang_Flanken_Detektierung_AD_Wandler'length));
89
          wait until rising_edge(Clk_20Mhz_Flanken_Detektierung);
90
        end loop;
91
      end loop;
92
93
      wait;
94
   end process;
95
96
END;