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

Subversion Repositories astron_fifo

[/] [astron_fifo/] [trunk/] [dp_fifo_fill_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: The FIFO output is available until the next eop only after it has
22
--          been filled with more than g_fifo_fill words.
23
-- Description: See dp_fifo_fill_core.vhd.
24
 
25 4 danv
LIBRARY IEEE, common_pkg_lib, dp_pkg_lib;
26 2 danv
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 4 danv
--USE technology_lib.technology_select_pkg.ALL;
31 2 danv
 
32
ENTITY dp_fifo_fill_sc IS
33
  GENERIC (
34 4 danv
    g_technology     : NATURAL := 0;
35 2 danv
    g_data_w         : NATURAL := 16;
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_complex    : BOOLEAN := FALSE;  -- TRUE feeds the concatenated complex fields (im & re) through the FIFO instead of the data field.
46
    g_fifo_fill      : NATURAL := 0;
47
    g_fifo_size      : NATURAL := 256;    -- (32+2) * 256 = 1 M9K, g_data_w+2 for sop and eop
48
    g_fifo_af_margin : NATURAL := 4;      -- Nof words below max (full) at which fifo is considered almost full
49
    g_fifo_rl        : NATURAL := 1       -- use RL=0 for internal show ahead FIFO, default use RL=1 for internal normal FIFO
50
  );
51
  PORT (
52
    rst         : IN  STD_LOGIC;
53
    clk         : IN  STD_LOGIC;
54
 
55
    -- Monitor FIFO filling
56
    wr_ful      : OUT STD_LOGIC;
57
    usedw       : OUT STD_LOGIC_VECTOR(ceil_log2(largest(g_fifo_size, g_fifo_fill + g_fifo_af_margin + 2))-1 DOWNTO 0);  -- = ceil_log2(c_fifo_size)-1 DOWNTO 0
58
    rd_emp      : OUT STD_LOGIC;
59
 
60
    -- MM control FIFO filling (assume 32 bit MM interface)
61
    wr_usedw_32b : OUT STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0);  -- = wr_usedw
62
    rd_usedw_32b : OUT STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0);  -- = rd_usedw
63
    rd_fill_32b  : IN  STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0) := TO_UVEC(g_fifo_fill, c_word_w);
64
 
65
    -- ST sink
66
    snk_out     : OUT t_dp_siso;
67
    snk_in      : IN  t_dp_sosi;
68
    -- ST source
69
    src_in      : IN  t_dp_siso;
70
    src_out     : OUT t_dp_sosi
71
  );
72
END dp_fifo_fill_sc;
73
 
74
 
75
ARCHITECTURE str OF dp_fifo_fill_sc IS
76
BEGIN
77
 
78
  u_dp_fifo_fill_core : ENTITY work.dp_fifo_fill_core
79
  GENERIC MAP (
80
    g_technology     => g_technology,
81
    g_use_dual_clock => FALSE,
82
    g_data_w         => g_data_w,
83
    g_bsn_w          => g_bsn_w,
84
    g_empty_w        => g_empty_w,
85
    g_channel_w      => g_channel_w,
86
    g_error_w        => g_error_w,
87
    g_use_bsn        => g_use_bsn,
88
    g_use_empty      => g_use_empty,
89
    g_use_channel    => g_use_channel,
90
    g_use_error      => g_use_error,
91
    g_use_sync       => g_use_sync,
92
    g_use_complex    => g_use_complex,
93
    g_fifo_fill      => g_fifo_fill,
94
    g_fifo_size      => g_fifo_size,
95
    g_fifo_af_margin => g_fifo_af_margin,
96
    g_fifo_rl        => g_fifo_rl
97
  )
98
  PORT MAP (
99
    wr_rst      => rst,
100
    wr_clk      => clk,
101
    rd_rst      => rst,
102
    rd_clk      => clk,
103
    -- Monitor FIFO filling
104
    wr_ful      => wr_ful,
105
    wr_usedw    => OPEN,
106
    rd_usedw    => usedw,
107
    rd_emp      => rd_emp,
108
    -- MM control FIFO filling (assume 32 bit MM interface)
109
    wr_usedw_32b => wr_usedw_32b,
110
    rd_usedw_32b => rd_usedw_32b,
111
    rd_fill_32b  => rd_fill_32b,
112
    -- ST sink
113
    snk_out     => snk_out,
114
    snk_in      => snk_in,
115
    -- ST source
116
    src_in      => src_in,
117
    src_out     => src_out
118
  );
119
 
120
END str;

powered by: WebSVN 2.1.0

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