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

Subversion Repositories distributed_intelligence

[/] [distributed_intelligence/] [trunk/] [BENCH/] [tb_binary_counter_x16.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 leoel
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: Léo Germond
4
--
5
-- Create Date:   17:02:27 11/08/2009
6
-- Design Name:   
7
-- Module Name:   C:/Users/microcon/tb_binary_counter_x16.vhd
8
-- Project Name:  microcon
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: binary_counter_x16
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
ENTITY tb_binary_counter_x16 IS
34
END tb_binary_counter_x16;
35
 
36
ARCHITECTURE behavior OF tb_binary_counter_x16 IS
37
 
38
    -- Component Declaration for the Unit Under Test (UUT)
39
 
40
    COMPONENT binary_counter_x16
41
    PORT(
42
         clk : IN  std_logic;
43
         reset : IN  std_logic;
44
         set : IN  std_logic;
45
         inc : IN  std_logic;
46
         set_value : IN  std_logic_vector(15 downto 0);
47
         count : OUT  std_logic_vector(15 downto 0)
48
        );
49
    END COMPONENT;
50
 
51
 
52
   --Inputs
53
   signal clk : std_logic := '0';
54
   signal reset : std_logic := '0';
55
   signal set : std_logic := '0';
56
   signal inc : std_logic := '0';
57
   signal set_value : std_logic_vector(15 downto 0) := (others => '0');
58
 
59
        --Outputs
60
   signal count : std_logic_vector(15 downto 0);
61
 
62
   -- Clock period definitions
63
   constant clk_period : time := 10 us;
64
 
65
BEGIN
66
 
67
        -- Instantiate the Unit Under Test (UUT)
68
   uut: binary_counter_x16 PORT MAP (
69
          clk => clk,
70
          reset => reset,
71
          set => set,
72
          inc => inc,
73
          set_value => set_value,
74
          count => count
75
        );
76
 
77
   -- Clock process definitions
78
   clk_process :process
79
   begin
80
                clk <= '0';
81
                wait for clk_period/2;
82
                clk <= '1';
83
                wait for clk_period/2;
84
   end process;
85
 
86
 
87
   -- Stimulus process
88
   stim_proc: process
89
   begin
90
                reset <= '0';
91
      -- hold reset state for 10us.
92
      wait for 10 us;
93
                reset <= '1';
94
                inc <= '1';
95
      wait for clk_period*10;
96
 
97
                inc <= '0';
98
      wait for clk_period*10;
99
 
100
                set_value <= std_logic_vector(to_unsigned(2**16 - 1, 16));
101
                set <= '1';
102
      wait for clk_period;
103
                set <= '0';
104
 
105
                inc <= '1';
106
      wait;
107
   end process;
108
 
109
END;

powered by: WebSVN 2.1.0

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