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_sf_mod.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:   16:08:24 12/11/2014
6
-- Design Name:   
7
-- Module Name:   /home/craig/Documents/CW/Git_Repos/hw_client/TB_sf_mod.vhd
8
-- Project Name:  hw_client
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: sf_mod
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_sf_mod IS
36
END TB_sf_mod;
37
 
38
ARCHITECTURE behavior OF TB_sf_mod IS
39
 
40
    -- Component Declaration for the Unit Under Test (UUT)
41
 
42
    COMPONENT sf_mod
43
    PORT(
44
         CLK_IN                                 : IN  std_logic;
45
         RESET_IN                       : IN  std_logic;
46
         INIT_IN                                : IN  std_logic;
47
         INIT_CMPLT_OUT         : OUT  std_logic;
48
         ERROR_OUT                      : OUT  std_logic;
49
         ADDR_IN                                : IN  std_logic_vector(23 downto 1);
50
         DATA_OUT                       : OUT  std_logic_vector(15 downto 0);
51
         RD_IN                          : IN  std_logic;
52
         RD_CMPLT_OUT           : OUT  std_logic;
53
         SF_DATA_IN                     : IN  std_logic_vector(15 downto 0);
54
         SF_ADDR_OUT            : OUT  std_logic_vector(23 downto 1);
55
         SF_CS_BAR_OUT          : OUT  std_logic;
56
         SF_OE_BAR_OUT          : OUT  std_logic;
57
         SF_RESET_BAR_OUT       : OUT  std_logic;
58
         SF_STATUS_IN           : IN  std_logic
59
        );
60
    END COMPONENT;
61
 
62
 
63
   --Inputs
64
   signal CLK_IN : std_logic := '0';
65
   signal RESET_IN : std_logic := '0';
66
   signal INIT_IN : std_logic := '0';
67
   signal ADDR_IN : std_logic_vector(23 downto 1) := (others => '0');
68
   signal RD_IN : std_logic := '0';
69
   signal SF_DATA_IN : std_logic_vector(15 downto 0) := (others => '0');
70
   signal SF_STATUS_IN : std_logic := '0';
71
 
72
        --Outputs
73
   signal INIT_CMPLT_OUT : std_logic;
74
   signal ERROR_OUT : std_logic;
75
   signal DATA_OUT : std_logic_vector(15 downto 0);
76
   signal RD_CMPLT_OUT : std_logic;
77
   signal SF_ADDR_OUT : std_logic_vector(23 downto 1);
78
   signal SF_CS_BAR_OUT : std_logic;
79
   signal SF_OE_BAR_OUT : std_logic;
80
   signal SF_RESET_BAR_OUT : std_logic;
81
 
82
   -- Clock period definitions
83
   constant CLK_IN_period : time := 40 ns;
84
 
85
BEGIN
86
 
87
        -- Instantiate the Unit Under Test (UUT)
88
   uut: sf_mod PORT MAP (
89
          CLK_IN => CLK_IN,
90
          RESET_IN => RESET_IN,
91
          INIT_IN => INIT_IN,
92
          INIT_CMPLT_OUT => INIT_CMPLT_OUT,
93
          ERROR_OUT => ERROR_OUT,
94
          ADDR_IN => ADDR_IN,
95
          DATA_OUT => DATA_OUT,
96
          RD_IN => RD_IN,
97
          RD_CMPLT_OUT => RD_CMPLT_OUT,
98
          SF_DATA_IN => SF_DATA_IN,
99
          SF_ADDR_OUT => SF_ADDR_OUT,
100
          SF_CS_BAR_OUT => SF_CS_BAR_OUT,
101
          SF_OE_BAR_OUT => SF_OE_BAR_OUT,
102
          SF_RESET_BAR_OUT => SF_RESET_BAR_OUT,
103
          SF_STATUS_IN => SF_STATUS_IN
104
        );
105
 
106
   -- Clock process definitions
107
   CLK_IN_process :process
108
   begin
109
                CLK_IN <= '0';
110
                wait for CLK_IN_period/2;
111
                CLK_IN <= '1';
112
                wait for CLK_IN_period/2;
113
   end process;
114
 
115
        DATA_PROC :process
116
        begin
117
                wait for CLK_IN_period;
118
                if SF_ADDR_OUT(23 downto 1) = "000"&X"00000" then
119
                        SF_DATA_IN <= X"7B25";
120
                elsif SF_ADDR_OUT(23 downto 1) = "000"&X"0003F" then
121
                        SF_DATA_IN <= X"ED4A";
122
                elsif SF_ADDR_OUT(23 downto 1) = "000"&X"00001" then
123
                        SF_DATA_IN <= X"1111";
124
                elsif SF_ADDR_OUT(23 downto 1) = "000"&X"00002" then
125
                        SF_DATA_IN <= X"2222";
126
                end if;
127
        end process;
128
 
129
   -- Stimulus process
130
   stim_proc: process
131
   begin
132
 
133
      wait for CLK_IN_period*10;
134
 
135
                INIT_IN <= '0';
136
                wait for CLK_IN_period;
137
      INIT_IN <= '1';
138
                wait for CLK_IN_period;
139
                INIT_IN <= '0';
140
                wait for CLK_IN_period;
141
 
142
                wait for CLK_IN_period*10;
143
 
144
                ADDR_IN <= "000"&X"00001";
145
                RD_IN <= '0';
146
                wait for CLK_IN_period;
147
      RD_IN <= '1';
148
                wait for CLK_IN_period;
149
                RD_IN <= '0';
150
                wait for CLK_IN_period;
151
 
152
                wait for CLK_IN_period*10;
153
 
154
                ADDR_IN <= "000"&X"00002";
155
                RD_IN <= '0';
156
                wait for CLK_IN_period;
157
      RD_IN <= '1';
158
                wait for CLK_IN_period;
159
                RD_IN <= '0';
160
                wait for CLK_IN_period;
161
 
162
      wait;
163
   end process;
164
 
165
END;

powered by: WebSVN 2.1.0

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