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

Subversion Repositories threeaesc

[/] [threeaesc/] [trunk/] [aes_c_1/] [src/] [tb_aes_enc.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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