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

Subversion Repositories astron_fifo

[/] [astron_fifo/] [trunk/] [dp_fifo_sc.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 single clock (= sc) 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_sc IS
32
  GENERIC (
33 4 danv
    g_technology     : NATURAL := 0;
34 2 danv
    g_note_is_ful    : BOOLEAN := TRUE;   -- when TRUE report NOTE when FIFO goes full, fifo overflow is always reported as FAILURE
35
    g_use_lut        : BOOLEAN := FALSE;  -- when TRUE then force using LUTs instead of block RAM
36
    g_data_w         : NATURAL := 16; -- Should be 2 times the c_complex_w if g_use_complex = TRUE
37
    g_bsn_w          : NATURAL := 1;
38
    g_empty_w        : NATURAL := 1;
39
    g_channel_w      : NATURAL := 1;
40
    g_error_w        : NATURAL := 1;
41
    g_use_bsn        : BOOLEAN := FALSE;
42
    g_use_empty      : BOOLEAN := FALSE;
43
    g_use_channel    : BOOLEAN := FALSE;
44
    g_use_error      : BOOLEAN := FALSE;
45
    g_use_sync       : BOOLEAN := FALSE;
46
    g_use_ctrl       : BOOLEAN := TRUE;  -- sop & eop
47
    g_use_complex    : BOOLEAN := FALSE; -- TRUE feeds the concatenated complex fields (im & re) through the FIFO instead of the data field.
48
    g_fifo_size      : NATURAL := 512;   -- (16+2) * 512 = 1 M9K, g_data_w+2 for sop and eop
49
    g_fifo_af_margin : NATURAL := 4;     -- >=4, Nof words below max (full) at which fifo is considered almost full
50
    g_fifo_rl        : NATURAL := 1
51
  );
52
  PORT (
53
    rst         : IN  STD_LOGIC;
54
    clk         : IN  STD_LOGIC;
55
    -- Monitor FIFO filling
56
    wr_ful      : OUT STD_LOGIC;
57
    usedw       : OUT STD_LOGIC_VECTOR(ceil_log2(g_fifo_size)-1 DOWNTO 0);
58
    rd_emp      : OUT STD_LOGIC;
59
    -- ST sink
60
    snk_out     : OUT t_dp_siso;
61
    snk_in      : IN  t_dp_sosi;
62
    -- ST source
63
    src_in      : IN  t_dp_siso;
64
    src_out     : OUT t_dp_sosi
65
  );
66
END dp_fifo_sc;
67
 
68
 
69
ARCHITECTURE str OF dp_fifo_sc IS
70
BEGIN
71
 
72
  u_dp_fifo_core : ENTITY work.dp_fifo_core
73
  GENERIC MAP (
74
    g_technology     => g_technology,
75
    g_note_is_ful    => g_note_is_ful,
76
    g_use_dual_clock => FALSE,
77
    g_use_lut_sc     => g_use_lut,
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      => rst,
96
    wr_clk      => clk,
97
    rd_rst      => rst,
98
    rd_clk      => clk,
99
    -- Monitor FIFO filling
100
    wr_ful      => wr_ful,
101
    wr_usedw    => OPEN,
102
    rd_usedw    => 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.