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

Subversion Repositories aes_all_keylength

[/] [aes_all_keylength/] [trunk/] [aesKeyTB.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 feketebv
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   17:27:09 06/12/2013
6
-- Design Name:   
7
-- Module Name:   S:/project/aes/aes/aesKeyTB.vhd
8
-- Project Name:  aes
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: keyExpansion
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 aesKeyTB IS
36
END aesKeyTB;
37
 
38
ARCHITECTURE behavior OF aesKeyTB IS
39
 
40
    -- Component Declaration for the Unit Under Test (UUT)
41
 
42
    COMPONENT keyExpansion
43
    PORT(
44
         reset : IN  std_logic;
45
         clock : IN  std_logic;
46
         loadKey : IN  std_logic;
47
         key : IN  std_logic_vector(31 downto 0);
48
         subKeyEnable : OUT  std_logic;
49
         subKeyAddress : OUT  std_logic_vector(3 downto 0);
50
         subKey : OUT  std_logic_vector(127 downto 0);
51
         keyExpansionReady : INOUT  std_logic;
52
         numberOfRounds : OUT  std_logic_vector(3 downto 0)
53
        );
54
    END COMPONENT;
55
 
56
 
57
   --Inputs
58
   signal reset : std_logic := '0';
59
   signal clock : std_logic := '0';
60
   signal loadKey : std_logic := '0';
61
   signal key : std_logic_vector(31 downto 0) := (others => '0');
62
 
63
        --BiDirs
64
   signal keyExpansionReady : std_logic;
65
 
66
        --Outputs
67
   signal subKeyEnable : std_logic;
68
   signal subKeyAddress : std_logic_vector(3 downto 0);
69
   signal subKey : std_logic_vector(127 downto 0);
70
   signal numberOfRounds : std_logic_vector(3 downto 0);
71
 
72
   -- Clock period definitions
73
   constant clock_period : time := 10 ns;
74
 
75
BEGIN
76
 
77
        -- Instantiate the Unit Under Test (UUT)
78
   uut: keyExpansion PORT MAP (
79
          reset => reset,
80
          clock => clock,
81
          loadKey => loadKey,
82
          key => key,
83
          subKeyEnable => subKeyEnable,
84
          subKeyAddress => subKeyAddress,
85
          subKey => subKey,
86
          keyExpansionReady => keyExpansionReady,
87
          numberOfRounds => numberOfRounds
88
        );
89
 
90
   -- Clock process definitions
91
   clock_process :process
92
   begin
93
                clock <= '0';
94
                wait for clock_period/2;
95
                clock <= '1';
96
                wait for clock_period/2;
97
   end process;
98
 
99
 
100
   -- Stimulus process
101
   stim_proc: process
102
   begin
103
      wait for 100 ns;
104
      wait for clock_period*10;
105
      reset <= '1';
106
      loadKey <= '1';
107
      key <= x"09cf4f3c";
108
      wait for clock_period;
109
      reset <= '0';
110
      key <= x"abf71588";
111
      wait for clock_period;
112
      key <= x"28aed2a6";
113
      wait for clock_period;
114
      key <= x"2b7e1516";
115
      wait for clock_period;
116
      loadKey <= '0';
117
      wait for clock_period*44;
118
      reset <= '1';
119
      loadKey <= '1';
120
      key <= x"522c6b7b";
121
      wait for clock_period;
122
      reset <= '0';
123
      key <= x"62f8ead2";
124
      wait for clock_period;
125
      key <= x"809079e5";
126
      wait for clock_period;
127
      key <= x"c810f32b";
128
      wait for clock_period;
129
      key <= x"da0e6452";
130
      wait for clock_period;
131
      key <= x"8e73b0f7";
132
      wait for clock_period;
133
      loadKey <= '0';
134
      wait for clock_period*52;
135
      reset <= '1';
136
      loadKey <= '1';
137
      key <= x"0914dff4";
138
      wait for clock_period;
139
      reset <= '0';
140
      key <= x"2d9810a3";
141
      wait for clock_period;
142
      key <= x"3b6108d7";
143
      wait for clock_period;
144
      key <= x"1f352c07";
145
      wait for clock_period;
146
      key <= x"857d7781";
147
      wait for clock_period;
148
      key <= x"2b73aef0";
149
      wait for clock_period;
150
      key <= x"15ca71be";
151
      wait for clock_period;
152
      key <= x"603deb10";
153
      wait for clock_period;
154
      loadKey <= '0';
155
      wait for clock_period*60;
156
      wait;
157
   end process;
158
 
159
END;

powered by: WebSVN 2.1.0

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