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

Subversion Repositories descore

[/] [descore/] [trunk/] [tb/] [tb_des_loop.vhd] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 entactogen
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   11:47:33 02/21/2013
6
-- Design Name:   
7
-- Module Name:   C:/Users/vmr/Desktop/crypto_ng/des/dram/desl/tb_des_loop.vhd
8
-- Project Name:  desl
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: des_loop
14
-- 
15
-- Dependencies:
16
-- 
17
-- Revision:
18
-- Revision 0.01 - File Created
19
-- Additional Comments:
20
--
21
-- Notes: 
22
-- This testbench has been automatically generated using types std_logic and
23
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends
24
-- that these types always be used for the top-level I/O of a design in order
25
-- to guarantee that the testbench will bind correctly to the post-implementation 
26
-- simulation model.
27
--------------------------------------------------------------------------------
28
LIBRARY ieee;
29
USE ieee.std_logic_1164.ALL;
30
 
31
-- Uncomment the following library declaration if using
32
-- arithmetic functions with Signed or Unsigned values
33
--USE ieee.numeric_std.ALL;
34
 
35
ENTITY tb_des_loop IS
36
END tb_des_loop;
37
 
38
ARCHITECTURE behavior OF tb_des_loop IS
39
 
40
    -- Component Declaration for the Unit Under Test (UUT)
41
 
42
    COMPONENT des_loop
43
    PORT(
44
         clk : IN  std_logic;
45
         rst : IN  std_logic;
46
         mode : IN  std_logic;
47
         key_in : IN  std_logic_vector(63 downto 0);
48
         blk_in : IN  std_logic_vector(63 downto 0);
49
         blk_out : OUT  std_logic_vector(63 downto 0)
50
        );
51
    END COMPONENT;
52
 
53
 
54
   --Inputs
55
   signal clk : std_logic := '0';
56
   signal rst : std_logic := '0';
57
   signal mode : std_logic := '0';
58
   signal key_in : std_logic_vector(63 downto 0) := (others => '0');
59
   signal blk_in : std_logic_vector(63 downto 0) := (others => '0');
60
 
61
        --Outputs
62
   signal blk_out : std_logic_vector(63 downto 0);
63
 
64
   -- Clock period definitions
65
   constant clk_period : time := 10 ns;
66
 
67
BEGIN
68
 
69
        -- Instantiate the Unit Under Test (UUT)
70
   uut: des_loop PORT MAP (
71
          clk => clk,
72
          rst => rst,
73
          mode => mode,
74
          key_in => key_in,
75
          blk_in => blk_in,
76
          blk_out => blk_out
77
        );
78
 
79
   -- Clock process definitions
80
   clk_process :process
81
   begin
82
                clk <= '0';
83
                wait for clk_period/2;
84
                clk <= '1';
85
                wait for clk_period/2;
86
   end process;
87
 
88
 
89
   -- Stimulus process
90
   stim_proc: process
91
   begin
92
                wait for clk_period/2 + clk_period;
93
                mode <= '0';
94
                blk_in <= X"4E45565251554954";
95
                key_in <= X"4B41534849534142";
96
                rst <= '1';
97
                wait for clk_period;
98
                rst <= '0';
99
      wait for clk_period*16;
100
 
101
                assert blk_out = X"763549D38B570C0E"
102
                        report "ENCRYPT ERROR" severity FAILURE;
103
 
104
                wait for clk_period;
105
 
106
                mode <= '1';
107
                blk_in <=  X"763549D38B570C0E";
108
                key_in <=  X"4B41534849534142";
109
                rst <= '1';
110
                wait for clk_period;
111
                rst <= '0';
112
      wait for clk_period*16;
113
 
114
                assert blk_out = X"4E45565251554954"
115
                        report "DECRYPT ERROR" severity FAILURE;
116
 
117
      wait;
118
   end process;
119
 
120
END;

powered by: WebSVN 2.1.0

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