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

Subversion Repositories rsa_512

[/] [rsa_512/] [trunk/] [bench/] [test_512.vhd] - Diff between revs 3 and 11

Show entire file | Details | Blame | View Log

Rev 3 Rev 11
Line 40... Line 40...
  component rsa_top
  component rsa_top
    port(
    port(
      clk       : in  std_logic;
      clk       : in  std_logic;
      reset     : in  std_logic;
      reset     : in  std_logic;
      valid_in  : in  std_logic;
      valid_in  : in  std_logic;
 
      start_in  : in  std_logic;
      x         : in  std_logic_vector(15 downto 0);
      x         : in  std_logic_vector(15 downto 0);
      y         : in  std_logic_vector(15 downto 0);
      y         : in  std_logic_vector(15 downto 0);
      m         : in  std_logic_vector(15 downto 0);
      m         : in  std_logic_vector(15 downto 0);
      r_c       : in  std_logic_vector(15 downto 0);
      r_c       : in  std_logic_vector(15 downto 0);
      n_c       : in  std_logic_vector(15 downto 0);
 
      s         : out std_logic_vector(15 downto 0);
      s         : out std_logic_vector(15 downto 0);
      valid_out : out std_logic;
      valid_out : out std_logic;
      bit_size  : in  std_logic_vector(15 downto 0)
      bit_size  : in  std_logic_vector(15 downto 0)
      );
      );
  end component;
  end component;
Line 56... Line 56...
 
 
  --Inputs 
  --Inputs 
  signal clk       : std_logic                     := '0';
  signal clk       : std_logic                     := '0';
  signal reset     : std_logic                     := '0';
  signal reset     : std_logic                     := '0';
  signal valid_in  : std_logic                     := '0';
  signal valid_in  : std_logic                     := '0';
 
  signal start_in  : std_logic;
  signal x         : std_logic_vector(15 downto 0) := (others => '0');
  signal x         : std_logic_vector(15 downto 0) := (others => '0');
  signal y         : std_logic_vector(15 downto 0) := (others => '0');
  signal y         : std_logic_vector(15 downto 0) := (others => '0');
  signal m         : std_logic_vector(15 downto 0) := (others => '0');
  signal m         : std_logic_vector(15 downto 0) := (others => '0');
  signal r_c       : std_logic_vector(15 downto 0) := (others => '0');
  signal r_c       : std_logic_vector(15 downto 0) := (others => '0');
  signal n_c       : std_logic_vector(15 downto 0) := (others => '0');
  signal n_c       : std_logic_vector(15 downto 0) := (others => '0');
Line 76... Line 77...
  -- Instantiate the Unit Under Test (UUT) 
  -- Instantiate the Unit Under Test (UUT) 
  uut : rsa_top port map (
  uut : rsa_top port map (
    clk       => clk,
    clk       => clk,
    reset     => reset,
    reset     => reset,
    valid_in  => valid_in,
    valid_in  => valid_in,
 
    start_in  => start_in,
    x         => x,
    x         => x,
    y         => y,
    y         => y,
    m         => m,
    m         => m,
    r_c       => r_c,
    r_c       => r_c,
    n_c       => n_c,
 
    s         => s,
    s         => s,
    valid_out => valid_out,
    valid_out => valid_out,
    bit_size  => bit_size
    bit_size  => bit_size
    );
    );
 
 
Line 99... Line 100...
 
 
 
 
  -- Stimulus process 
  -- Stimulus process 
  stim_proc : process
  stim_proc : process
  begin
  begin
 
    start_in <= '0';
    valid_in <= '0';
    valid_in <= '0';
    -- hold reset state for 100ms. 
    -- hold reset state for 100ms. 
    reset    <= '1';
    reset    <= '1';
    wait for 10ns;
    wait for 10ns;
    reset    <= '0';
    reset    <= '0';
    wait for clk_period*10;
    wait for clk_period*10;
 
 
    -- insert stimulus here  
    -- insert stimulus here  
 
 
--n_c and valid signal and the r_c constant are also required
--n_c and valid signal and the r_c constant are also required
    n_c      <= x"738f";
    --n_c      <= x"738f";
    valid_in <= '1';
    m        <= x"b491";
 
    --Start_in to begin n_c calculation
 
    start_in <= '1';
 
    wait for clk_period;
 
    start_in <= '0';
 
    wait for clk_period*6;
 
    --Start data flow
    x        <= x"f3ad";
    x        <= x"f3ad";
    y        <= x"42b1";
    y        <= x"42b1";
    m        <= x"b491";
    m        <= x"b491";
    r_c      <= x"f579";
    r_c      <= x"f579";
 
    valid_in <= '1';
    wait for clk_period;
    wait for clk_period;
    x        <= x"8e40";
    x        <= x"8e40";
    y        <= x"1ad3";
    y        <= x"1ad3";
    m        <= x"1417";
    m        <= x"1417";
    r_c      <= x"6ee9";
    r_c      <= x"6ee9";
Line 437... Line 446...
    valid_in <= '0';
    valid_in <= '0';
 
 
    wait;
    wait;
  end process;
  end process;
 
 
END;
end;
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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