System verilog fifo

In reply to veeresh_03:
Your approach to the FIFO is incorrect. A typical FIFO has 2 pointers: A WRITE pointer and a READ pointer. You only have ONE pointer, and that would not work.
On WRITEs, you use the mem_space (mem_space[fifo_count]<=data_in;). On READs you just transfer the input data to the output (else if(read && !write) data_out<=data_in;). ?? That is not a FIFO.
In my SVA Handbook 4th Edition I use a FIFO to demonstrate the definition of requirements for a FIFO, and a set of assertions for a FIFO.
Am giving you links to my model. Try to understand it. Also, use assertions.
BTW, don’t use the “reg”, use “logic”.
HTTP://SystemVerilog.US/VF/fifo_rtl.sv
HTTP://SystemVerilog.US/VF/fifo_props.sv
HTTP://SystemVerilog.US/VF/fifo_if.sv

Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact Home - My cvcblr


  1. SVA Alternative for Complex Assertions
    Verification Horizons - March 2018 Issue | Verification Academy
  2. SVA: Package for dynamic and range delays and repeats | Verification Academy
  3. SVA in a UVM Class-based Environment
    SVA in a UVM Class-based Environment | Verification Horizons | Verification Academy