| 1 | --------------------------------------------------------------------------------
|
|---|
| 2 | -- Company:
|
|---|
| 3 | -- Engineer: Patrick Vogler
|
|---|
| 4 | --
|
|---|
| 5 | -- Create Date: 16:19:23 02/21/2011
|
|---|
| 6 | -- Design Name:
|
|---|
| 7 | -- Module Name:
|
|---|
| 8 | -- Project Name: Clock_cond_interface
|
|---|
| 9 | -- Target Device:
|
|---|
| 10 | -- Tool versions:
|
|---|
| 11 | -- Description:
|
|---|
| 12 | --
|
|---|
| 13 | -- VHDL Test Bench Created by ISE for module: Clock_cond_interface
|
|---|
| 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.std_logic_unsigned.all;
|
|---|
| 31 | USE ieee.numeric_std.ALL;
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 | library ftm_definitions;
|
|---|
| 35 | use ftm_definitions.ftm_array_types.all;
|
|---|
| 36 | use ftm_definitions.ftm_constants.all;
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 | ENTITY Clock_cond_interface_tb IS
|
|---|
| 40 | END Clock_cond_interface_tb;
|
|---|
| 41 |
|
|---|
| 42 | ARCHITECTURE behavior OF Clock_cond_interface_tb IS
|
|---|
| 43 |
|
|---|
| 44 | -- Component Declaration for the Unit Under Test (UUT)
|
|---|
| 45 |
|
|---|
| 46 | COMPONENT Clock_cond_interface
|
|---|
| 47 | PORT(
|
|---|
| 48 | clk : IN std_logic;
|
|---|
| 49 | CLK_Clk_Cond : OUT std_logic;
|
|---|
| 50 | LE_Clk_Cond : OUT std_logic;
|
|---|
| 51 | DATA_Clk_Cond : OUT std_logic;
|
|---|
| 52 | SYNC_Clk_Cond : OUT std_logic;
|
|---|
| 53 | LD_Clk_Cond : IN std_logic;
|
|---|
| 54 | TIM_Sel : OUT std_logic;
|
|---|
| 55 | cc_R0 : IN std_logic_vector(31 downto 0);
|
|---|
| 56 | cc_R1 : IN std_logic_vector(31 downto 0);
|
|---|
| 57 | cc_R8 : IN std_logic_vector(31 downto 0);
|
|---|
| 58 | cc_R9 : IN std_logic_vector(31 downto 0);
|
|---|
| 59 | cc_R11 : IN std_logic_vector(31 downto 0);
|
|---|
| 60 | cc_R13 : IN std_logic_vector(31 downto 0);
|
|---|
| 61 | cc_R14 : IN std_logic_vector(31 downto 0);
|
|---|
| 62 | cc_R15 : IN std_logic_vector(31 downto 0);
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 | start_config : IN std_logic;
|
|---|
| 66 | config_started : OUT std_logic;
|
|---|
| 67 | config_done : OUT std_logic;
|
|---|
| 68 | timemarker_select : IN std_logic
|
|---|
| 69 | );
|
|---|
| 70 | END COMPONENT;
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 | --Inputs
|
|---|
| 74 | signal clk : std_logic := '0';
|
|---|
| 75 | signal LD_Clk_Cond : std_logic := '0';
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 | signal cc_R0 : std_logic_vector(31 downto 0) := x"00010100";
|
|---|
| 79 | signal cc_R1 : std_logic_vector(31 downto 0) := x"00010101";
|
|---|
| 80 | signal cc_R8 : std_logic_vector(31 downto 0) := x"10000908";
|
|---|
| 81 | signal cc_R9 : std_logic_vector(31 downto 0) := x"A0032A09";
|
|---|
| 82 | signal cc_R11 : std_logic_vector(31 downto 0) := x"0082000B";
|
|---|
| 83 | signal cc_R13 : std_logic_vector(31 downto 0) := x"020A000D";
|
|---|
| 84 | signal cc_R14 : std_logic_vector(31 downto 0) := x"0830280E";
|
|---|
| 85 | signal cc_R15 : std_logic_vector(31 downto 0) := x"2000960F";
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 | signal start_config : std_logic := '0';
|
|---|
| 89 | signal timemarker_select : std_logic := '0';
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| 95 | --Outputs
|
|---|
| 96 | signal CLK_Clk_Cond : std_logic;
|
|---|
| 97 | signal LE_Clk_Cond : std_logic;
|
|---|
| 98 | signal DATA_Clk_Cond : std_logic;
|
|---|
| 99 | signal SYNC_Clk_Cond : std_logic;
|
|---|
| 100 | signal TIM_Sel : std_logic;
|
|---|
| 101 | signal config_started : std_logic;
|
|---|
| 102 | signal config_done : std_logic;
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 | -- Clock period definitions
|
|---|
| 107 | constant clk_period : time := 20 ns; -- 50 MHz Clock
|
|---|
| 108 | -- constant CLK_Clk_Cond_period : time := 10 ns;
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 | BEGIN
|
|---|
| 113 |
|
|---|
| 114 | -- Instantiate the Unit Under Test (UUT)
|
|---|
| 115 | uut: Clock_cond_interface PORT MAP (
|
|---|
| 116 | clk => clk,
|
|---|
| 117 | CLK_Clk_Cond => CLK_Clk_Cond,
|
|---|
| 118 | LE_Clk_Cond => LE_Clk_Cond,
|
|---|
| 119 | DATA_Clk_Cond => DATA_Clk_Cond,
|
|---|
| 120 | SYNC_Clk_Cond => SYNC_Clk_Cond,
|
|---|
| 121 | LD_Clk_Cond => LD_Clk_Cond,
|
|---|
| 122 | TIM_Sel => TIM_Sel,
|
|---|
| 123 | cc_R0 => cc_R0,
|
|---|
| 124 | cc_R1 => cc_R1,
|
|---|
| 125 | cc_R8 => cc_R8,
|
|---|
| 126 | cc_R9 => cc_R9,
|
|---|
| 127 | cc_R11 => cc_R11,
|
|---|
| 128 | cc_R13 => cc_R13,
|
|---|
| 129 | cc_R14 => cc_R14,
|
|---|
| 130 | cc_R15 => cc_R15,
|
|---|
| 131 | start_config => start_config,
|
|---|
| 132 | config_started => config_started,
|
|---|
| 133 | config_done => config_done,
|
|---|
| 134 | timemarker_select => timemarker_select
|
|---|
| 135 | );
|
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 | -- Clock process definitions
|
|---|
| 141 | clk_process :process
|
|---|
| 142 | begin
|
|---|
| 143 | clk <= '0';
|
|---|
| 144 | wait for clk_period/2;
|
|---|
| 145 | clk <= '1';
|
|---|
| 146 | wait for clk_period/2;
|
|---|
| 147 | end process;
|
|---|
| 148 |
|
|---|
| 149 | -- CLK_Clk_Cond_process :process
|
|---|
| 150 | -- begin
|
|---|
| 151 | -- CLK_Clk_Cond <= '0';
|
|---|
| 152 | -- wait for CLK_Clk_Cond_period/2;
|
|---|
| 153 | -- CLK_Clk_Cond <= '1';
|
|---|
| 154 | -- wait for CLK_Clk_Cond_period/2;
|
|---|
| 155 | -- end process;
|
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 | -- Stimulus process
|
|---|
| 161 | stim_proc: process
|
|---|
| 162 | begin
|
|---|
| 163 | -- hold reset state for 100 ms.
|
|---|
| 164 | -- wait for 100 ms;
|
|---|
| 165 |
|
|---|
| 166 | TIM_Sel <= '0';
|
|---|
| 167 |
|
|---|
| 168 | wait for clk_period*20;
|
|---|
| 169 |
|
|---|
| 170 | -- insert stimulus here
|
|---|
| 171 |
|
|---|
| 172 | start_config <= '1';
|
|---|
| 173 | wait for clk_period*100;
|
|---|
| 174 | start_config <= '0';
|
|---|
| 175 |
|
|---|
| 176 | wait for 180 us;
|
|---|
| 177 | LD_Clk_Cond <= '1';
|
|---|
| 178 |
|
|---|
| 179 | wait;
|
|---|
| 180 | end process;
|
|---|
| 181 |
|
|---|
| 182 | END;
|
|---|