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_hex_to_ascii.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:   10:06:08 01/21/2015
6
-- Design Name:   
7
-- Module Name:   /home/craig/Documents/CW/Git_Repos/vault/TB_hex_to_ascii.vhd
8
-- Project Name:  vault
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: hex_to_ascii
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_hex_to_ascii IS
36
END TB_hex_to_ascii;
37
 
38
ARCHITECTURE behavior OF TB_hex_to_ascii IS
39
 
40
    -- Component Declaration for the Unit Under Test (UUT)
41
 
42
    COMPONENT hex_to_ascii
43
    PORT(
44
         CLK_IN : IN  std_logic;
45
         CONV_IN : IN  std_logic;
46
         HEX_IN : IN  std_logic_vector(3 downto 0);
47
         ASCII_OUT : OUT  std_logic_vector(7 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 HEX_IN : std_logic_vector(3 downto 0) := (others => '0');
57
 
58
        --Outputs
59
   signal ASCII_OUT : std_logic_vector(7 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: hex_to_ascii PORT MAP (
69
          CLK_IN => CLK_IN,
70
          CONV_IN => CONV_IN,
71
          HEX_IN => HEX_IN,
72
          ASCII_OUT => ASCII_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
      -- hold reset state for 100 ns.
90
      wait for 100 ns;
91
 
92
      wait for CLK_IN_period*10;
93
 
94
                HEX_IN <= X"3";
95
                CONV_IN <= '1';
96
                wait for CLK_IN_period;
97
                CONV_IN <= '0';
98
                wait for CLK_IN_period;
99
 
100
      wait for CLK_IN_period*10;
101
 
102
                HEX_IN <= X"B";
103
                CONV_IN <= '1';
104
                wait for CLK_IN_period;
105
                CONV_IN <= '0';
106
                wait for CLK_IN_period;
107
 
108
      wait;
109
   end process;
110
 
111
END;

powered by: WebSVN 2.1.0

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