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

Subversion Repositories aes_pipe

[/] [aes_pipe/] [trunk/] [bench/] [vhdl/] [tb_aes.vhdl] - Blame information for rev 5

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 subhasis25
----------------------------------------------------------------------
2
----                                                              ----
3
---- This source file may be used and distributed without         ----
4
---- restriction provided that this copyright statement is not    ----
5
---- removed from the file and that any derivative work contains  ----
6
---- the original copyright notice and the associated disclaimer. ----
7
----                                                              ----
8
---- This source file is free software; you can redistribute it   ----
9
---- and/or modify it under the terms of the GNU Lesser General   ----
10
---- Public License as published by the Free Software Foundation; ----
11
---- either version 2.1 of the License, or (at your option) any   ----
12
---- later version.                                               ----
13
----                                                              ----
14
---- This source is distributed in the hope that it will be       ----
15
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
16
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
17
---- PURPOSE.  See the GNU Lesser General Public License for more ----
18
---- details.                                                     ----
19
----                                                              ----
20
---- You should have received a copy of the GNU Lesser General    ----
21
---- Public License along with this source; if not, download it   ----
22
---- from http:--www.opencores.org/lgpl.shtml                     ----
23
----                                                              ----
24
----------------------------------------------------------------------
25
------------------------------------------------------
26
-- Project: AESFast
27
-- Author: Subhasis
28
-- Last Modified: 20/03/10
29
-- Email: subhasis256@gmail.com
30
--
31
-- TODO: Test with NIST test vectors
32
------------------------------------------------------
33
--
34
-- Description: Testbench for AESFast
35
------------------------------------------------------
36
 
37
library IEEE;
38
use IEEE.std_logic_1164.all;
39
use IEEE.std_logic_arith.all;
40
use IEEE.std_logic_unsigned.all;
41
 
42
library work;
43
use work.aes_pkg.all;
44
 
45
entity tb_aes is
46
end tb_aes;
47
 
48
architecture rtl of tb_aes is
49
signal clk: std_logic;
50
signal plaintext: datablock;
51
signal key: datablock;
52
signal cipher: datablock;
53
signal start: std_logic := '0';
54
signal done: std_logic;
55
 
56 5 subhasis25
component aes_top is
57 2 subhasis25
port(
58 5 subhasis25
        clk_i: in std_logic;
59
        plaintext_i: in datablock;
60
        keyblock_i: in datablock;
61
        ciphertext_o: out datablock
62 2 subhasis25
        );
63
end component;
64
 
65
begin
66
        g0: for i in 3 downto 0 generate
67
                g1: for j in 3 downto 1 generate
68
                        plaintext(i,j) <= X"00";
69
                        key(i,j) <= X"00";
70
                end generate;
71
        end generate;
72
        plaintext(3,0) <= X"00";
73
        plaintext(2,0) <= X"00";
74
        plaintext(1,0) <= X"00";
75
        key(3,0) <= X"00";
76
        key(2,0) <= X"00";
77
        key(1,0) <= X"00";
78
        key(0,0) <= X"00";
79 5 subhasis25
        proc0: aes_top port map(
80
                                                clk_i => clk,
81
                                                plaintext_i => plaintext,
82
                                                keyblock_i => key,
83
                                                ciphertext_o => cipher
84 2 subhasis25
                                           );
85
        gen_clk: process
86
        begin
87
                wait for 10 ns;
88
                clk <= '1';
89
                wait for 10 ns;
90
                clk <= '0';
91
        end process;
92
 
93
        gen_in: process
94
        begin
95
                wait for 25 ns;
96
                plaintext(0,0) <= X"00";
97
                wait for 20 ns;
98
                plaintext(0,0) <= X"01";
99
                wait for 20 ns;
100
                plaintext(0,0) <= X"02";
101
                wait for 40 ns;
102
                plaintext(0,0) <= X"03";
103
                wait;
104
        end process;
105
end rtl;

powered by: WebSVN 2.1.0

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