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

Subversion Repositories astron_fifo

[/] [astron_fifo/] [trunk/] [dp_fifo_dc.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) 2014
4
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
5
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
6
--
7
-- This program is free software: you can redistribute it and/or modify
8
-- it under the terms of the GNU General Public License as published by
9
-- the Free Software Foundation, either version 3 of the License, or
10
-- (at your option) any later version.
11
--
12
-- This program is distributed in the hope that it will be useful,
13
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
-- GNU General Public License for more details.
16
--
17
-- You should have received a copy of the GNU General Public License
18
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
--
20
--------------------------------------------------------------------------------
21
 
22
-- Purpose: DP FIFO for dual clock (= dc) domain wr and rd.
23
-- Description: See dp_fifo_core.vhd.
24
 
25
LIBRARY IEEE, common_pkg_lib, dp_pkg_lib, technology_lib;
26
USE IEEE.std_logic_1164.ALL;
27
USE IEEE.numeric_std.ALL;
28
USE common_pkg_lib.common_pkg.ALL;
29
USE dp_pkg_lib.dp_stream_pkg.ALL;
30
USE technology_lib.technology_select_pkg.ALL;
31
 
32
ENTITY dp_fifo_dc IS
33
  GENERIC (
34
    g_technology     : NATURAL := c_tech_select_default;
35
    g_data_w         : NATURAL := 16; -- Should be 2 times the c_complex_w if g_use_complex = TRUE
36
    g_bsn_w          : NATURAL := 1;
37
    g_empty_w        : NATURAL := 1;
38
    g_channel_w      : NATURAL := 1;
39
    g_error_w        : NATURAL := 1;
40
    g_use_bsn        : BOOLEAN := FALSE;
41
    g_use_empty      : BOOLEAN := FALSE;
42
    g_use_channel    : BOOLEAN := FALSE;
43
    g_use_error      : BOOLEAN := FALSE;
44
    g_use_sync       : BOOLEAN := FALSE;
45
    g_use_ctrl       : BOOLEAN := TRUE;  -- sop & eop
46
    g_use_complex    : BOOLEAN := FALSE; -- TRUE feeds the concatenated complex fields (im & re) through the FIFO instead of the data field.
47
    g_fifo_size      : NATURAL := 512;   -- (16+2) * 512 = 1 M9K, g_data_w+2 for sop and eop
48
    g_fifo_af_margin : NATURAL := 4;     -- >=4, Nof words below max (full) at which fifo is considered almost full
49
    g_fifo_rl        : NATURAL := 1
50
  );
51
  PORT (
52
    wr_rst      : IN  STD_LOGIC;
53
    wr_clk      : IN  STD_LOGIC;
54
    rd_rst      : IN  STD_LOGIC;
55
    rd_clk      : IN  STD_LOGIC;
56
    -- Monitor FIFO filling
57
    wr_ful      : OUT STD_LOGIC;
58
    wr_usedw    : OUT STD_LOGIC_VECTOR(ceil_log2(g_fifo_size)-1 DOWNTO 0);
59
    rd_usedw    : OUT STD_LOGIC_VECTOR(ceil_log2(g_fifo_size)-1 DOWNTO 0);
60
    rd_emp      : OUT STD_LOGIC;
61
    -- ST sink
62
    snk_out     : OUT t_dp_siso;
63
    snk_in      : IN  t_dp_sosi;
64
    -- ST source
65
    src_in      : IN  t_dp_siso;
66
    src_out     : OUT t_dp_sosi
67
  );
68
END dp_fifo_dc;
69
 
70
 
71
ARCHITECTURE str OF dp_fifo_dc IS
72
BEGIN
73
 
74
  u_dp_fifo_core : ENTITY work.dp_fifo_core
75
  GENERIC MAP (
76
    g_technology     => g_technology,
77
    g_use_dual_clock => TRUE,
78
    g_data_w         => g_data_w,
79
    g_bsn_w          => g_bsn_w,
80
    g_empty_w        => g_empty_w,
81
    g_channel_w      => g_channel_w,
82
    g_error_w        => g_error_w,
83
    g_use_bsn        => g_use_bsn,
84
    g_use_empty      => g_use_empty,
85
    g_use_channel    => g_use_channel,
86
    g_use_error      => g_use_error,
87
    g_use_sync       => g_use_sync,
88
    g_use_ctrl       => g_use_ctrl,
89
    g_use_complex    => g_use_complex,
90
    g_fifo_size      => g_fifo_size,
91
    g_fifo_af_margin => g_fifo_af_margin,
92
    g_fifo_rl        => g_fifo_rl
93
  )
94
  PORT MAP (
95
    wr_rst      => wr_rst,
96
    wr_clk      => wr_clk,
97
    rd_rst      => rd_rst,
98
    rd_clk      => rd_clk,
99
    -- Monitor FIFO filling
100
    wr_ful      => wr_ful,
101
    wr_usedw    => wr_usedw,
102
    rd_usedw    => rd_usedw,
103
    rd_emp      => rd_emp,
104
    -- ST sink
105
    snk_out     => snk_out,
106
    snk_in      => snk_in,
107
    -- ST source
108
    src_in      => src_in,
109
    src_out     => src_out
110
  );
111
 
112
END str;

powered by: WebSVN 2.1.0

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