-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
-- Copyright (C) 2015
|
-- Copyright 2020
|
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
|
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
|
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
|
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
|
--
|
--
|
-- This program is free software: you can redistribute it and/or modify
|
-- Licensed under the Apache License, Version 2.0 (the "License");
|
-- it under the terms of the GNU General Public License as published by
|
-- you may not use this file except in compliance with the License.
|
-- the Free Software Foundation, either version 3 of the License, or
|
-- You may obtain a copy of the License at
|
-- (at your option) any later version.
|
|
--
|
--
|
-- This program is distributed in the hope that it will be useful,
|
-- http://www.apache.org/licenses/LICENSE-2.0
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
-- GNU General Public License for more details.
|
|
--
|
--
|
-- You should have received a copy of the GNU General Public License
|
-- Unless required by applicable law or agreed to in writing, software
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
-- distributed under the License is distributed on an "AS IS" BASIS,
|
|
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
-- See the License for the specific language governing permissions and
|
|
-- limitations under the License.
|
--
|
--
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
|
|
-- Purpose: Output frame busy control signal that is active from sop to eop
|
-- Purpose: Output frame busy control signal that is active from sop to eop
|
-- Description:
|
-- Description:
|
-- The busy is active during the entire frame from sop to eop, so busy
|
-- The busy is active during the entire frame from sop to eop, so busy
|
-- remains active in case valid goes low during a frame.
|
-- remains active in case valid goes low during a frame.
|
-- Default use g_pipeline=0 to have snk_in_busy in phase with sop and eop.
|
-- Default use g_pipeline=0 to have snk_in_busy in phase with sop and eop.
|
-- Use g_pipeline > 0 to register snk_in_busy to ease timing closure.
|
-- Use g_pipeline > 0 to register snk_in_busy to ease timing closure.
|
|
|
LIBRARY IEEE, common_pkg_lib, common_components_lib, dp_pkg_lib;
|
LIBRARY IEEE, common_pkg_lib, common_components_lib, dp_pkg_lib;
|
USE IEEE.std_logic_1164.ALL;
|
USE IEEE.std_logic_1164.ALL;
|
USE common_pkg_lib.common_pkg.ALL;
|
USE common_pkg_lib.common_pkg.ALL;
|
USE dp_pkg_lib.dp_stream_pkg.ALL;
|
USE dp_pkg_lib.dp_stream_pkg.ALL;
|
|
|
ENTITY dp_frame_busy IS
|
ENTITY dp_frame_busy IS
|
GENERIC (
|
GENERIC (
|
g_pipeline : NATURAL := 0
|
g_pipeline : NATURAL := 0
|
);
|
);
|
PORT (
|
PORT (
|
rst : IN STD_LOGIC;
|
rst : IN STD_LOGIC;
|
clk : IN STD_LOGIC;
|
clk : IN STD_LOGIC;
|
snk_in : IN t_dp_sosi;
|
snk_in : IN t_dp_sosi;
|
snk_in_busy : OUT STD_LOGIC
|
snk_in_busy : OUT STD_LOGIC
|
);
|
);
|
END dp_frame_busy;
|
END dp_frame_busy;
|
|
|
|
|
ARCHITECTURE str OF dp_frame_busy IS
|
ARCHITECTURE str OF dp_frame_busy IS
|
|
|
SIGNAL busy : STD_LOGIC;
|
SIGNAL busy : STD_LOGIC;
|
|
|
BEGIN
|
BEGIN
|
|
|
u_common_switch : ENTITY common_components_lib.common_switch
|
u_common_switch : ENTITY common_components_lib.common_switch
|
GENERIC MAP (
|
GENERIC MAP (
|
g_rst_level => '0', -- Defines the output level at reset.
|
g_rst_level => '0', -- Defines the output level at reset.
|
g_priority_lo => TRUE, -- When TRUE then input switch_low has priority, else switch_high. Don't care when switch_high and switch_low are pulses that do not occur simultaneously.
|
g_priority_lo => TRUE, -- When TRUE then input switch_low has priority, else switch_high. Don't care when switch_high and switch_low are pulses that do not occur simultaneously.
|
g_or_high => TRUE, -- When TRUE and priority hi then the registered switch_level is OR-ed with the input switch_high to get out_level, else out_level is the registered switch_level
|
g_or_high => TRUE, -- When TRUE and priority hi then the registered switch_level is OR-ed with the input switch_high to get out_level, else out_level is the registered switch_level
|
g_and_low => FALSE -- When TRUE and priority lo then the registered switch_level is AND-ed with the input switch_low to get out_level, else out_level is the registered switch_level
|
g_and_low => FALSE -- When TRUE and priority lo then the registered switch_level is AND-ed with the input switch_low to get out_level, else out_level is the registered switch_level
|
)
|
)
|
PORT MAP (
|
PORT MAP (
|
rst => rst,
|
rst => rst,
|
clk => clk,
|
clk => clk,
|
switch_high => snk_in.sop, -- A pulse on switch_high makes the out_level go high
|
switch_high => snk_in.sop, -- A pulse on switch_high makes the out_level go high
|
switch_low => snk_in.eop, -- A pulse on switch_low makes the out_level go low
|
switch_low => snk_in.eop, -- A pulse on switch_low makes the out_level go low
|
out_level => busy
|
out_level => busy
|
);
|
);
|
|
|
u_common_pipeline_sl : ENTITY common_components_lib.common_pipeline_sl
|
u_common_pipeline_sl : ENTITY common_components_lib.common_pipeline_sl
|
GENERIC MAP (
|
GENERIC MAP (
|
g_pipeline => g_pipeline, -- 0 for wires, > 0 for registers,
|
g_pipeline => g_pipeline, -- 0 for wires, > 0 for registers,
|
g_reset_value => 0, -- 0 or 1, bit reset value,
|
g_reset_value => 0, -- 0 or 1, bit reset value,
|
g_out_invert => FALSE
|
g_out_invert => FALSE
|
)
|
)
|
PORT MAP (
|
PORT MAP (
|
rst => rst,
|
rst => rst,
|
clk => clk,
|
clk => clk,
|
in_dat => busy,
|
in_dat => busy,
|
out_dat => snk_in_busy
|
out_dat => snk_in_busy
|
);
|
);
|
|
|
END str;
|
END str;
|
|
|