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

Subversion Repositories epc_rfid_transponder

[/] [epc_rfid_transponder/] [trunk/] [tb_counterclr.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 erwing
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   16:47:20 05/18/2009
6
-- Design Name:   
7
-- Module Name:   /home/erwing/Projects/vhdl/rfid/tb_counterclr.vhd
8
-- Project Name:  rfid
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: COUNTERCLR
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_counterclr IS
34
END tb_counterclr;
35
 
36
ARCHITECTURE behavior OF tb_counterclr IS
37
 
38
    -- Component Declaration for the Unit Under Test (UUT)
39
 
40
    COMPONENT COUNTERCLR
41
    PORT(
42
         clk : IN  std_logic;
43
         rst_n : IN  std_logic;
44
         en : IN  std_logic;
45
         clear : IN  std_logic;
46
         outcnt : OUT  std_logic_vector(7 downto 0)
47
        );
48
    END COMPONENT;
49
 
50
 
51
   --Inputs
52
   signal clk : std_logic := '0';
53
   signal rst_n : std_logic := '0';
54
   signal en : std_logic := '0';
55
   signal clear : std_logic := '0';
56
 
57
        --Outputs
58
   signal outcnt : std_logic_vector(7 downto 0);
59
 
60
   -- Clock period definitions
61
   constant clk_period : time := 10us;
62
 
63
BEGIN
64
 
65
        -- Instantiate the Unit Under Test (UUT)
66
   uut: COUNTERCLR PORT MAP (
67
          clk => clk,
68
          rst_n => rst_n,
69
          en => en,
70
          clear => clear,
71
          outcnt => outcnt
72
        );
73
 
74
   -- Clock process definitions
75
   clk_process :process
76
   begin
77
                clk <= '0';
78
                wait for clk_period/2;
79
                clk <= '1';
80
                wait for clk_period/2;
81
   end process;
82
 
83
 
84
   -- Stimulus process
85
   stim_proc: process
86
   begin
87
      -- hold reset state for 100ms.
88
      wait for 100ms;
89
 
90
      wait for clk_period*10;
91
 
92
                rst_n <= '1';
93
                en <= '1';
94
                clear <= '0';
95
                wait for 3ms;
96
 
97
                clear <= '1';
98
                wait for 30us;
99
                clear <= '0';
100
 
101
                wait for 5ms;
102
 
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.