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

Subversion Repositories deslcore

[/] [deslcore/] [trunk/] [tb/] [tb_des_loop.vhd] - Diff between revs 2 and 3

Only display areas with differences | Details | Blame | View Log

Rev 2 Rev 3
--------------------------------------------------------------------------------
 
-- Company: 
-- Copyright (c) 2013 Antonio de la Piedra
-- Engineer:
 
--
-- This program is free software: you can redistribute it and/or modify
-- Create Date:   11:47:33 02/21/2013
-- it under the terms of the GNU General Public License as published by
-- Design Name:   
-- the Free Software Foundation, either version 3 of the License, or
-- Module Name:   C:/Users/vmr/Desktop/crypto_ng/des/dram/desl/tb_des_loop.vhd
-- (at your option) any later version.
-- Project Name:  desl
 
-- Target Device:  
-- This program is distributed in the hope that it will be useful,
-- Tool versions:  
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- Description:   
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- 
-- GNU General Public License for more details.
-- VHDL Test Bench Created by ISE for module: des_loop
 
-- 
-- You should have received a copy of the GNU General Public License
-- Dependencies:
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
-- 
 
-- Revision:
 
-- Revision 0.01 - File Created
 
-- Additional Comments:
 
--
 
-- Notes: 
 
-- This testbench has been automatically generated using types std_logic and
 
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends
 
-- that these types always be used for the top-level I/O of a design in order
 
-- to guarantee that the testbench will bind correctly to the post-implementation 
 
-- simulation model.
 
--------------------------------------------------------------------------------
 
LIBRARY ieee;
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_1164.ALL;
 
 
-- Uncomment the following library declaration if using
 
-- arithmetic functions with Signed or Unsigned values
 
--USE ieee.numeric_std.ALL;
 
 
 
ENTITY tb_des_loop IS
ENTITY tb_des_loop IS
END tb_des_loop;
END tb_des_loop;
 
 
ARCHITECTURE behavior OF tb_des_loop IS
ARCHITECTURE behavior OF tb_des_loop IS
 
 
    -- Component Declaration for the Unit Under Test (UUT)
    -- Component Declaration for the Unit Under Test (UUT)
 
 
    COMPONENT des_loop
    COMPONENT des_loop
    PORT(
    PORT(
         clk : IN  std_logic;
         clk : IN  std_logic;
         rst : IN  std_logic;
         rst : IN  std_logic;
         mode : IN  std_logic;
         mode : IN  std_logic;
         key_in : IN  std_logic_vector(55 downto 0);
         key_in : IN  std_logic_vector(55 downto 0);
         blk_in : IN  std_logic_vector(63 downto 0);
         blk_in : IN  std_logic_vector(63 downto 0);
         blk_out : OUT  std_logic_vector(63 downto 0)
         blk_out : OUT  std_logic_vector(63 downto 0)
        );
        );
    END COMPONENT;
    END COMPONENT;
 
 
 
 
   --Inputs
   --Inputs
   signal clk : std_logic := '0';
   signal clk : std_logic := '0';
   signal rst : std_logic := '0';
   signal rst : std_logic := '0';
   signal mode : std_logic := '0';
   signal mode : std_logic := '0';
   signal key_in : std_logic_vector(55 downto 0) := (others => '0');
   signal key_in : std_logic_vector(55 downto 0) := (others => '0');
   signal blk_in : std_logic_vector(63 downto 0) := (others => '0');
   signal blk_in : std_logic_vector(63 downto 0) := (others => '0');
 
 
        --Outputs
        --Outputs
   signal blk_out : std_logic_vector(63 downto 0);
   signal blk_out : std_logic_vector(63 downto 0);
 
 
   -- Clock period definitions
   -- Clock period definitions
   constant clk_period : time := 10 ns;
   constant clk_period : time := 10 ns;
 
 
BEGIN
BEGIN
 
 
        -- Instantiate the Unit Under Test (UUT)
        -- Instantiate the Unit Under Test (UUT)
   uut: des_loop PORT MAP (
   uut: des_loop PORT MAP (
          clk => clk,
          clk => clk,
          rst => rst,
          rst => rst,
          mode => mode,
          mode => mode,
          key_in => key_in,
          key_in => key_in,
          blk_in => blk_in,
          blk_in => blk_in,
          blk_out => blk_out
          blk_out => blk_out
        );
        );
 
 
   -- Clock process definitions
   -- Clock process definitions
   clk_process :process
   clk_process :process
   begin
   begin
                clk <= '0';
                clk <= '0';
                wait for clk_period/2;
                wait for clk_period/2;
                clk <= '1';
                clk <= '1';
                wait for clk_period/2;
                wait for clk_period/2;
   end process;
   end process;
 
 
 
 
   -- Stimulus process
   -- Stimulus process
   stim_proc: process
   stim_proc: process
   begin
   begin
                wait for clk_period/2 + clk_period;
                wait for clk_period/2 + clk_period;
                mode <= '0';
                mode <= '0';
                blk_in <= X"4E45565251554954";
                blk_in <= X"4E45565251554954";
                key_in <= "00000000111111110000000000101010010100000000000110010100";
                key_in <= "00000000111111110000000000101010010100000000000110010100";
                rst <= '1';
                rst <= '1';
                wait for clk_period;
                wait for clk_period;
                rst <= '0';
                rst <= '0';
      wait for clk_period*16;
      wait for clk_period*16;
 
 
                assert blk_out = X"72c6e3c6d2168e78"
                assert blk_out = X"72c6e3c6d2168e78"
                        report "ENCRYPT ERROR" severity FAILURE;
                        report "ENCRYPT ERROR" severity FAILURE;
 
 
                wait for clk_period;
                wait for clk_period;
 
 
                mode <= '1';
                mode <= '1';
                blk_in <=  X"72c6e3c6d2168e78";
                blk_in <=  X"72c6e3c6d2168e78";
                key_in <=  "00000000111111110000000000101010010100000000000110010100";
                key_in <=  "00000000111111110000000000101010010100000000000110010100";
                rst <= '1';
                rst <= '1';
                wait for clk_period;
                wait for clk_period;
                rst <= '0';
                rst <= '0';
    wait for clk_period*16;
    wait for clk_period*16;
 
 
                assert blk_out = X"4E45565251554954"
                assert blk_out = X"4E45565251554954"
                        report "DECRYPT ERROR" severity FAILURE;
                        report "DECRYPT ERROR" severity FAILURE;
 
 
      wait;
      wait;
   end process;
   end process;
 
 
END;
END;
 
 

powered by: WebSVN 2.1.0

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