OpenCores
URL https://opencores.org/ocsvn/tcp_ip_core_w_dhcp/tcp_ip_core_w_dhcp/trunk

Subversion Repositories tcp_ip_core_w_dhcp

[/] [tcp_ip_core_w_dhcp/] [trunk/] [TB_led_mod.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 craighaywo
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   23:38:05 12/08/2014
6
-- Design Name:   
7
-- Module Name:   /home/craig/Documents/CW/Git_Repos/hw_client/TB_led_mod.vhd
8
-- Project Name:  hw_client
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: led_mod
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
 
31
-- Uncomment the following library declaration if using
32
-- arithmetic functions with Signed or Unsigned values
33
--USE ieee.numeric_std.ALL;
34
 
35
ENTITY TB_led_mod IS
36
END TB_led_mod;
37
 
38
ARCHITECTURE behavior OF TB_led_mod IS
39
 
40
    -- Component Declaration for the Unit Under Test (UUT)
41
 
42
    COMPONENT led_mod
43
    PORT(
44
         CLK_IN : IN  std_logic;
45
         LED_STATE_IN : IN  std_logic_vector(2 downto 0);
46
         ERROR_CODE_IN : IN  std_logic_vector(4 downto 0);
47
         ERROR_CODE_EN_IN : IN  std_logic;
48
         LEDS_OUT : OUT  std_logic_vector(1 downto 0)
49
        );
50
    END COMPONENT;
51
 
52
 
53
   --Inputs
54
   signal CLK_IN : std_logic := '0';
55
   signal LED_STATE_IN : std_logic_vector(2 downto 0) := (others => '0');
56
   signal ERROR_CODE_IN : std_logic_vector(4 downto 0) := (others => '0');
57
   signal ERROR_CODE_EN_IN : std_logic := '0';
58
 
59
        --Outputs
60
   signal LEDS_OUT : std_logic_vector(1 downto 0);
61
 
62
   -- Clock period definitions
63
   constant CLK_IN_period : time := 10 ns;
64
 
65
BEGIN
66
 
67
        -- Instantiate the Unit Under Test (UUT)
68
   uut: led_mod PORT MAP (
69
          CLK_IN => CLK_IN,
70
          LED_STATE_IN => LED_STATE_IN,
71
          ERROR_CODE_IN => ERROR_CODE_IN,
72
          ERROR_CODE_EN_IN => ERROR_CODE_EN_IN,
73
          LEDS_OUT => LEDS_OUT
74
        );
75
 
76
   -- Clock process definitions
77
   CLK_IN_process :process
78
   begin
79
                CLK_IN <= '0';
80
                wait for CLK_IN_period/2;
81
                CLK_IN <= '1';
82
                wait for CLK_IN_period/2;
83
   end process;
84
 
85
 
86
   -- Stimulus process
87
   stim_proc: process
88
   begin
89
      -- hold reset state for 100 ns.
90
      wait for 100 ns;
91
 
92
      wait for CLK_IN_period*10;
93
 
94
                ERROR_CODE_EN_IN <= '0';
95
                wait for CLK_IN_period;
96
                ERROR_CODE_IN <= "01101";
97
                ERROR_CODE_EN_IN <= '1';
98
                wait for CLK_IN_period;
99
                ERROR_CODE_EN_IN <= '0';
100
 
101
                wait for CLK_IN_period*10;
102
                LED_STATE_IN <= "111";
103
 
104
      wait;
105
   end process;
106
 
107
END;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.