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_checksum_calc.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:   13:21:24 12/30/2014
6
-- Design Name:   
7
-- Module Name:   /home/craig/Documents/CW/Git_Repos/hw_client/TB_checksum_calc.vhd
8
-- Project Name:  hw_client
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: checksum_calc
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_checksum_calc IS
36
END TB_checksum_calc;
37
 
38
ARCHITECTURE behavior OF TB_checksum_calc IS
39
 
40
    -- Component Declaration for the Unit Under Test (UUT)
41
 
42
    COMPONENT checksum_calc
43
    PORT(
44
         CLK_IN : IN  std_logic;
45
         RST_IN : IN  std_logic;
46
         CHECKSUM_CALC_IN : IN  std_logic;
47
         START_ADDR_IN : IN  std_logic_vector(10 downto 0);
48
         COUNT_IN : IN  std_logic_vector(10 downto 0);
49
         VALUE_IN : IN  std_logic_vector(7 downto 0);
50
         VALUE_ADDR_OUT : OUT  std_logic_vector(10 downto 0);
51
                        CHECKSUM_INIT_IN                : in  STD_LOGIC_VECTOR (15 downto 0);
52
                        CHECKSUM_SET_INIT_IN    : in  STD_LOGIC;
53
                        CHECKSUM_ODD_LENGTH_IN  : in  STD_LOGIC;
54
         CHECKSUM_OUT : OUT  std_logic_vector(15 downto 0);
55
         CHECKSUM_DONE_OUT : OUT  std_logic
56
        );
57
    END COMPONENT;
58
 
59
 
60
   --Inputs
61
   signal CLK_IN : std_logic := '0';
62
   signal RST_IN : std_logic := '0';
63
   signal CHECKSUM_CALC_IN : std_logic := '0';
64
   signal START_ADDR_IN : std_logic_vector(10 downto 0) := (others => '0');
65
   signal COUNT_IN : std_logic_vector(10 downto 0) := (others => '0');
66
   signal VALUE_IN : std_logic_vector(7 downto 0) := (others => '0');
67
 
68
        signal CHECKSUM_INIT_IN                 : STD_LOGIC_VECTOR (15 downto 0);
69
        signal CHECKSUM_SET_INIT_IN     : STD_LOGIC;
70
        signal CHECKSUM_ODD_LENGTH_IN   : STD_LOGIC;
71
 
72
        --Outputs
73
   signal VALUE_ADDR_OUT : std_logic_vector(10 downto 0);
74
   signal CHECKSUM_OUT : std_logic_vector(15 downto 0);
75
   signal CHECKSUM_DONE_OUT : std_logic;
76
 
77
   -- Clock period definitions
78
   constant CLK_IN_period : time := 10 ns;
79
 
80
BEGIN
81
 
82
        -- Instantiate the Unit Under Test (UUT)
83
   uut: checksum_calc PORT MAP (
84
          CLK_IN => CLK_IN,
85
          RST_IN => RST_IN,
86
          CHECKSUM_CALC_IN => CHECKSUM_CALC_IN,
87
          START_ADDR_IN => START_ADDR_IN,
88
          COUNT_IN => COUNT_IN,
89
          VALUE_IN => VALUE_IN,
90
          VALUE_ADDR_OUT => VALUE_ADDR_OUT,
91
                         CHECKSUM_INIT_IN               => CHECKSUM_INIT_IN,
92
                         CHECKSUM_SET_INIT_IN   => CHECKSUM_SET_INIT_IN,
93
                         CHECKSUM_ODD_LENGTH_IN => CHECKSUM_ODD_LENGTH_IN,
94
          CHECKSUM_OUT => CHECKSUM_OUT,
95
          CHECKSUM_DONE_OUT => CHECKSUM_DONE_OUT
96
        );
97
 
98
   -- Clock process definitions
99
   CLK_IN_process :process
100
   begin
101
                CLK_IN <= '0';
102
                wait for CLK_IN_period/2;
103
                CLK_IN <= '1';
104
                wait for CLK_IN_period/2;
105
   end process;
106
 
107
 
108
   -- Stimulus process
109
   stim_proc: process
110
   begin
111
      wait for CLK_IN_period*10;
112
 
113
                COUNT_IN <= "00000000100";
114
                VALUE_IN <= X"15";
115
                wait for CLK_IN_period;
116
 
117
                CHECKSUM_CALC_IN <= '0';
118
                wait for CLK_IN_period;
119
                CHECKSUM_CALC_IN <= '1';
120
                wait for CLK_IN_period;
121
                CHECKSUM_CALC_IN <= '0';
122
                wait for CLK_IN_period;
123
 
124
                wait for CLK_IN_period*50;
125
 
126
                COUNT_IN <= "00000001000";
127
                CHECKSUM_INIT_IN <= X"1234";
128
                CHECKSUM_SET_INIT_IN <= '0';
129
                wait for CLK_IN_period;
130
                CHECKSUM_SET_INIT_IN <= '1';
131
                wait for CLK_IN_period;
132
                CHECKSUM_SET_INIT_IN <= '0';
133
                wait for CLK_IN_period;
134
                CHECKSUM_CALC_IN <= '0';
135
                wait for CLK_IN_period;
136
                CHECKSUM_CALC_IN <= '1';
137
                CHECKSUM_ODD_LENGTH_IN <= '1';
138
                wait for CLK_IN_period;
139
                CHECKSUM_ODD_LENGTH_IN <= '0';
140
                CHECKSUM_CALC_IN <= '0';
141
                wait for CLK_IN_period;
142
 
143
      wait;
144
   end process;
145
 
146
END;

powered by: WebSVN 2.1.0

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