1 |
2 |
danv |
-------------------------------------------------------------------------------
|
2 |
|
|
--
|
3 |
3 |
danv |
-- Copyright 2020
|
4 |
2 |
danv |
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
|
5 |
|
|
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
|
6 |
3 |
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 |
2 |
danv |
--
|
19 |
|
|
-------------------------------------------------------------------------------
|
20 |
|
|
|
21 |
|
|
-- Purpose: Output frame busy control signal that is active from sop to eop
|
22 |
|
|
-- Description:
|
23 |
|
|
-- The busy is active during the entire frame from sop to eop, so busy
|
24 |
|
|
-- remains active in case valid goes low during a frame.
|
25 |
|
|
-- Default use g_pipeline=0 to have snk_in_busy in phase with sop and eop.
|
26 |
|
|
-- Use g_pipeline > 0 to register snk_in_busy to ease timing closure.
|
27 |
|
|
|
28 |
|
|
LIBRARY IEEE, common_pkg_lib, common_components_lib, dp_pkg_lib;
|
29 |
|
|
USE IEEE.std_logic_1164.ALL;
|
30 |
|
|
USE common_pkg_lib.common_pkg.ALL;
|
31 |
|
|
USE dp_pkg_lib.dp_stream_pkg.ALL;
|
32 |
|
|
|
33 |
|
|
ENTITY dp_frame_busy IS
|
34 |
|
|
GENERIC (
|
35 |
|
|
g_pipeline : NATURAL := 0
|
36 |
|
|
);
|
37 |
|
|
PORT (
|
38 |
|
|
rst : IN STD_LOGIC;
|
39 |
|
|
clk : IN STD_LOGIC;
|
40 |
|
|
snk_in : IN t_dp_sosi;
|
41 |
|
|
snk_in_busy : OUT STD_LOGIC
|
42 |
|
|
);
|
43 |
|
|
END dp_frame_busy;
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
ARCHITECTURE str OF dp_frame_busy IS
|
47 |
|
|
|
48 |
|
|
SIGNAL busy : STD_LOGIC;
|
49 |
|
|
|
50 |
|
|
BEGIN
|
51 |
|
|
|
52 |
|
|
u_common_switch : ENTITY common_components_lib.common_switch
|
53 |
|
|
GENERIC MAP (
|
54 |
|
|
g_rst_level => '0', -- Defines the output level at reset.
|
55 |
|
|
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.
|
56 |
|
|
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
|
57 |
|
|
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
|
58 |
|
|
)
|
59 |
|
|
PORT MAP (
|
60 |
|
|
rst => rst,
|
61 |
|
|
clk => clk,
|
62 |
|
|
switch_high => snk_in.sop, -- A pulse on switch_high makes the out_level go high
|
63 |
|
|
switch_low => snk_in.eop, -- A pulse on switch_low makes the out_level go low
|
64 |
|
|
out_level => busy
|
65 |
|
|
);
|
66 |
|
|
|
67 |
|
|
u_common_pipeline_sl : ENTITY common_components_lib.common_pipeline_sl
|
68 |
|
|
GENERIC MAP (
|
69 |
|
|
g_pipeline => g_pipeline, -- 0 for wires, > 0 for registers,
|
70 |
|
|
g_reset_value => 0, -- 0 or 1, bit reset value,
|
71 |
|
|
g_out_invert => FALSE
|
72 |
|
|
)
|
73 |
|
|
PORT MAP (
|
74 |
|
|
rst => rst,
|
75 |
|
|
clk => clk,
|
76 |
|
|
in_dat => busy,
|
77 |
|
|
out_dat => snk_in_busy
|
78 |
|
|
);
|
79 |
|
|
|
80 |
|
|
END str;
|