// // Copyright 2012 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // // 32 word FIFO with AXI4-STREAM interface. // // NOTE: This module uses the SRLC32E primitive explicitly and as such // can only be used with Xilinx technology of the VIRTEX-6/SPARTAN-6/SIERIES-7 or newer. // module axi_fifo_short #(parameter WIDTH=32) ( input clk, input reset, input clear, input [WIDTH-1:0] i_tdata, input i_tvalid, output i_tready, output [WIDTH-1:0] o_tdata, output o_tvalid, input o_tready, output reg [5:0] space, output reg [5:0] occupied ); reg full, empty; wire write = i_tvalid & i_tready; wire read = o_tready & o_tvalid; assign i_tready = ~full; assign o_tvalid = ~empty; reg [4:0] a; genvar i; generate for (i=0;i