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 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
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: DP FIFO for dual clock (= dc) domain wr and rd.
22
-- Description: See dp_fifo_core.vhd.
23
 
24 4 danv
LIBRARY IEEE, common_pkg_lib, dp_pkg_lib;
25 2 danv
USE IEEE.std_logic_1164.ALL;
26
USE IEEE.numeric_std.ALL;
27
USE common_pkg_lib.common_pkg.ALL;
28
USE dp_pkg_lib.dp_stream_pkg.ALL;
29 4 danv
--USE technology_lib.technology_select_pkg.ALL;
30 2 danv
 
31
ENTITY dp_fifo_dc IS
32
  GENERIC (
33 4 danv
    g_technology     : NATURAL := 0;
34 2 danv
    g_data_w         : NATURAL := 16; -- Should be 2 times the c_complex_w if g_use_complex = TRUE
35
    g_bsn_w          : NATURAL := 1;
36
    g_empty_w        : NATURAL := 1;
37
    g_channel_w      : NATURAL := 1;
38
    g_error_w        : NATURAL := 1;
39
    g_use_bsn        : BOOLEAN := FALSE;
40
    g_use_empty      : BOOLEAN := FALSE;
41
    g_use_channel    : BOOLEAN := FALSE;
42
    g_use_error      : BOOLEAN := FALSE;
43
    g_use_sync       : BOOLEAN := FALSE;
44
    g_use_ctrl       : BOOLEAN := TRUE;  -- sop & eop
45
    g_use_complex    : BOOLEAN := FALSE; -- TRUE feeds the concatenated complex fields (im & re) through the FIFO instead of the data field.
46
    g_fifo_size      : NATURAL := 512;   -- (16+2) * 512 = 1 M9K, g_data_w+2 for sop and eop
47
    g_fifo_af_margin : NATURAL := 4;     -- >=4, Nof words below max (full) at which fifo is considered almost full
48
    g_fifo_rl        : NATURAL := 1
49
  );
50
  PORT (
51
    wr_rst      : IN  STD_LOGIC;
52
    wr_clk      : IN  STD_LOGIC;
53
    rd_rst      : IN  STD_LOGIC;
54
    rd_clk      : IN  STD_LOGIC;
55
    -- Monitor FIFO filling
56
    wr_ful      : OUT STD_LOGIC;
57
    wr_usedw    : OUT STD_LOGIC_VECTOR(ceil_log2(g_fifo_size)-1 DOWNTO 0);
58
    rd_usedw    : OUT STD_LOGIC_VECTOR(ceil_log2(g_fifo_size)-1 DOWNTO 0);
59
    rd_emp      : OUT STD_LOGIC;
60
    -- ST sink
61
    snk_out     : OUT t_dp_siso;
62
    snk_in      : IN  t_dp_sosi;
63
    -- ST source
64
    src_in      : IN  t_dp_siso;
65
    src_out     : OUT t_dp_sosi
66
  );
67
END dp_fifo_dc;
68
 
69
 
70
ARCHITECTURE str OF dp_fifo_dc IS
71
BEGIN
72
 
73
  u_dp_fifo_core : ENTITY work.dp_fifo_core
74
  GENERIC MAP (
75
    g_technology     => g_technology,
76
    g_use_dual_clock => TRUE,
77
    g_data_w         => g_data_w,
78
    g_bsn_w          => g_bsn_w,
79
    g_empty_w        => g_empty_w,
80
    g_channel_w      => g_channel_w,
81
    g_error_w        => g_error_w,
82
    g_use_bsn        => g_use_bsn,
83
    g_use_empty      => g_use_empty,
84
    g_use_channel    => g_use_channel,
85
    g_use_error      => g_use_error,
86
    g_use_sync       => g_use_sync,
87
    g_use_ctrl       => g_use_ctrl,
88
    g_use_complex    => g_use_complex,
89
    g_fifo_size      => g_fifo_size,
90
    g_fifo_af_margin => g_fifo_af_margin,
91
    g_fifo_rl        => g_fifo_rl
92
  )
93
  PORT MAP (
94
    wr_rst      => wr_rst,
95
    wr_clk      => wr_clk,
96
    rd_rst      => rd_rst,
97
    rd_clk      => rd_clk,
98
    -- Monitor FIFO filling
99
    wr_ful      => wr_ful,
100
    wr_usedw    => wr_usedw,
101
    rd_usedw    => rd_usedw,
102
    rd_emp      => rd_emp,
103
    -- ST sink
104
    snk_out     => snk_out,
105
    snk_in      => snk_in,
106
    -- ST source
107
    src_in      => src_in,
108
    src_out     => src_out
109
  );
110
 
111
END str;

powered by: WebSVN 2.1.0

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