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

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [lib/] [gaisler/] [misc/] [rstgen.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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