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

Subversion Repositories threeaesc

[/] [threeaesc/] [trunk/] [aes_c_1/] [src/] [tb_aes_fsm_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_fsm_enc IS
20
END tb_aes_fsm_enc;
21
 
22
ARCHITECTURE behavior OF tb_aes_fsm_enc IS
23
 
24
    COMPONENT aes_fsm_enc
25
        port(     clk: in std_logic;
26
                  rst : in std_logic;
27
                  block_in : in std_logic_vector(127 downto 0);
28
                  key : in std_logic_vector(127 downto 0);
29
                  enc : in std_logic;
30
 
31
                  block_out : out std_logic_vector(127 downto 0);
32
                  block_ready : out std_logic);
33
    END COMPONENT;
34
 
35
 
36
   --Inputs
37
   signal clk : std_logic := '0';
38
   signal rst : std_logic := '0';
39
   signal block_in : std_logic_vector(127 downto 0) := (others => '0');
40
   signal key : std_logic_vector(127 downto 0) := (others=> '0');
41
   signal enc : std_logic := '0';
42
 
43
        --Outputs
44
   signal block_out : std_logic_vector(127 downto 0);
45
   signal block_ready : std_logic;
46
 
47
   -- Clock period definitions
48
   constant clk_period : time := 10 ns;
49
 
50
BEGIN
51
 
52
        -- Instantiate the Unit Under Test (UUT)
53
   uut: aes_fsm_enc PORT MAP (
54
          clk => clk,
55
          rst => rst,
56
          block_in => block_in,
57
          key => key,
58
          enc => enc,
59
          block_out => block_out,
60
          block_ready => block_ready);
61
 
62
   -- Clock process definitions
63
   clk_process :process
64
   begin
65
                clk <= '0';
66
                wait for clk_period/2;
67
                clk <= '1';
68
                wait for clk_period/2;
69
   end process;
70
 
71
 
72
   -- Stimulus process
73
   stim_proc: process
74
   begin
75
 
76
                wait for clk_period/2 + clk_period*2;
77
                rst <= '1';
78
 
79
                wait for clk_period;
80
                rst <= '0';
81
                enc <= '1';
82
 
83
                block_in <= X"0f0e0d0c0b0a09080706050403020100";
84
                key      <= X"0f0e0d0c0b0a09080706050403020100";
85
 
86
                wait for 0.62*2 us;
87
 
88
                enc <= '0';
89
 
90
                wait for 1.73 us;
91
 
92
                enc <= '1';
93
 
94
                block_in <= X"0f0e0d0c0b0a09080706050403020100";
95
                key      <= X"0f0e0d0c0b0a09080706050403020100";
96
 
97
                wait for 0.62 us;
98
 
99
                enc <= '0';
100
 
101
                wait for 2.73 us;
102
 
103
                enc <= '1';
104
 
105
                block_in <= X"0f0e0d0c0b0a09080706050403020100";
106
                key      <= X"0f0e0d0c0b0a09080706050403020100";
107
 
108
 
109
 
110
                wait;
111
   end process;
112
 
113
END;

powered by: WebSVN 2.1.0

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