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

Subversion Repositories threeaesc

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

powered by: WebSVN 2.1.0

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