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

Subversion Repositories distributed_intelligence

[/] [distributed_intelligence/] [trunk/] [BENCH/] [tb_bus_register_x16.vhd] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 8 leoel
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   21:59:34 11/08/2009
6
-- Design Name:   
7
-- Module Name:   C:/Users/microcon/bench/tb_bus_register_x16.vhd
8
-- Project Name:  microcon
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: bus_register_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_bus_register_x16 IS
34
END tb_bus_register_x16;
35
 
36
ARCHITECTURE behavior OF tb_bus_register_x16 IS
37
 
38
    -- Component Declaration for the Unit Under Test (UUT)
39
 
40
    COMPONENT bus_register_x16
41
    PORT(
42
         clk : IN  std_logic;
43
         reset : IN  std_logic;
44
         re : IN  std_logic;
45
         we : IN  std_logic;
46
         dataIn : IN  std_logic_vector(15 downto 0);
47
         dataOut : 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 re : std_logic_vector(1 to 3) := "000";
56
   signal we : std_logic_vector(1 to 3) := "000";
57
   signal dataBus : std_logic_vector(15 downto 0) := (others => '0');
58
 
59
   -- Clock period definitions
60
   constant clk_period : time := 50 us;
61
   signal dataBusIn : std_logic_vector(15 downto 0) := (others => '0');
62
        signal wef: std_logic := '0';
63
BEGIN
64
 
65
        -- Instantiate the Unit Under Test (UUT)
66
        uut_force: bus_register_x16 port map (
67
          clk => clk,
68
          reset => reset,
69
          re => '1',
70
          we => wef,
71
          dataIn => dataBusIn,
72
          dataOut => dataBus
73
        );
74
 
75
   uut1: bus_register_x16 PORT MAP (
76
          clk => clk,
77
          reset => reset,
78
          re => re(1),
79
          we => we(1),
80
          dataIn => dataBus,
81
          dataOut => dataBus
82
        );
83
 
84
        uut2: bus_register_x16 PORT MAP (
85
          clk => clk,
86
          reset => reset,
87
          re => re(2),
88
          we => we(2),
89
          dataIn => dataBus,
90
          dataOut => dataBus
91
        );
92
 
93
        uut3: bus_register_x16 PORT MAP (
94
          clk => clk,
95
          reset => reset,
96
          re => re(3),
97
          we => we(3),
98
          dataIn => dataBus,
99
          dataOut => dataBus
100
        );
101
 
102
   -- Clock process definitions
103
   clk_process :process
104
   begin
105
                clk <= '0';
106
                wait for clk_period/2;
107
                clk <= '1';
108
                wait for clk_period/2;
109
   end process;
110
 
111
 
112
   -- Stimulus process
113
   stim_proc: process
114
   begin
115
                reset <= '1';
116
      -- hold reset state for 100us.
117
      wait for 100 us;
118
                reset <= '0';
119
 
120
                dataBusIn <= x"ffee";
121
                wef <= '1';
122
                re <= "000";
123
                we <= "000";
124
      wait for clk_period;
125
 
126
                re <= "010";
127
                we <= "000";
128
      wait for clk_period;
129
 
130
                dataBusIn <= x"1001";
131
                wef <= '0';
132
                re <= "000";
133
                we <= "000";
134
      wait for clk_period;
135
 
136
                re <= "001";
137
                we <= "010";
138
      wait for clk_period;
139
 
140
                re <= "100";
141
                we <= "001";
142
      wait for clk_period;
143
 
144
                dataBusIn <= x"1001";
145
                wef <= '1';
146
                re <= "100";
147
                we <= "000";
148
      wait for clk_period;
149
 
150
                re <= "010";
151
                we <= "100";
152
      wait for clk_period;
153
      wait;
154
   end process;
155
 
156
END;

powered by: WebSVN 2.1.0

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