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 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 single clock (= sc) 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_sc IS
33
  GENERIC (
34
    g_technology     : NATURAL := c_tech_select_default;
35
    g_note_is_ful    : BOOLEAN := TRUE;   -- when TRUE report NOTE when FIFO goes full, fifo overflow is always reported as FAILURE
36
    g_use_lut        : BOOLEAN := FALSE;  -- when TRUE then force using LUTs instead of block RAM
37
    g_data_w         : NATURAL := 16; -- Should be 2 times the c_complex_w if g_use_complex = TRUE
38
    g_bsn_w          : NATURAL := 1;
39
    g_empty_w        : NATURAL := 1;
40
    g_channel_w      : NATURAL := 1;
41
    g_error_w        : NATURAL := 1;
42
    g_use_bsn        : BOOLEAN := FALSE;
43
    g_use_empty      : BOOLEAN := FALSE;
44
    g_use_channel    : BOOLEAN := FALSE;
45
    g_use_error      : BOOLEAN := FALSE;
46
    g_use_sync       : BOOLEAN := FALSE;
47
    g_use_ctrl       : BOOLEAN := TRUE;  -- sop & eop
48
    g_use_complex    : BOOLEAN := FALSE; -- TRUE feeds the concatenated complex fields (im & re) through the FIFO instead of the data field.
49
    g_fifo_size      : NATURAL := 512;   -- (16+2) * 512 = 1 M9K, g_data_w+2 for sop and eop
50
    g_fifo_af_margin : NATURAL := 4;     -- >=4, Nof words below max (full) at which fifo is considered almost full
51
    g_fifo_rl        : NATURAL := 1
52
  );
53
  PORT (
54
    rst         : IN  STD_LOGIC;
55
    clk         : IN  STD_LOGIC;
56
    -- Monitor FIFO filling
57
    wr_ful      : OUT STD_LOGIC;
58
    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_sc;
68
 
69
 
70
ARCHITECTURE str OF dp_fifo_sc IS
71
BEGIN
72
 
73
  u_dp_fifo_core : ENTITY work.dp_fifo_core
74
  GENERIC MAP (
75
    g_technology     => g_technology,
76
    g_note_is_ful    => g_note_is_ful,
77
    g_use_dual_clock => FALSE,
78
    g_use_lut_sc     => g_use_lut,
79
    g_data_w         => g_data_w,
80
    g_bsn_w          => g_bsn_w,
81
    g_empty_w        => g_empty_w,
82
    g_channel_w      => g_channel_w,
83
    g_error_w        => g_error_w,
84
    g_use_bsn        => g_use_bsn,
85
    g_use_empty      => g_use_empty,
86
    g_use_channel    => g_use_channel,
87
    g_use_error      => g_use_error,
88
    g_use_sync       => g_use_sync,
89
    g_use_ctrl       => g_use_ctrl,
90
    g_use_complex    => g_use_complex,
91
    g_fifo_size      => g_fifo_size,
92
    g_fifo_af_margin => g_fifo_af_margin,
93
    g_fifo_rl        => g_fifo_rl
94
  )
95
  PORT MAP (
96
    wr_rst      => rst,
97
    wr_clk      => clk,
98
    rd_rst      => rst,
99
    rd_clk      => clk,
100
    -- Monitor FIFO filling
101
    wr_ful      => wr_ful,
102
    wr_usedw    => OPEN,
103
    rd_usedw    => usedw,
104
    rd_emp      => rd_emp,
105
    -- ST sink
106
    snk_out     => snk_out,
107
    snk_in      => snk_in,
108
    -- ST source
109
    src_in      => src_in,
110
    src_out     => src_out
111
  );
112
 
113
END str;

powered by: WebSVN 2.1.0

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