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

Subversion Repositories common_components

[/] [common_components/] [trunk/] [common_areset.vhd] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 danv
-------------------------------------------------------------------------------
2
--
3
-- Copyright (C) 2009
4
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
5
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
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 3 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, see <http://www.gnu.org/licenses/>.
19
--
20
-------------------------------------------------------------------------------
21
 
22
 
23
-- Purpose: Immediately apply reset and synchronously release it at rising clk
24
-- Description:
25
--   Using common_areset is equivalent to using common_async with same signal
26
--   applied to rst and din.
27
 
28
LIBRARY IEEE, common_pkg_lib;
29
USE IEEE.std_logic_1164.ALL;
30
USE common_pkg_lib.common_pkg.ALL;
31
 
32
ENTITY common_areset IS
33
  GENERIC (
34
    g_rst_level : STD_LOGIC := '1';
35
    g_delay_len : NATURAL   := c_meta_delay_len
36
  );
37
  PORT (
38
    in_rst    : IN  STD_LOGIC;
39
    clk       : IN  STD_LOGIC;
40
    out_rst   : OUT STD_LOGIC
41
  );
42
END;
43
 
44
 
45
ARCHITECTURE str OF common_areset IS
46
 
47
  CONSTANT c_rst_level_n : STD_LOGIC := NOT g_rst_level;
48
 
49
BEGIN
50
 
51
  -- When in_rst becomes g_rst_level then out_rst follows immediately (asynchronous reset apply).
52
  -- When in_rst becomes NOT g_rst_level then out_rst follows after g_delay_len cycles (synchronous reset release).
53
 
54
  -- This block can also synchronise other signals than reset:
55
  -- . g_rst_level = '0': output asynchronoulsy follows the falling edge input and synchronises the rising edge input.
56
  -- . g_rst_level = '1': output asynchronoulsy follows the rising edge input and synchronises the falling edge input.
57
 
58
  u_async : ENTITY work.common_async
59
  GENERIC MAP (
60
    g_rst_level => g_rst_level,
61
    g_delay_len => g_delay_len
62
  )
63
  PORT MAP (
64
    rst  => in_rst,
65
    clk  => clk,
66
    din  => c_rst_level_n,
67
    dout => out_rst
68
  );
69
 
70
END str;

powered by: WebSVN 2.1.0

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