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

Subversion Repositories mod_sim_exp

[/] [mod_sim_exp/] [trunk/] [rtl/] [vhdl/] [core/] [x_shift_reg.vhd] - Diff between revs 2 and 3

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 3
Line 1... Line 1...
------------------------------------------------------------------------------------ 
----------------------------------------------------------------------  
--                      
----  x_shift_reg                                                 ---- 
-- Geoffrey Ottoy - DraMCo research group
----                                                              ---- 
--
----  This file is part of the                                    ----
-- Module Name: x_shift_reg.vhd / entity x_shift_reg
----    Modular Simultaneous Exponentiation Core project          ---- 
-- 
----    http://www.opencores.org/cores/mod_sim_exp/               ---- 
-- Last Modified:       18/06/2012 
----                                                              ---- 
-- 
----  Description                                                 ---- 
-- Description:         n-bit shift register with lsb output
----    1536 bit shift register with lsb output                   ----
--
----                                                              ---- 
--
----  Dependencies: none                                          ----
-- Dependencies:        none
----                                                              ----
--
----  Authors:                                                    ----
-- Revision:
----      - Geoffrey Ottoy, DraMCo research group                 ----
--      Revision 1.00 - Architecture
----      - Jonas De Craene, JonasDC@opencores.org                ---- 
--      Revision 0.01 - File Created
----                                                              ---- 
--
---------------------------------------------------------------------- 
--
----                                                              ---- 
------------------------------------------------------------------------------------
---- Copyright (C) 2011 DraMCo research group and OPENCORES.ORG   ---- 
--
----                                                              ---- 
-- NOTICE:
---- This source file may be used and distributed without         ---- 
--
---- restriction provided that this copyright statement is not    ---- 
-- Copyright DraMCo research group. 2011. This code may be contain portions patented
---- removed from the file and that any derivative work contains  ---- 
-- by other third parties!
---- the original copyright notice and the associated disclaimer. ---- 
--
----                                                              ---- 
------------------------------------------------------------------------------------
---- This source file is free software; you can redistribute it   ---- 
library IEEE;
---- and/or modify it under the terms of the GNU Lesser General   ---- 
use IEEE.STD_LOGIC_1164.ALL;
---- Public License as published by the Free Software Foundation; ---- 
use IEEE.STD_LOGIC_ARITH.ALL;
---- either version 2.1 of the License, or (at your option) any   ---- 
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- later version.                                               ---- 
 
----                                                              ---- 
---- Uncomment the following library declaration if instantiating
---- This source is distributed in the hope that it will be       ---- 
---- any Xilinx primitives in this code.
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ---- 
--library UNISIM;
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ---- 
--use UNISIM.VComponents.all;
---- PURPOSE.  See the GNU Lesser General Public License for more ---- 
 
---- details.                                                     ---- 
 
----                                                              ---- 
 
---- You should have received a copy of the GNU Lesser General    ---- 
 
---- Public License along with this source; if not, download it   ---- 
 
---- from http://www.opencores.org/lgpl.shtml                     ---- 
 
----                                                              ---- 
 
----------------------------------------------------------------------
 
 
 
library ieee;
 
use ieee.std_logic_1164.all;
 
use ieee.std_logic_arith.all;
 
use ieee.std_logic_unsigned.all;
 
 
 
 
entity x_shift_reg is
entity x_shift_reg is
        generic(  n : integer := 1536;
  generic(
 
    n  : integer := 1536;
                       t : integer := 48;
                       t : integer := 48;
                                tl : integer := 16
                                tl : integer := 16
        );
        );
        port(   clk : in  STD_LOGIC;
  port(
         reset : in  STD_LOGIC;
    clk    : in  std_logic;
          x_in : in  STD_LOGIC_VECTOR((n-1) downto 0);
    reset  : in  std_logic;
        load_x : in  STD_LOGIC;
    x_in   : in  std_logic_vector((n-1) downto 0);
        next_x : in  STD_LOGIC;
    load_x : in  std_logic;
                   p_sel : in  STD_LOGIC_VECTOR(1 downto 0);
    next_x : in  std_logic;
           x_i : out  STD_LOGIC
    p_sel  : in  std_logic_vector(1 downto 0);
 
    x_i    : out std_logic
        );
        );
end x_shift_reg;
end x_shift_reg;
 
 
 
 
architecture Behavioral of x_shift_reg is
architecture Behavioral of x_shift_reg is
        signal x_reg_i : std_logic_vector((n-1) downto 0); -- register
        signal x_reg_i : std_logic_vector((n-1) downto 0); -- register
        constant s : integer := n/t;   -- nr of stages
        constant s : integer := n/t;   -- nr of stages
        constant offset : integer := s*tl; -- calculate startbit pos of higher part of pipeline
        constant offset : integer := s*tl; -- calculate startbit pos of higher part of pipeline
begin
begin
Line 74... Line 90...
                x_i <= x_reg_i(offset) when "10",   -- use bit at offset for high part of pipeline
                x_i <= x_reg_i(offset) when "10",   -- use bit at offset for high part of pipeline
                                 x_reg_i(0) when others;    -- use LS bit for lower part of pipeline
                                 x_reg_i(0) when others;    -- use LS bit for lower part of pipeline
 
 
end Behavioral;
end Behavioral;
 
 
 
 
 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.