// Xianjun jiao. putaoshu@msn.com; xianjun.jiao@imec.be; `timescale 1 ns / 1 ps module fifo_sample_delay # ( parameter integer DATA_WIDTH = 8, parameter integer LOG2_FIFO_DEPTH = 7 ) ( input wire clk, input wire rst, input wire [(LOG2_FIFO_DEPTH-1):0] delay_ctl, input wire [(DATA_WIDTH-1):0] data_in, input wire data_in_valid, output wire [(DATA_WIDTH-1):0] data_out, output wire data_out_valid ); wire [LOG2_FIFO_DEPTH:0] rd_data_count; wire [LOG2_FIFO_DEPTH:0] wr_data_count; wire full; wire empty; reg rd_en_start; wire rd_en; reg [LOG2_FIFO_DEPTH:0] wr_data_count_reg; wire wr_complete_pulse; assign wr_complete_pulse = (wr_data_count > wr_data_count_reg); assign rd_en = (rd_en_start&wr_complete_pulse); assign data_out_valid = (rd_en_start&data_in_valid); xpm_fifo_sync #( .DOUT_RESET_VALUE("0"), // String .ECC_MODE("no_ecc"), // String .FIFO_MEMORY_TYPE("auto"), // String .FIFO_READ_LATENCY(0), // DECIMAL .FIFO_WRITE_DEPTH(1<