FIFO based module implementation Error. Results not as expected, using Quartus Prime Software and vJTAG implementation method.
The module I’m trying to implement works like a FIFO but with a slightly different functionality.
Say I have lots of colored balls, which I’m putting it into the tube that is like the FIFO memory of the module.
1. Every time there is an update signal (udr) a new ball gets added into the tube (writing)
2. Now if the color of the ball that just entered the tube is blue, then reading begins
3. The reading and writing takes place simultaneously and the reading stops once the blue ball is out. Writing keeps on happening whenever there is an update signal.
4. Now if a second blue ball enters the tube, reading starts again until the blue ball is out
5. So I have two flags F1 and F2. F1 keeps track of the number of blue balls in the pipe, and the second flag keeps track of whether there is a reading taking place.
Code Logic –
1. At udr, if the write counter has not reached max, I want the writing to take place and the address to be continued from wherever it stopped last time. (eg. If it stopped at 13, it continues with write address as 14). If, however the max limit has reached I want the counter to reset and write it into the beginning (as a normal FIFO). I have kept the number of lines large enough so that overwriting would never take place without a read already happening.
2. If the data coming in is the reset line (which is basically all “0”) then F1 will be incremented by 1.
3. If F1 is not zero, then reading begins only if a reading is not already taking place (meaning F2 = 0). And then it turns F2 to 1 meaning a read is taking place. Now if the read counter is at the limit then the read counter resets and reads from 0, else it continues reading from wherever it left off, (eg. If it stopped at 13, it continues with reading from 14). Read enable is turned on and read counter is incremented unitarily. Each read has a time delay of 10 clock pulses.
4. Now when the reading is taking place, it may receive a done signal from the receiving end, if the receiving end reads a reset line. If it gets a done signal, then F1 will be deducted by 1 to signify that 1 read has taken place. The module then checks if the F1 is zero, if it is still not that means another reset line was written into the fifo memory when the reading was taking place, so the reading continues, until F1 is 0 which means there is no more reading that needs to take place. So it stops reading and turn F2 = 0 (false)
This is what I want to implement and the code is attached herewith. However, I’m not able to get any reading on the output. Please advise regarding the same.