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

Subversion Repositories BasicRSA

[/] [BasicRSA/] [trunk/] [rtl/] [vhdl/] [rsatest16.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 srmcqueen
 
2
-- VHDL Test Bench Created from source file rsacypher.vhd -- 13:35:16 05/04/2003
3
--
4
-- Notes: 
5
-- This testbench has been automatically generated using types std_logic and
6
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends 
7
-- that these types always be used for the top-level I/O of a design in order 
8
-- to guarantee that the testbench will bind correctly to the post-implementation 
9
-- simulation model.
10
--
11
LIBRARY ieee;
12
USE ieee.std_logic_1164.ALL;
13
USE ieee.numeric_std.ALL;
14
 
15
ENTITY testbench IS
16
END testbench;
17
 
18
ARCHITECTURE behavior OF testbench IS
19
 
20
        COMPONENT rsacypher
21
        PORT(
22
                indata : IN std_logic_vector(31 downto 0);
23
                inexp : IN std_logic_vector(31 downto 0);
24
                inmod : IN std_logic_vector(31 downto 0);
25
                clk : IN std_logic;
26
                ds : IN std_logic;
27
                reset : IN std_logic;
28
                cypher : OUT std_logic_vector(31 downto 0);
29
                ready : OUT std_logic
30
                );
31
        END COMPONENT;
32
 
33
        SIGNAL indata :  std_logic_vector(31 downto 0);
34
        SIGNAL inexp :  std_logic_vector(31 downto 0);
35
        SIGNAL inmod :  std_logic_vector(31 downto 0);
36
        SIGNAL cypher :  std_logic_vector(31 downto 0);
37
        SIGNAL clk :  std_logic;
38
        SIGNAL ds :  std_logic;
39
        SIGNAL reset :  std_logic;
40
        SIGNAL ready :  std_logic;
41
 
42
BEGIN
43
 
44
        uut: rsacypher PORT MAP(
45
                indata => indata,
46
                inexp => inexp,
47
                inmod => inmod,
48
                cypher => cypher,
49
                clk => clk,
50
                ds => ds,
51
                reset => reset,
52
                ready => ready
53
        );
54
 
55
 
56
-- *** Test Bench - User Defined Section ***
57
        TB: PROCESS
58
        BEGIN
59
                wait for 120ns;
60
                reset <= '1';
61
                ds <= '0';
62
                wait for 20ns;
63
                wait until clk = '0';
64
                reset <= '0';
65
                wait until clk = '1';
66
                wait until clk = '0';
67
                inexp <= x"00903ad9";
68
                inmod <= x"03b2c159";
69
                indata <= x"00724183";
70
                wait until clk = '1';
71
                wait for 2ns;
72
                ds <= '1';
73
                wait until ready = '0';
74
                ds <= '0';
75
                wait until ready = '1';
76
                wait;
77
-- decrypt exponent             inexp <= x"02d80e39";
78
        END PROCESS;
79
 
80
 
81
   ClkGen : PROCESS
82
   BEGIN
83
      wait for 5300ps; -- will wait forever
84
                if clk = '1' then
85
                        clk <= '0';
86
                else
87
                        clk <= '1';
88
                end if;
89
   END PROCESS;
90
-- *** End Test Bench - User Defined Section ***
91
 
92
END;

powered by: WebSVN 2.1.0

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