09-06-2020 03:52 AM
A basic question I hope, but one I can't answer from the documentation I have read so far.
What happens when a FIFO is full and I try to write a new value into it? Will the new value overwrite the current value in the FIFO's upper most register, or will the new value be lost and the old value preserved?
Further, is it possible to choose between keeping the new value or keeping the old value and ignoring all new data?
09-06-2020 04:04 AM
It depends on its implementation. Some won't write, others will overwrite. "FIFO" is just a way of buffering data, it's not a standard with rules written on stone
09-06-2020 04:11 AM
For the second question, yes, it is possible such a dual-behaviour FIFO. Easily implementable in HLS or HDL, but from the top of my head not an off-the-shelf thing.
Most FIFO implementations are actually more cooperative than that isolated behaviour, they have an "almost full" flag that can tell the producer to pause. Similarly, an "almost empty" flag can trigger data transmission, for example, to keep a constant output data rate.
I think this fits better within the idea of what a FIFO is for: to interface a producer and a consumer with different data rates.