Presentation 3
Presentation 3
Hardik Upreti
FIFO
What is FIFO?
FIFO stores the data at every posedge of the clock based on wr_en
signals till the FIFO is full.
Write pointer increments on every data write in FIFO memory.
Synchronous FIFO
Operation: Read
Wdata_q: is queu to
store data that gets
written into the FIFO
Wdata: Temporary
variable to hodl data
read from wdata_q
Initialize
clk=0,rst_n=0,w_en=0,data_in=0
Line 22: wait for 10 clk cycles
Perform Write for 2 rounds, each of
30 cycles: i=0, waits for posedge
clk,write enable is toggled every
cycle(line 28)
If write enable is HIGH and
full=0(FIFO is not FULL), generate
random data and push it into the
queue.
Test Bench
Read Operation
Initializes CLK=0,rst_n=0,r_en=0
Wait for 20 cycles and deassert
reset_n=1
Perform read operation for 2
rounds each of 30 cycles.
Read enable is toggled every
second cycle.
Whne read enable is HIGH and
FIFO is not empty, read data
from FIFO.
Retrieve data from pop_front to
wdata.
Compare data_out with wdata
and print error if they don’t
match.
Dump the simulation data to a
VCD file.