----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
---- d_flip_flop ----
|
---- d_flip_flop ----
|
---- ----
|
---- ----
|
---- This file is part of the ----
|
---- This file is part of the ----
|
---- Modular Simultaneous Exponentiation Core project ----
|
---- Modular Simultaneous Exponentiation Core project ----
|
---- http://www.opencores.org/cores/mod_sim_exp/ ----
|
---- http://www.opencores.org/cores/mod_sim_exp/ ----
|
---- ----
|
---- ----
|
---- Description ----
|
---- Description ----
|
---- 1 bit D flip-flop currently still uses primitives ----
|
---- 1-bit D flip-flop implemented with behavorial (generic) ----
|
|
---- description. With asynchronous active high reset. ----
|
---- ----
|
---- ----
|
---- Dependencies: none ----
|
---- Dependencies: none ----
|
---- ----
|
---- ----
|
---- Authors: ----
|
---- Authors: ----
|
---- - Geoffrey Ottoy, DraMCo research group ----
|
---- - Geoffrey Ottoy, DraMCo research group ----
|
---- - Jonas De Craene, JonasDC@opencores.org ----
|
---- - Jonas De Craene, JonasDC@opencores.org ----
|
---- ----
|
---- ----
|
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
---- ----
|
---- ----
|
---- Copyright (C) 2011 DraMCo research group and OPENCORES.ORG ----
|
---- Copyright (C) 2011 DraMCo research group and OPENCORES.ORG ----
|
---- ----
|
---- ----
|
---- This source file may be used and distributed without ----
|
---- This source file may be used and distributed without ----
|
---- restriction provided that this copyright statement is not ----
|
---- restriction provided that this copyright statement is not ----
|
---- removed from the file and that any derivative work contains ----
|
---- removed from the file and that any derivative work contains ----
|
---- the original copyright notice and the associated disclaimer. ----
|
---- the original copyright notice and the associated disclaimer. ----
|
---- ----
|
---- ----
|
---- This source file is free software; you can redistribute it ----
|
---- This source file is free software; you can redistribute it ----
|
---- and/or modify it under the terms of the GNU Lesser General ----
|
---- and/or modify it under the terms of the GNU Lesser General ----
|
---- Public License as published by the Free Software Foundation; ----
|
---- Public License as published by the Free Software Foundation; ----
|
---- either version 2.1 of the License, or (at your option) any ----
|
---- either version 2.1 of the License, or (at your option) any ----
|
---- later version. ----
|
---- later version. ----
|
---- ----
|
---- ----
|
---- This source is distributed in the hope that it will be ----
|
---- This source is distributed in the hope that it will be ----
|
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
---- details. ----
|
---- details. ----
|
---- ----
|
---- ----
|
---- You should have received a copy of the GNU Lesser General ----
|
---- You should have received a copy of the GNU Lesser General ----
|
---- Public License along with this source; if not, download it ----
|
---- Public License along with this source; if not, download it ----
|
---- from http://www.opencores.org/lgpl.shtml ----
|
---- from http://www.opencores.org/lgpl.shtml ----
|
---- ----
|
---- ----
|
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_arith.all;
|
use ieee.std_logic_arith.all;
|
use ieee.std_logic_unsigned.all;
|
use ieee.std_logic_unsigned.all;
|
-- Xilinx primitives used
|
|
library unisim;
|
|
use unisim.vcomponents.all;
|
|
|
|
|
|
|
-- 1-bit D flip-flop with asynchronous active high reset
|
entity d_flip_flop is
|
entity d_flip_flop is
|
port(
|
port(
|
core_clk : in std_logic;
|
core_clk : in std_logic; -- clock signal
|
reset : in std_logic;
|
reset : in std_logic; -- active high reset
|
din : in std_logic;
|
din : in std_logic; -- data in
|
dout : out std_logic
|
dout : out std_logic -- data out
|
);
|
);
|
end d_flip_flop;
|
end d_flip_flop;
|
|
|
|
|
architecture Structural of d_flip_flop is
|
architecture Behavorial of d_flip_flop is
|
signal dout_i : std_logic;
|
|
begin
|
begin
|
|
|
dout <= dout_i;
|
-- process for 1-bit D flip-flop
|
|
d_FF : process (reset, core_clk, din)
|
FDCE_inst : FDCE
|
begin
|
generic map (
|
if reset='1' then -- asynchronous active high reset
|
INIT => '0') -- Initial value of latch ('0' or '1')
|
dout <= '0';
|
port map (
|
else
|
Q => dout_i, -- Data output
|
if rising_edge(core_clk) then -- clock in data on rising edge
|
CLR => reset, -- Asynchronous clear/reset input
|
dout <= din;
|
D => din, -- Data input
|
end if;
|
C => core_clk, -- Gate input
|
end if;
|
CE => '1' -- Gate enable input
|
end process;
|
);
|
|
|
|
end Structural;
|
end Behavorial;
|
|
|
No newline at end of file
|
No newline at end of file
|