Skip to content
Snippets Groups Projects
Commit 6e262dac authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Use separate g_in_rst_level.

parent ef076bc5
Branches
No related tags found
1 merge request!171Resolve L2SDP-538
...@@ -19,11 +19,18 @@ ...@@ -19,11 +19,18 @@
-- --
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- Author: E. Kooistra
-- Purpose: Immediately apply reset and synchronously release it at rising clk -- Purpose: Immediately apply reset and synchronously release it at rising clk
-- Description: -- Description:
-- Using common_areset is equivalent to using common_async with same signal -- When in_rst gets asserted, then the out_rst gets asserted immediately (= asynchronous reset apply).
-- applied to rst and din. -- When in_rst gets de-assered, then out_rst gets de-asserted after g_delay_len cycles (= synchronous reset release).
--
-- The in_rst assert level is set by g_in_rst_level.
-- The out_rst assert level is set by c_out_rst_level = g_rst_level.
--
-- Remarks:
-- . The in_rst can also synchronise other signals than a reset, e.g. a locked signal from a PLL.
LIBRARY IEEE; LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL; USE IEEE.std_logic_1164.ALL;
...@@ -31,7 +38,9 @@ USE work.common_pkg.ALL; ...@@ -31,7 +38,9 @@ USE work.common_pkg.ALL;
ENTITY common_areset IS ENTITY common_areset IS
GENERIC ( GENERIC (
g_rst_level : STD_LOGIC := '1'; g_in_rst_level : STD_LOGIC := '1'; -- = in_rst level
g_rst_level : STD_LOGIC := '1'; -- = out_rst level (keep original generic
-- name for backward compatibility)
g_delay_len : NATURAL := c_meta_delay_len g_delay_len : NATURAL := c_meta_delay_len
); );
PORT ( PORT (
...@@ -44,27 +53,24 @@ END; ...@@ -44,27 +53,24 @@ END;
ARCHITECTURE str OF common_areset IS ARCHITECTURE str OF common_areset IS
CONSTANT c_rst_level_n : STD_LOGIC := NOT g_rst_level; CONSTANT c_out_rst_level : STD_LOGIC := g_rst_level;
CONSTANT c_out_rst_level_n : STD_LOGIC := NOT g_rst_level;
SIGNAL i_rst : STD_LOGIC; SIGNAL i_rst : STD_LOGIC;
BEGIN
-- When in_rst becomes g_rst_level then out_rst follows immediately (asynchronous reset apply). BEGIN
-- When in_rst becomes NOT g_rst_level then out_rst follows after g_delay_len cycles (synchronous reset release).
-- This block can also synchronise other signals than reset: i_rst <= in_rst WHEN g_in_rst_level = '1' ELSE NOT in_rst;
-- . g_rst_level = '0': output asynchronoulsy follows the falling edge input and synchronises the rising edge input.
-- . g_rst_level = '1': output asynchronoulsy follows the rising edge input and synchronises the falling edge input.
i_rst <= NOT in_rst WHEN g_rst_level = '0' ELSE in_rst;
u_async : ENTITY work.common_async u_async : ENTITY work.common_async
GENERIC MAP ( GENERIC MAP (
g_rst_level => g_rst_level, g_rst_level => c_out_rst_level,
g_delay_len => g_delay_len g_delay_len => g_delay_len
) )
PORT MAP ( PORT MAP (
rst => i_rst, rst => i_rst,
clk => clk, clk => clk,
din => c_rst_level_n, din => c_out_rst_level_n,
dout => out_rst dout => out_rst
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment