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 2

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

Line No. Rev Author Line
1 2 arif_endro
-- $Id: modelsim_bench.vhdl,v 1.1.1.1 2005-12-06 02:47:46 arif_endro Exp $
2
-------------------------------------------------------------------------------
3
-- Title       : ModelSim bench
4
-- Project     : Mini AES 128 
5
-------------------------------------------------------------------------------
6
-- File        : modelsim_bench.vhdl
7
-- Author      : "Arif E. Nugroho" <arif_endro@yahoo.com>
8
-- Created     : 2005/12/03
9
-- Last update : 
10
-- Simulators  : ModelSim SE PLUS 6.0
11
-- Synthesizers: ISE Xilinx 6.3i
12
-- Target      : 
13
-------------------------------------------------------------------------------
14
-- Description : Top module to connect all component in test bench.
15
-------------------------------------------------------------------------------
16
-- Copyright (C) 2005 Arif E. Nugroho
17
-- This VHDL design file is an open design; you can redistribute it and/or
18
-- modify it and/or implement it after contacting the author
19
-------------------------------------------------------------------------------
20
-------------------------------------------------------------------------------
21
-- 
22
--         THIS SOURCE FILE MAY BE USED AND DISTRIBUTED WITHOUT RESTRICTION
23
-- PROVIDED THAT THIS COPYRIGHT STATEMENT IS NOT REMOVED FROM THE FILE AND THAT
24
-- ANY DERIVATIVE WORK CONTAINS THE ORIGINAL COPYRIGHT NOTICE AND THE
25
-- ASSOCIATED DISCLAIMER.
26
-- 
27
-------------------------------------------------------------------------------
28
-- 
29
--         THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
30
-- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31
-- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
32
-- EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34
-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
35
-- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
36
-- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
37
-- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
38
-- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
-- 
40
-------------------------------------------------------------------------------
41
 
42
library ieee;
43
use ieee.std_logic_1164.all;
44
 
45
entity modelsim_bench is
46
end modelsim_bench;
47
 
48
architecture structural of modelsim_bench is
49
 
50
  component mini_aes
51
    port (
52
      clock          : in  std_logic;
53
      clear          : in  std_logic;
54
      enc            : in  std_logic;
55
      key_i          : in  std_logic_vector (127 downto 000);
56
      data_i         : in  std_logic_vector (127 downto 000);
57
      data_o         : out std_logic_vector (127 downto 000);
58
      done_o         : out std_logic
59
      );
60
  end component;
61
--
62
  component input
63
    port (
64
      clock          : out std_logic;
65
      clear          : out std_logic;
66
      done           : in  std_logic;
67
      test_iteration : out integer;
68
      data_i         : out std_logic_vector (127 downto 000);
69
      cipher_o       : out std_logic_vector (127 downto 000);
70
      key_i          : out std_logic_vector (127 downto 000)
71
      );
72
  end component;
73
--
74
  component output
75
    port (
76
      clock          : in  std_logic;
77
      enc            : in  std_logic;
78
      done           : in  std_logic;
79
      test_iteration : in  integer;
80
      verifier       : in  std_logic_vector (127 downto 000);
81
      data_o         : in  std_logic_vector (127 downto 000)
82
      );
83
  end component;
84
 
85
  signal clock_enc          : std_logic;
86
  signal clock_dec          : std_logic;
87
  signal clear_enc          : std_logic;
88
  signal clear_dec          : std_logic;
89
  signal done_dec           : std_logic;
90
  signal done_enc           : std_logic;
91
  signal test_iteration_enc : integer;
92
  signal test_iteration_dec : integer;
93
  signal cipher_o_enc       : std_logic_vector (127 downto 000);
94
  signal cipher_o_dec       : std_logic_vector (127 downto 000);
95
  signal data_i_enc         : std_logic_vector (127 downto 000);
96
  signal data_i_dec         : std_logic_vector (127 downto 000);
97
  signal data_o_enc         : std_logic_vector (127 downto 000);
98
  signal data_o_dec         : std_logic_vector (127 downto 000);
99
  signal key_i_enc          : std_logic_vector (127 downto 000);
100
  signal key_i_dec          : std_logic_vector (127 downto 000);
101
 
102
begin
103
 
104
  my_aes_enc    : mini_aes
105
    port map (
106
      clock          => clock_enc,
107
      clear          => clear_enc,
108
      enc            => '0',
109
      key_i          => key_i_enc,
110
      data_i         => data_i_enc,
111
      data_o         => data_o_enc,
112
      done_o         => done_enc
113
      );
114
--
115
  my_aes_dec    : mini_aes
116
    port map (
117
      clock          => clock_dec,
118
      clear          => clear_dec,
119
      enc            => '1',
120
      key_i          => key_i_dec,
121
      data_i         => cipher_o_dec,
122
      data_o         => data_o_dec,
123
      done_o         => done_dec
124
      );
125
--
126
  my_input_enc  : input
127
    port map (
128
      clock          => clock_enc,
129
      clear          => clear_enc,
130
      done           => done_enc,
131
      test_iteration => test_iteration_enc,
132
      data_i         => data_i_enc,
133
      cipher_o       => cipher_o_enc,
134
      key_i          => key_i_enc
135
      );
136
  my_input_dec  : input
137
    port map (
138
      clock          => clock_dec,
139
      clear          => clear_dec,
140
      done           => done_dec,
141
      test_iteration => test_iteration_dec,
142
      data_i         => data_i_dec,
143
      cipher_o       => cipher_o_dec,
144
      key_i          => key_i_dec
145
      );
146
--
147
  my_output_enc : output
148
    port map (
149
      clock          => clock_enc,
150
      enc            => '0',
151
      done           => done_enc,
152
      test_iteration => test_iteration_enc,
153
      verifier       => cipher_o_enc,
154
      data_o         => data_o_enc
155
      );
156
--
157
  my_output_dec : output
158
    port map (
159
      clock          => clock_dec,
160
      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-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.