Module hard_fifo

This document contains technical documentation for the hard_fifo module.

This module contains wrappers around the hard FIFO primitives in the Xilinx Ultrascale+ series of devices. Since the code depends on Xilinx primitives, the unisim library must be compiled and available in order to simulate this module. If this is not possible/desirable in your environment, the module can be excluded with the names_avoid argument to tsfpga.module.get_modules() if you are using tsfpga. Using the Vivado simulation libraries can easily be enabled in tsfpga though, by following the guide at Vivado simulation libraries.

asynchronous_hard_fifo.vhd

component asynchronous_hard_fifo is
  generic (
    data_width : positive;
    enable_output_register : boolean;
    primitive_type : fifo_primitive_t
  );
  port (
    clk_read : in std_logic;
    read_ready : in std_logic;
    read_valid : out std_logic;
    read_data : out std_logic_vector;
    --# {{}}
    clk_write : in std_logic;
    write_ready : out std_logic;
    write_valid : in std_logic;
    write_data : in std_logic_vector
  );
end component;

Asynchronous (two clocks) First In First Out (FIFO) data buffering stage with AXI-Stream-like handshaking interface. This is a wrapper around the Xilinx hard FIFO primitive, and can only be used in certain devices.

Resource utilization

This entity has netlist builds set up with automatic size checkers in module_hard_fifo.py. The following table lists the resource utilization for the entity, depending on generic configuration.

Resource utilization for asynchronous_hard_fifo.vhd netlist builds.

Generics

Total LUTs

FFs

Maximum logic level

data_width = 18

enable_output_register = False

3

1

2

data_width = 32

enable_output_register = True

3

1

2

fifo36e2_wrapper.vhd

component fifo36e2_wrapper is
  generic (
    data_width : positive;
    is_asynchronous : boolean;
    enable_output_register : boolean
  );
  port (
    clk_read : in std_logic;
    read_ready : in std_logic;
    read_valid : out std_logic;
    read_data : out std_logic_vector;
    --# {{}}
    clk_write : in std_logic;
    write_ready : out std_logic;
    write_valid : in std_logic;
    write_data : in std_logic_vector
  );
end component;

Wrapper around the Xilinx UltraScale+ FIFO36E2 primitive, with convenient AXI-Stream-like interface.

Note

The almost_full / almost_empty signals from the FIFO seem to work well. They are not routed out at the moment since they do not have a simulation test case.

Warning

The level signal from the FIFO is not routed either. This is because there appears to be glitches in the read/write count signals:

../../_images/fifo_glitches.png

Hopefully this is only an issue with the unisim simulation model, and works correctly in the hardware.

hard_fifo.vhd

component hard_fifo is
  generic (
    data_width : positive;
    enable_output_register : boolean;
    primitive_type : fifo_primitive_t
  );
  port (
    clk : in std_logic;
    --# {{}}
    read_ready : in std_logic;
    read_valid : out std_logic;
    read_data : out std_logic_vector;
    --# {{}}
    write_ready : out std_logic;
    write_valid : in std_logic;
    write_data : in std_logic_vector
  );
end component;

Synchronous (one clock) First In First Out (FIFO) data buffering stage with AXI-Stream-like handshaking interface. This is a wrapper around the Xilinx hard FIFO primitive, and can only be used in certain devices.

Resource utilization

This entity has netlist builds set up with automatic size checkers in module_hard_fifo.py. The following table lists the resource utilization for the entity, depending on generic configuration.

Resource utilization for hard_fifo.vhd netlist builds.

Generics

Total LUTs

FFs

Maximum logic level

data_width = 18

enable_output_register = False

3

1

2

data_width = 32

enable_output_register = True

3

1

2

hard_fifo_pkg.vhd

Package with functions for the hard FIFO wrappers.