PoC.fifo.cc_got_tempgot

The specified depth (MIN_DEPTH) is rounded up to the next suitable value.

As uncommitted reads occupy FIFO space that is not yet available for writing, an instance of this FIFO can, indeed, report full and not vld at the same time. While a commit would eventually make space available for writing (not ful), a rollback would re-iterate data for reading (vld).

commit and rollback are inclusive and apply to all reads (got) since the previous commit or rollback up to and including a potentially simultaneous read.

The FIFO state upon a simultaneous assertion of commit and rollback is undefined!

*STATE_*_BITS defines the granularity of the fill state indicator *State. 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.

If a fill state is not of interest, set *STATE_*_BITS = 0.

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

Examples:

  • FILL_STATE_BITS = 1:

    • FillState == 0 => 0/2 full

    • FillState == 1 => 1/2 full (half full)

  • FILL_STATE_BITS = 2:

    • FillState == 0 => 0/4 full

    • FillState == 1 => 1/4 full

    • FillState == 2 => 2/4 full

    • FillState == 3 => 3/4 full

Entity Declaration:

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