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

Subversion Repositories dp_components

[/] [dp_components/] [trunk/] [dp_hold_ctrl.vhd] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 danv
-------------------------------------------------------------------------------
2
--
3
-- Copyright (C) 2010
4
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
5
-- JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>
6
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
7
--
8
-- This program is free software: you can redistribute it and/or modify
9
-- it under the terms of the GNU General Public License as published by
10
-- the Free Software Foundation, either version 3 of the License, or
11
-- (at your option) any later version.
12
--
13
-- This program is distributed in the hope that it will be useful,
14
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
-- GNU General Public License for more details.
17
--
18
-- You should have received a copy of the GNU General Public License
19
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
--
21
-------------------------------------------------------------------------------
22
 
23
LIBRARY IEEE, common_components_lib;
24
USE IEEE.std_logic_1164.all;
25
 
26
-- Purpose:
27
--   Hold hld_ctrl active until next ready high when in_ctrl is active while
28
--   ready went low
29
-- Description:
30
--   When ready goes low there may still arrive one new valid data. The control
31
--   information for this data can then be held with this component. When ready
32
--   goes high again the held data can then be output and the hld_ctrl is 
33
--   released. After that the subsequent data output can come directly from the
34
--   up stream source, until ready goes low again.
35
-- Remarks:
36
-- . Ready latency RL = 1
37
-- . The in_ctrl is typically in_valid, in_sop or in_eop
38
-- . Typically used together with dp_hold_data
39
 
40
ENTITY dp_hold_ctrl IS
41
  PORT (
42
    rst      : IN  STD_LOGIC;
43
    clk      : IN  STD_LOGIC;
44
    ready    : IN  STD_LOGIC;
45
    in_ctrl  : IN  STD_LOGIC;
46
    hld_ctrl : OUT STD_LOGIC
47
  );
48
END dp_hold_ctrl;
49
 
50
 
51
ARCHITECTURE rtl OF dp_hold_ctrl IS
52
 
53
  SIGNAL hi_ctrl : STD_LOGIC;
54
  SIGNAL lo_ctrl : STD_LOGIC;
55
 
56
BEGIN
57
 
58
  hi_ctrl <=     in_ctrl AND NOT ready;  -- capture
59
  lo_ctrl <= NOT in_ctrl AND     ready;  -- release
60
 
61
  u_hld_ctrl : ENTITY common_components_lib.common_switch
62
  PORT MAP (
63
    rst         => rst,
64
    clk         => clk,
65
    switch_high => hi_ctrl,
66
    switch_low  => lo_ctrl,
67
    out_level   => hld_ctrl
68
  );
69
 
70
END rtl;

powered by: WebSVN 2.1.0

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