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

Subversion Repositories mini_aes

[/] [mini_aes/] [trunk/] [bench/] [modelsim_bench.vhdl] - Blame information for rev 21

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

Line No. Rev Author Line
1 21 arif_endro
-- ------------------------------------------------------------------------
2 16 arif_endro
-- Copyright (C) 2005 Arif Endro Nugroho
3 21 arif_endro
-- All rights reserved.
4 2 arif_endro
-- 
5 21 arif_endro
-- Redistribution and use in source and binary forms, with or without
6
-- modification, are permitted provided that the following conditions
7
-- are met:
8 2 arif_endro
-- 
9 21 arif_endro
-- 1. Redistributions of source code must retain the above copyright
10
--    notice, this list of conditions and the following disclaimer.
11
-- 2. Redistributions in binary form must reproduce the above copyright
12
--    notice, this list of conditions and the following disclaimer in the
13
--    documentation and/or other materials provided with the distribution.
14
-- 3. The name of Arif Endro Nugroho may not be used to endorse or promote
15
--    products derived from this software without specific prior written
16
--    permission.
17 2 arif_endro
-- 
18 21 arif_endro
-- THIS SOFTWARE IS PROVIDED BY ARIF ENDRO NUGROHO "AS IS" AND ANY EXPRESS
19
-- OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
-- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
-- DISCLAIMED. IN NO EVENT SHALL ARIF ENDRO NUGROHO BE LIABLE FOR ANY
22
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24
-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25
-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26
-- STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27
-- ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
-- POSSIBILITY OF SUCH DAMAGE.
29 2 arif_endro
-- 
30 21 arif_endro
-- End Of License.
31
-- ------------------------------------------------------------------------
32 2 arif_endro
 
33
library ieee;
34
use ieee.std_logic_1164.all;
35
 
36
entity modelsim_bench is
37
end modelsim_bench;
38
 
39
architecture structural of modelsim_bench is
40
 
41
  component mini_aes
42
    port (
43
      clock          : in  std_logic;
44
      clear          : in  std_logic;
45 7 arif_endro
      load_i         : in  std_logic;
46 2 arif_endro
      enc            : in  std_logic;
47 7 arif_endro
      key_i          : in  std_logic_vector (007 downto 000);
48
      data_i         : in  std_logic_vector (007 downto 000);
49
      data_o         : out std_logic_vector (007 downto 000);
50 2 arif_endro
      done_o         : out std_logic
51
      );
52
  end component;
53
--
54
  component input
55
    port (
56
      clock          : out std_logic;
57 7 arif_endro
      load           : out std_logic;
58 2 arif_endro
      done           : in  std_logic;
59
      test_iteration : out integer;
60 7 arif_endro
      key_i_byte     : out std_logic_vector (007 downto 000);
61
      data_i_byte    : out std_logic_vector (007 downto 000);
62
      cipher_o_byte  : out std_logic_vector (007 downto 000)
63 2 arif_endro
      );
64
  end component;
65
--
66
  component output
67
    port (
68
      clock          : in  std_logic;
69 7 arif_endro
      clear          : in  std_logic;
70
      load           : in  std_logic;
71 2 arif_endro
      enc            : in  std_logic;
72
      done           : in  std_logic;
73
      test_iteration : in  integer;
74 7 arif_endro
      verifier       : in  std_logic_vector (007 downto 000);
75
      data_o         : in  std_logic_vector (007 downto 000)
76 2 arif_endro
      );
77
  end component;
78
 
79 7 arif_endro
  signal load_enc           : std_logic;
80
  signal load_dec           : std_logic;
81 2 arif_endro
  signal clock_enc          : std_logic;
82
  signal clock_dec          : std_logic;
83
  signal done_dec           : std_logic;
84
  signal done_enc           : std_logic;
85
  signal test_iteration_enc : integer;
86
  signal test_iteration_dec : integer;
87 7 arif_endro
  signal cipher_o_enc       : std_logic_vector (007 downto 000);
88
  signal cipher_o_dec       : std_logic_vector (007 downto 000);
89
  signal data_i_enc         : std_logic_vector (007 downto 000);
90
  signal data_i_dec         : std_logic_vector (007 downto 000);
91
  signal data_o_enc         : std_logic_vector (007 downto 000);
92
  signal data_o_dec         : std_logic_vector (007 downto 000);
93
  signal key_i_enc          : std_logic_vector (007 downto 000);
94
  signal key_i_dec          : std_logic_vector (007 downto 000);
95 2 arif_endro
 
96
begin
97
 
98
  my_aes_enc    : mini_aes
99
    port map (
100
      clock          => clock_enc,
101 7 arif_endro
      clear          => '0',
102
      load_i         => load_enc,
103 2 arif_endro
      enc            => '0',
104
      key_i          => key_i_enc,
105
      data_i         => data_i_enc,
106
      data_o         => data_o_enc,
107
      done_o         => done_enc
108
      );
109
--
110
  my_aes_dec    : mini_aes
111
    port map (
112
      clock          => clock_dec,
113 7 arif_endro
      clear          => '0',
114
      load_i         => load_dec,
115 2 arif_endro
      enc            => '1',
116
      key_i          => key_i_dec,
117
      data_i         => cipher_o_dec,
118
      data_o         => data_o_dec,
119
      done_o         => done_dec
120
      );
121
--
122
  my_input_enc  : input
123
    port map (
124
      clock          => clock_enc,
125 7 arif_endro
      load           => load_enc,
126 2 arif_endro
      done           => done_enc,
127
      test_iteration => test_iteration_enc,
128 7 arif_endro
      key_i_byte     => key_i_enc,
129
      data_i_byte    => data_i_enc,
130
      cipher_o_byte  => cipher_o_enc
131 2 arif_endro
      );
132
  my_input_dec  : input
133
    port map (
134
      clock          => clock_dec,
135 7 arif_endro
      load           => load_dec,
136 2 arif_endro
      done           => done_dec,
137
      test_iteration => test_iteration_dec,
138 7 arif_endro
      data_i_byte    => data_i_dec,
139
      cipher_o_byte  => cipher_o_dec,
140
      key_i_byte     => key_i_dec
141 2 arif_endro
      );
142
--
143
  my_output_enc : output
144
    port map (
145
      clock          => clock_enc,
146 7 arif_endro
      clear          => '0',
147
      load           => load_enc,
148 2 arif_endro
      enc            => '0',
149
      done           => done_enc,
150
      test_iteration => test_iteration_enc,
151
      verifier       => cipher_o_enc,
152
      data_o         => data_o_enc
153
      );
154
--
155
  my_output_dec : output
156
    port map (
157
      clock          => clock_dec,
158 7 arif_endro
      clear          => '0',
159
      load           => load_dec,
160 2 arif_endro
      enc            => '1',
161
      done           => done_dec,
162
      test_iteration => test_iteration_dec,
163
      verifier       => data_i_dec,
164
      data_o         => data_o_dec
165
      );
166
 
167
end structural;

powered by: WebSVN 2.1.0

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