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

Subversion Repositories threeaesc

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

powered by: WebSVN 2.1.0

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