source: firmware/FTM/Lightpulser_interface/Basic_Version/FM_Pulse_generator_Basic_tb.vhd

Last change on this file was 10855, checked in by vogler, 14 years ago
Lightpulser Basic version with 50MHz clock only added
File size: 2.4 KB
Line 
1--------------------------------------------------------------------------------
2-- Company: IPP
3-- Engineer: Patrick Vogler
4--
5-- Create Date: 10:06:23 05/27/2011
6-- Design Name:
7-- Module Name: /home/pavogler/ISDC_repos/firmware/FTM/Lightpulser_interface/Basic_Version//FM_Pulse_generator_Basic_tb.vhd
8-- Project Name: Lightpulser_Basic
9-- Target Device:
10-- Tool versions:
11-- Description:
12--
13-- VHDL Test Bench Created by ISE for module: FM_pulse_generator_Basic
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_Basic_tb IS
34END FM_Pulse_generator_Basic_tb;
35
36ARCHITECTURE behavior OF FM_Pulse_generator_Basic_tb IS
37
38 -- Component Declaration for the Unit Under Test (UUT)
39
40 COMPONENT FM_pulse_generator_Basic
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 := 20 ns; -- 50MHz Clock
58
59BEGIN
60
61 -- Instantiate the Unit Under Test (UUT)
62 uut: FM_pulse_generator_Basic 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
84 wait for clk_period*10;
85
86 -- insert stimulus here
87
88 pulse_freq <= "000000";
89 wait for clk_period*15000;
90 pulse_freq <= "001000";
91 wait for clk_period*15000;
92 pulse_freq <= "111111";
93
94 wait;
95 end process;
96
97END;
Note: See TracBrowser for help on using the repository browser.