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

Subversion Repositories noekeoncore

[/] [noekeoncore/] [trunk/] [tb/] [tb_rc_gen.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 entactogen
 
2
-- Copyright (c) 2013 Antonio de la Piedra
3
 
4
-- This program is free software: you can redistribute it and/or modify
5
-- it under the terms of the GNU General Public License as published by
6
-- the Free Software Foundation, either version 3 of the License, or
7
-- (at your option) any later version.
8
 
9
-- This program is distributed in the hope that it will be useful,
10
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
-- GNU General Public License for more details.
13
 
14
-- You should have received a copy of the GNU General Public License
15
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 
17
LIBRARY ieee;
18
USE ieee.std_logic_1164.ALL;
19
 
20
ENTITY tb_rc_gen IS
21
END tb_rc_gen;
22
 
23
ARCHITECTURE behavior OF tb_rc_gen IS
24
 
25
    -- Component Declaration for the Unit Under Test (UUT)
26
 
27
    COMPONENT rc_gen
28
    PORT(
29
         clk : IN  std_logic;
30
         rst : IN  std_logic;
31
         enc : IN  std_logic;
32
         rc_out : OUT  std_logic_vector(7 downto 0)
33
        );
34
    END COMPONENT;
35
 
36
 
37
   --Inputs
38
   signal clk : std_logic := '0';
39
   signal rst : std_logic := '0';
40
   signal enc : std_logic := '0';
41
 
42
        --Outputs
43
   signal rc_out : std_logic_vector(7 downto 0);
44
 
45
   -- Clock period definitions
46
   constant clk_period : time := 10 ns;
47
 
48
BEGIN
49
 
50
        -- Instantiate the Unit Under Test (UUT)
51
   uut: rc_gen PORT MAP (
52
          clk => clk,
53
          rst => rst,
54
          enc => enc,
55
          rc_out => rc_out
56
        );
57
 
58
   -- Clock process definitions
59
   clk_process :process
60
   begin
61
                clk <= '0';
62
                wait for clk_period/2;
63
                clk <= '1';
64
                wait for clk_period/2;
65
   end process;
66
 
67
 
68
   -- Stimulus process
69
   stim_proc: process
70
   begin
71
      wait for clk_period/2 + clk_period;
72
                rst <= '1';
73
                enc <= '0';
74
                wait for clk_period;
75
                rst <= '0';
76
 
77
                wait for clk_period*15;
78
                rst <= '1';
79
                enc <= '1';
80
                wait for clk_period;
81
                rst <= '0';
82
 
83
      -- insert stimulus here 
84
 
85
      wait;
86
   end process;
87
 
88
END;

powered by: WebSVN 2.1.0

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