This application discloses a method, apparatus,
chip, and medium for reading and writing data in a
FIFO memory, relating to the field of storage systems. The method includes
interleaving data reading and writing from two single-port memories when no read / write conflict exists; and when a read / write conflict exists, a read-first approach is adopted, and then data is interleaved from the two single-port memories again in the next
clock cycle, except that the written data is delayed by one
clock cycle. Therefore, this method solves the problem of read / write conflict and realizes the function of FIFO data reading and writing; using two single-port memories enables simultaneous data reading and writing, thus realizing the function of simultaneous read / write of dual-port memories; and because the area of single-port memories is small,
chip area optimization can be achieved; furthermore, no
clock multiplication is required, so the
FIFO memory of this application can operate at higher frequencies.