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

Subversion Repositories threeaesc

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

powered by: WebSVN 2.1.0

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