Cornell High Frequency Trading Club

Build the FIFO. From scratch.

Build a parameterized synchronous FIFO from scratch in SystemVerilog.

Interface

module sync_fifo #(
    parameter DEPTH = 16,   // power of 2
    parameter WIDTH = 8
) (
    input  logic             clk,
    input  logic             rst,     // synchronous, active-high
    input  logic             wr_en,
    input  logic             rd_en,
    input  logic [WIDTH-1:0] din,
    output logic [WIDTH-1:0] dout,
    output logic             full,
    output logic             empty,
    output logic [$clog2(DEPTH):0] count   // number of valid entries, 0..DEPTH
);

Requirements

The challenge

Implement the interface in design.sv. Verify reset, simultaneous reads and writes, full and empty boundaries, and pointer wraparound. Aim to write it in under 20 minutes.

Download the original problem. Its references to Q1 and tb.sv refer to materials not included here.