FIFO(vhdl) : Delete Operation

verilogvhdl

Suppose I have a FIFO code written in vhdl for FIFO. I want to delete an element from the FIFO. Here would the FIFO be acting the same as a linked list where I check each and every element of the FIFO and then match it with the data_in and then finally delete it.

OR it is the case that I should always delete the first element of the FIFO ?

Please give me some valuable suggestions .

Regards to all.

Best Answer

I have done a type of fifo with had four extra inputs: rd_cancel and rd_commit, and wr_cancel and wr_commit. The idea is that you can do a bunch of writes and then either cancel the writes you did (erase the data you just wrote) or commit that data (make it available to the read port). The same thing for reading: rd_cancel would "unread" what you just read, rd_commit would commit your reads. The cancel/commit operation would cancel or commit only the data since the last cancel/commit.

This is done by having a temporary copy of the write and read pointers. These temp pointers are copied back and forth with the real pointers depending on the cancel/commit inputs. Also, when calculating if the FIFO is full or not, sometimes the temp pointers or the real pointers are used. It's a bit complicated, and beyond this kind of forum, but if this sounds like what you want then let me know and I'll see what I can come up with.

Just FYI: I have never seen this type of FIFO done before, but it seems like an obvious solution to several FIFO related problems. The last time I googled for a FIFO like this I came up empty, but I'd be surprised if nobody else have ever dreamed up something like this.