PoC.fifo.ic_assembly

This module assembles a FIFO stream from data blocks that may arrive slightly out of order. The arriving data is ordered according to their address. The streamed output starts with the data word written to address zero (0) and may proceed all the way to just before the first yet missing data. The association of data with addresses is used on the input side for the sole purpose of reconstructing the correct order of the data. It is assumed to wrap so as to allow an infinite input sequence. Addresses are not actively exposed to the purely stream-based FIFO output.

The implemented functionality enables the reconstruction of streams that are tunnelled across address-based transports that are allowed to reorder the transmission of data blocks. This applies to many DMA implementations.

Entity Declaration:

 1entity fifo_ic_assembly is
 2  generic (
 3    D_BITS : positive;                  -- Data Width
 4    A_BITS : positive;                  -- Address Bits
 5    G_BITS : positive                   -- Generation Guard Bits
 6  );
 7  port (
 8    -- Write Interface
 9    clk_wr : in std_logic;
10    rst_wr : in std_logic;
11
12    -- Only write addresses in the range [base, base+2**(A_BITS-G_BITS)) are
13    -- acceptable. This is equivalent to the test
14    --   tmp(A_BITS-1 downto A_BITS-G_BITS) = 0 where tmp = addr - base.
15    -- Writes performed outside the allowable range will assert the failure
16    -- indicator, which will stick until the next reset.
17    -- No write is to be performed before base turns zero (0) for the first
18    -- time.
19    base   : out std_logic_vector(A_BITS-1 downto 0);
20    failed : out std_logic;
21
22    addr : in  std_logic_vector(A_BITS-1 downto 0);
23    din  : in  std_logic_vector(D_BITS-1 downto 0);
24    put  : in  std_logic;
25
26    -- Read Interface
27    clk_rd : in std_logic;
28    rst_rd : in std_logic;
29
30    dout : out std_logic_vector(D_BITS-1 downto 0);
31    vld  : out std_logic;
32    got  : in  std_logic
33  );
34end entity fifo_ic_assembly;