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/] [register_n.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...
------------------------------------------------------------------------------------ 
----------------------------------------------------------------------  
--                      
----  register_n                                                  ---- 
-- Geoffrey Ottoy - DraMCo research group
----                                                              ---- 
--
----  This file is part of the                                    ----
-- Module Name: register_n.vhd / entity register_n
----    Modular Simultaneous Exponentiation Core project          ---- 
-- 
----    http://www.opencores.org/cores/mod_sim_exp/               ---- 
-- Last Modified:       24/11/2011 
----                                                              ---- 
-- 
----  Description                                                 ---- 
-- Description:         n bit register
----    n bit register                                            ----
--
----    used in montgommery multiplier systolic array stages      ----            
--
----                                                              ---- 
-- Dependencies:        FDCE
----  Dependencies: none                                          ----
--
----                                                              ----
-- Revision:
----  Authors:                                                    ----
-- Revision 3.00 - Replaced LDCE primitive with FDCE primitive
----      - Geoffrey Ottoy, DraMCo research group                 ----
-- Revision 2.00 - Replaced behavioral architecture with structural using FPGA
----      - Jonas De Craene, JonasDC@opencores.org                ---- 
--                 primitives.
----                                                              ---- 
--      Revision 1.00 - Architecture
---------------------------------------------------------------------- 
--      Revision 0.01 - File Created
----                                                              ---- 
--
---- Copyright (C) 2011 DraMCo research group and OPENCORES.ORG   ---- 
--
----                                                              ---- 
------------------------------------------------------------------------------------
---- This source file may be used and distributed without         ---- 
--
---- restriction provided that this copyright statement is not    ---- 
-- NOTICE:
---- removed from the file and that any derivative work contains  ---- 
--
---- the original copyright notice and the associated disclaimer. ---- 
-- Copyright DraMCo research group. 2011. This code may be contain portions patented
----                                                              ---- 
-- by other third parties!
---- This source file is free software; you can redistribute it   ---- 
--
---- and/or modify it under the terms of the GNU Lesser General   ---- 
------------------------------------------------------------------------------------
---- Public License as published by the Free Software Foundation; ---- 
library IEEE;
---- either version 2.1 of the License, or (at your option) any   ---- 
use IEEE.STD_LOGIC_1164.ALL;
---- later version.                                               ---- 
use IEEE.STD_LOGIC_ARITH.ALL;
----                                                              ---- 
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- This source is distributed in the hope that it will be       ---- 
 
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ---- 
 
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ---- 
 
---- 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;
 
 
---- Uncomment the following library declaration if instantiating
-- Xilinx primitives used
---- any Xilinx primitives in this code.
 
library UNISIM;
library UNISIM;
use UNISIM.VComponents.all;
use UNISIM.VComponents.all;
 
 
 
 
entity register_n is
entity register_n is
        generic( n : integer := 4
  generic(
 
    n : integer := 4
        );
        );
   port(core_clk : in  STD_LOGIC;
  port(
                             ce : in  STD_LOGIC;
    core_clk : in  std_logic;
                          reset : in  STD_LOGIC;
    ce       : in  std_logic;
                            din : in  STD_LOGIC_VECTOR((n-1) downto 0);
    reset    : in  std_logic;
                      dout : out STD_LOGIC_VECTOR((n-1) downto 0)
    din      : in  std_logic_vector((n-1) downto 0);
 
    dout     : out std_logic_vector((n-1) downto 0)
        );
        );
end register_n;
end register_n;
 
 
 
 
architecture Structural of register_n is
architecture Structural of register_n is
        signal dout_i : std_logic_vector((n-1) downto 0) := (others => '0');
        signal dout_i : std_logic_vector((n-1) downto 0) := (others => '0');
begin
begin
 
 
        dout <= dout_i;
        dout <= dout_i;
 
 
        N_REGS: for i in 0 to n-1 generate
        N_REGS: for i in 0 to n-1 generate
                FDCE_inst : FDCE
                FDCE_inst : FDCE
                generic map (
                generic map (
                        INIT => '0')     -- Initial value of latch ('0' or '1')  
      INIT => '0'       -- Initial value of latch ('0' or '1')
 
    )
                port map (
                port map (
                        Q => dout_i(i),  -- Data output
                        Q => dout_i(i),  -- Data output
                        CLR => reset,    -- Asynchronous clear/reset input
                        CLR => reset,    -- Asynchronous clear/reset input
                        D => din(i),     -- Data input
                        D => din(i),     -- Data input
                        C => core_clk,   -- Gate input
                        C => core_clk,   -- Gate input
                        CE => ce         -- Gate enable input
                        CE => ce         -- Gate enable input
                );
                );
        end generate;
        end generate;
 
 
 
 
end Structural;
end Structural;
 No newline at end of file
 No newline at end of file
 
 
 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.