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

Subversion Repositories astron_fifo

[/] [astron_fifo/] [trunk/] [dp_fifo_fill.vhd] - Blame information for rev 3

Go to most recent revision | 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: Wrapper of dp_fifo_fill_sc.vhd
22
-- Description: See dp_fifo_fill_core.vhd
23
-- Remark:
24
--   This wrapper is for backwards compatibility, better use dp_fifo_fill_sc.vhd
25
--   for new designs.
26
 
27
LIBRARY IEEE, common_pkg_lib, dp_pkg_lib, technology_lib;
28
USE IEEE.std_logic_1164.ALL;
29
USE IEEE.numeric_std.ALL;
30
USE common_pkg_lib.common_pkg.ALL;
31
USE dp_pkg_lib.dp_stream_pkg.ALL;
32
USE technology_lib.technology_select_pkg.ALL;
33
 
34
ENTITY dp_fifo_fill IS
35
  GENERIC (
36
    g_technology     : NATURAL := c_tech_select_default;
37
    g_data_w         : NATURAL := 16;
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_complex    : BOOLEAN := FALSE;  -- TRUE feeds the concatenated complex fields (im & re) through the FIFO instead of the data field.
48
    g_fifo_fill      : NATURAL := 0;
49
    g_fifo_size      : NATURAL := 256;    -- (32+2) * 256 = 1 M9K, g_data_w+2 for sop and eop
50
    g_fifo_af_margin : NATURAL := 4;      -- Nof words below max (full) at which fifo is considered almost full
51
    g_fifo_rl        : NATURAL := 1       -- use RL=0 for internal show ahead FIFO, default use RL=1 for internal normal FIFO
52
  );
53
  PORT (
54
    rst         : IN  STD_LOGIC;
55
    clk         : IN  STD_LOGIC;
56
 
57
    -- Monitor FIFO filling
58
    wr_ful      : OUT STD_LOGIC;
59
    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
60
    rd_emp      : OUT STD_LOGIC;
61
 
62
    -- MM control FIFO filling (assume 32 bit MM interface)
63
    wr_usedw_32b : OUT STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0);  -- = wr_usedw
64
    rd_usedw_32b : OUT STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0);  -- = rd_usedw
65
    rd_fill_32b  : IN  STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0) := TO_UVEC(g_fifo_fill, c_word_w);
66
 
67
    -- ST sink
68
    snk_out     : OUT t_dp_siso;
69
    snk_in      : IN  t_dp_sosi;
70
    -- ST source
71
    src_in      : IN  t_dp_siso;
72
    src_out     : OUT t_dp_sosi
73
  );
74
END dp_fifo_fill;
75
 
76
 
77
ARCHITECTURE str OF dp_fifo_fill IS
78
BEGIN
79
 
80
  u_dp_fifo_fill_sc : ENTITY work.dp_fifo_fill_sc
81
  GENERIC MAP (
82
    g_technology     => g_technology,
83
    g_data_w         => g_data_w,
84
    g_bsn_w          => g_bsn_w,
85
    g_empty_w        => g_empty_w,
86
    g_channel_w      => g_channel_w,
87
    g_error_w        => g_error_w,
88
    g_use_bsn        => g_use_bsn,
89
    g_use_empty      => g_use_empty,
90
    g_use_channel    => g_use_channel,
91
    g_use_error      => g_use_error,
92
    g_use_sync       => g_use_sync,
93
    g_use_complex    => g_use_complex,
94
    g_fifo_fill      => g_fifo_fill,
95
    g_fifo_size      => g_fifo_size,
96
    g_fifo_af_margin => g_fifo_af_margin,
97
    g_fifo_rl        => g_fifo_rl
98
  )
99
  PORT MAP (
100
    rst         => rst,
101
    clk         => clk,
102
 
103
    -- Monitor FIFO filling
104
    wr_ful      => wr_ful,
105
    usedw       => usedw,
106
    rd_emp      => rd_emp,
107
 
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
 
113
    -- ST sink
114
    snk_out     => snk_out,
115
    snk_in      => snk_in,
116
    -- ST source
117
    src_in      => src_in,
118
    src_out     => src_out
119
  );
120
 
121
END str;

powered by: WebSVN 2.1.0

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