PoC.fifo.cc_got

This module implements a regular FIFO with common clock (cc), pipelined interface. Common clock means read and write port use the same clock. The FIFO size can be configured in word width (D_BITS) and minimum word count MIN_DEPTH. The specified depth is rounded up to the next suitable value.

DATA_REG (=true) is a hint, that distributed memory or registers should be used as data storage. The actual memory type depends on the device architecture. See implementation for details.

*STATE_*_BITS defines the granularity of the fill state indicator *State. If a fill state is not of interest, set *STATE_*_BITS = 0. FillState is associated with the read clock domain and outputs the guaranteed number of words available in the FIFO. EmptyState is associated with the write clock domain and outputs the number of words that is guaranteed to be accepted by the FIFO without a capacity overflow. Note that both these indicators cannot replace the full or valid outputs as they may be implemented as giving pessimistic bounds that are minimally off the true fill state.

FillState and EmptyState are combinatorial outputs and include an address comparator (subtractor) in their path.

Examples:

  • FILL_STATE_BITS = 1:

    FillState

    filled (at least)

    0

    0/2 full

    1

    1/2 full (half full)

  • FILL_STATE_BITS = 2:

    FillState

    filled (at least)

    0

    0/4 full

    1

    1/4 full

    2

    2/4 full (half full)

    3

    3/4 full

Entity Declaration:

 1    DATA_BITS          : positive; -- Data Width
 2    MIN_DEPTH       : positive; -- Minimum FIFO Depth
 3    RAM_TYPE        : T_RAM_TYPE := RAM_TYPE_OPTIMIZED;
 4    DATA_REG        : boolean    := false; -- Store Data Content in Registers
 5    LUT_SHIFT_LOGIC : boolean    := false; -- Store Data Content in Lut-Shift-Logic (only possible in Xilinx devices)
 6    STATE_REG       : boolean    := false; -- Registered Full/Empty Indicators
 7    OUTPUT_REG      : boolean    := false; -- Registered FIFO Output
 8    EMPTY_STATE_BITS  : natural    := 0;     -- Empty State Bits
 9    FILL_STATE_BITS  : natural    := 0      -- Full State Bits
10  );
11  port (
12    -- Global Reset and Clock
13    Clock : in  std_logic;
14    Reset : in  std_logic;
15
16    -- Writing Interface
17    Put        : in  std_logic;                             -- Write Request
18    DataIn     : in  std_logic_vector(DATA_BITS - 1 downto 0); -- Input Data
19    Full       : out std_logic;
20    EmptyState : out std_logic_vector(imax(0, EMPTY_STATE_BITS - 1) downto 0);
21
22    -- Reading Interface
23    Got        : in  std_logic;                              -- Read Completed
24    DataOut    : out std_logic_vector(DATA_BITS - 1 downto 0); -- Output Data
25    Valid      : out std_logic;
26    FillState  : out std_logic_vector(imax(0, FILL_STATE_BITS - 1) downto 0)
27  );

See also

IP/fifo_dc_got

For a FIFO with dependent clocks.

PoC.fifo.ic_got

For a FIFO with independent clocks (cross-clock FIFO).

IP/fifo_glue

For a minimal FIFO / pipeline decoupling.