source: firmware/FTM/Lightpulser_interface/FM_pulse_generator_tb.vhd@ 18342

Last change on this file since 18342 was 10761, checked in by vogler, 14 years ago
Lightpulser first version added
File size: 2.3 KB
Line 
1--------------------------------------------------------------------------------
2-- Company:
3-- Engineer:
4--
5-- Create Date: 15:21:36 05/16/2011
6-- Design Name:
7-- Module Name: /home/pavogler/ISDC_repos/firmware/FTM/Lightpulser_interface/V2//FM_pulse_generator_tb.vhd
8-- Project Name: FLD_2
9-- Target Device:
10-- Tool versions:
11-- Description:
12--
13-- VHDL Test Bench Created by ISE for module: FM_pulse_generator
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--------------------------------------------------------------------------------
28LIBRARY ieee;
29USE ieee.std_logic_1164.ALL;
30USE ieee.std_logic_unsigned.all;
31USE ieee.numeric_std.ALL;
32
33ENTITY FM_pulse_generator_tb IS
34END FM_pulse_generator_tb;
35
36ARCHITECTURE behavior OF FM_pulse_generator_tb IS
37
38 -- Component Declaration for the Unit Under Test (UUT)
39
40 COMPONENT FM_pulse_generator
41 PORT(
42 clk : IN std_logic;
43 pulse_freq : IN std_logic_vector(5 downto 0);
44 FM_out : OUT std_logic
45 );
46 END COMPONENT;
47
48
49 --Inputs
50 signal clk : std_logic := '0';
51 signal pulse_freq : std_logic_vector(5 downto 0) := (others => '0');
52
53 --Outputs
54 signal FM_out : std_logic;
55
56 -- Clock period definitions
57 constant clk_period : time := 4 ns;
58
59BEGIN
60
61 -- Instantiate the Unit Under Test (UUT)
62 uut: FM_pulse_generator PORT MAP (
63 clk => clk,
64 pulse_freq => pulse_freq,
65 FM_out => FM_out
66 );
67
68 -- Clock process definitions
69 clk_process :process
70 begin
71 clk <= '0';
72 wait for clk_period/2;
73 clk <= '1';
74 wait for clk_period/2;
75 end process;
76
77
78 -- Stimulus process
79 stim_proc: process
80 begin
81 -- hold reset state for 100 ms.
82 -- wait for 100 ms;
83 wait for clk_period*10;
84
85 -- insert stimulus here
86
87 pulse_freq <= "000000";
88 wait for clk_period*15000;
89 pulse_freq <= "001000";
90 wait for clk_period*15000;
91 pulse_freq <= "111111";
92
93 wait;
94 end process;
95
96END;
Note: See TracBrowser for help on using the repository browser.