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_bin_to_bcd.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:   15:45:41 01/21/2015
6
-- Design Name:   
7
-- Module Name:   /home/craig/Documents/CW/Git_Repos/vault/TB_bin_to_bcd.vhd
8
-- Project Name:  vault
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: bin_to_bcd
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_bin_to_bcd IS
36
END TB_bin_to_bcd;
37
 
38
ARCHITECTURE behavior OF TB_bin_to_bcd IS
39
 
40
    -- Component Declaration for the Unit Under Test (UUT)
41
 
42
    COMPONENT bin_to_bcd
43
    PORT(
44
         CLK_IN : IN  std_logic;
45
         CONV_IN : IN  std_logic;
46
         BIN_IN : IN  std_logic_vector(7 downto 0);
47
         BCD_OUT : OUT  std_logic_vector(11 downto 0);
48
         CONV_DONE_OUT : OUT  std_logic
49
        );
50
    END COMPONENT;
51
 
52
 
53
   --Inputs
54
   signal CLK_IN : std_logic := '0';
55
   signal CONV_IN : std_logic := '0';
56
   signal BIN_IN : std_logic_vector(7 downto 0) := (others => '0');
57
 
58
        --Outputs
59
   signal BCD_OUT : std_logic_vector(11 downto 0);
60
   signal CONV_DONE_OUT : std_logic;
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: bin_to_bcd PORT MAP (
69
          CLK_IN                        => CLK_IN,
70
          CONV_IN               => CONV_IN,
71
          BIN_IN                        => BIN_IN,
72
          BCD_OUT                       => BCD_OUT,
73
          CONV_DONE_OUT => CONV_DONE_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
 
90
      wait for 100 ns;
91
 
92
                CONV_IN <= '1';
93
                BIN_IN <= X"C0";
94
                wait for CLK_IN_period;
95
      CONV_IN <= '0';
96
                wait for CLK_IN_period;
97
 
98
                wait for 200 ns;
99
 
100
                CONV_IN <= '1';
101
                BIN_IN <= X"D0";
102
                wait for CLK_IN_period;
103
      CONV_IN <= '0';
104
                wait for CLK_IN_period;
105
 
106
                wait for 200 ns;
107
 
108
                CONV_IN <= '1';
109
                BIN_IN <= X"FF";
110
                wait for CLK_IN_period;
111
      CONV_IN <= '0';
112
                wait for CLK_IN_period;
113
 
114
      wait;
115
   end process;
116
 
117
END;

powered by: WebSVN 2.1.0

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