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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [rtl/] [ethlib/] [eth_rstgen.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 sergeykhbr
------------------------------------------------------------------------------
2
--  This file is a part of the GRLIB VHDL IP LIBRARY
3
--  Copyright (C) 2003 - 2008, Gaisler Research
4
--  Copyright (C) 2008 - 2014, Aeroflex Gaisler
5
--  Copyright (C) 2015 - 2016, Cobham Gaisler
6
--
7
--  This program is free software; you can redistribute it and/or modify
8
--  it under the terms of the GNU General Public License as published by
9
--  the Free Software Foundation; either version 2 of the License, or
10
--  (at your option) any later version.
11
--
12
--  This program is distributed in the hope that it will be useful,
13
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
--  GNU General Public License for more details.
16
--
17
--  You should have received a copy of the GNU General Public License
18
--  along with this program; if not, write to the Free Software
19
--  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
20
-----------------------------------------------------------------------------
21
-- Entity:      eth_rstgen
22
-- File:        eth_rstgen.vhd
23
-- Author:      Jiri Gaisler - Gaisler Research
24
-- Description: Reset generation with glitch filter
25
------------------------------------------------------------------------------
26
 
27
library ieee;
28
use ieee.std_logic_1164.all;
29
 
30
entity eth_rstgen is
31
  generic (acthigh : integer := 0);
32
  port (
33
    rstin     : in  std_ulogic;
34
    clk       : in  std_ulogic;
35
    clklock   : in  std_ulogic;
36
    rstout    : out std_ulogic;
37
    rstoutraw : out std_ulogic
38
  );
39
end;
40
 
41
architecture rtl of eth_rstgen is
42
signal r : std_logic_vector(4 downto 0);
43
signal rst : std_ulogic;
44
 
45
attribute equivalent_register_removal : string;
46
attribute keep                        : string;
47
 
48
attribute equivalent_register_removal of r : signal is "no";
49
attribute equivalent_register_removal of rst : signal is "no";
50
 
51
attribute keep of r : signal is "true";
52
attribute keep of rst : signal is "true";
53
 
54
begin
55
 
56
  rst <= not rstin when acthigh = 1 else rstin;
57
  rstoutraw <= rst;
58
 
59
  reg1 : process (clk, rst) begin
60
    if rising_edge(clk) then
61
      r <= r(3 downto 0) & clklock;
62
      rstout <= r(4) and r(3) and r(2);
63
    end if;
64
    if rst = '0' then r <= "00000"; rstout <= '0'; end if;
65
  end process;
66
 
67
end;
68
 

powered by: WebSVN 2.1.0

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