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 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 danv
-------------------------------------------------------------------------------
2
--
3 4 danv
-- Copyright 2020
4 3 danv
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
5
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
6 4 danv
-- 
7
-- Licensed under the Apache License, Version 2.0 (the "License");
8
-- you may not use this file except in compliance with the License.
9
-- You may obtain a copy of the License at
10
-- 
11
--     http://www.apache.org/licenses/LICENSE-2.0
12
-- 
13
-- Unless required by applicable law or agreed to in writing, software
14
-- distributed under the License is distributed on an "AS IS" BASIS,
15
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
-- See the License for the specific language governing permissions and
17
-- limitations under the License.
18 3 danv
--
19
-------------------------------------------------------------------------------
20
 
21
 
22
-- Purpose: Immediately apply reset and synchronously release it at rising clk
23
-- Description:
24
--   Using common_areset is equivalent to using common_async with same signal
25
--   applied to rst and din.
26
 
27
LIBRARY IEEE, common_pkg_lib;
28
USE IEEE.std_logic_1164.ALL;
29
USE common_pkg_lib.common_pkg.ALL;
30
 
31
ENTITY common_areset IS
32
  GENERIC (
33
    g_rst_level : STD_LOGIC := '1';
34
    g_delay_len : NATURAL   := c_meta_delay_len
35
  );
36
  PORT (
37
    in_rst    : IN  STD_LOGIC;
38
    clk       : IN  STD_LOGIC;
39
    out_rst   : OUT STD_LOGIC
40
  );
41
END;
42
 
43
 
44
ARCHITECTURE str OF common_areset IS
45
 
46
  CONSTANT c_rst_level_n : STD_LOGIC := NOT g_rst_level;
47
 
48
BEGIN
49
 
50
  -- When in_rst becomes g_rst_level then out_rst follows immediately (asynchronous reset apply).
51
  -- When in_rst becomes NOT g_rst_level then out_rst follows after g_delay_len cycles (synchronous reset release).
52
 
53
  -- This block can also synchronise other signals than reset:
54
  -- . g_rst_level = '0': output asynchronoulsy follows the falling edge input and synchronises the rising edge input.
55
  -- . g_rst_level = '1': output asynchronoulsy follows the rising edge input and synchronises the falling edge input.
56
 
57
  u_async : ENTITY work.common_async
58
  GENERIC MAP (
59
    g_rst_level => g_rst_level,
60
    g_delay_len => g_delay_len
61
  )
62
  PORT MAP (
63
    rst  => in_rst,
64
    clk  => clk,
65
    din  => c_rst_level_n,
66
    dout => out_rst
67
  );
68
 
69
END str;

powered by: WebSVN 2.1.0

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