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

Subversion Repositories present

[/] [present/] [trunk/] [32BitIO/] [bench/] [vhdl/] [sLayerTB.vhd] - Blame information for rev 7

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

Line No. Rev Author Line
1 4 gajos
-----------------------------------------------------------------------
2
----                                                               ----
3
---- Present - a lightweight block cipher project                  ----
4
----                                                               ----
5
---- This file is part of the Present - a lightweight block        ----
6
---- cipher project                                                ----
7
---- http://www.http://opencores.org/project,present               ----
8
----                                                               ----
9
---- Description:                                                  ----
10
----     Substitution layer test bench of Present encoder.         ----
11
---- Nothing special.                                              ----
12
---- To Do:                                                        ----
13
----                                                               ----
14
---- Author(s):                                                    ----
15
---- - Krzysztof Gajewski, gajos@opencores.org                     ----
16
----                       k.gajewski@gmail.com                    ----
17
----                                                               ----
18
-----------------------------------------------------------------------
19
----                                                               ----
20
---- Copyright (C) 2013 Authors and OPENCORES.ORG                  ----
21
----                                                               ----
22
---- This source file may be used and distributed without          ----
23
---- restriction provided that this copyright statement is not     ----
24
---- removed from the file and that any derivative work contains   ----
25
---- the original copyright notice and the associated disclaimer.  ----
26
----                                                               ----
27
---- This source file is free software; you can redistribute it    ----
28
---- and-or modify it under the terms of the GNU Lesser General    ----
29
---- Public License as published by the Free Software Foundation;  ----
30
---- either version 2.1 of the License, or (at your option) any    ----
31
---- later version.                                                ----
32
----                                                               ----
33
---- This source is distributed in the hope that it will be        ----
34
---- useful, but WITHOUT ANY WARRANTY; without even the implied    ----
35
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR       ----
36
---- PURPOSE. See the GNU Lesser General Public License for more   ----
37
---- details.                                                      ----
38
----                                                               ----
39
---- You should have received a copy of the GNU Lesser General     ----
40
---- Public License along with this source; if not, download it    ----
41
---- from http://www.opencores.org/lgpl.shtml                      ----
42
----                                                               ----
43
-----------------------------------------------------------------------
44 2 gajos
LIBRARY ieee;
45
USE ieee.std_logic_1164.ALL;
46
USE ieee.std_logic_unsigned.all;
47
USE ieee.numeric_std.ALL;
48
 
49
ENTITY sLayerTB IS
50
END sLayerTB;
51
 
52
ARCHITECTURE behavior OF sLayerTB IS
53
 
54
    -- Component Declaration for the Unit Under Test (UUT)
55
 
56
    COMPONENT slayer
57
    PORT(
58
         input : IN  std_logic_vector(3 downto 0);
59
         output : OUT  std_logic_vector(3 downto 0)
60
        );
61
    END COMPONENT;
62
 
63
 
64
   --Inputs
65
   signal clk : std_logic := '0';
66
   signal reset : std_logic := '0';
67
 
68
        --BiDirs
69
   signal input : std_logic_vector(3 downto 0);
70
   signal output : std_logic_vector(3 downto 0);
71
 
72
   -- Clock period definitions
73
   constant clk_period : time := 1ns;
74
 
75
BEGIN
76
 
77
        -- Instantiate the Unit Under Test (UUT)
78
   uut: slayer PORT MAP (
79
          input => input,
80
          output => output
81
        );
82
 
83
   -- Clock process definitions
84
   clk_process :process
85
   begin
86
                clk <= '0';
87
                wait for clk_period/2;
88
                clk <= '1';
89
                wait for clk_period/2;
90
   end process;
91
 
92
 
93
   -- Stimulus process
94
   stim_proc: process
95
   begin
96
      -- hold reset state for 100ms.
97
                reset <= '1';
98
      wait for 100ns;
99
                reset <= '0';
100
      wait for clk_period;
101
                input <= x"0";
102
      wait for clk_period;
103
                input <= x"A";
104
      wait for clk_period;
105
                input <= x"F";
106
      wait for clk_period;
107
      -- insert stimulus here 
108
                assert false severity failure;
109
   end process;
110
 
111
END;

powered by: WebSVN 2.1.0

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