Achronix Speedster22i User Macro Guide User Manual
Page 160

Memories
BRAM80KFIFO
Speedster22i Macro Cell Library
PAGE 143
Writing to an Almost Full FIFO (en_wr_when_full = 1’b0)
Figure 6-16: Writing to an Almost Full FIFO (en_wr_when_full = 1’b0)
Writing to an Almost Full FIFO (en_wr_when_full = 1’b1)
Figure 6-17: Writing to an Almost Full FIFO (en_wr_when_full = 1’b1)
wrclk
rdclk
wren
rden
din
almost_full
write_err
1. Almost Full Offset programmed for 5 40-bit words (aempty_offset = 17’h00004)
Note: This timing diagram assumes:
2. wptr_sync_stages = 2’b00
3. en_wr_when_empty = 1’b0
wrd 2042 wrd 2043 wrd 2044 wrd 2045
full
wrd 2046 wrd 2047 wrd 2048
A
B
C
D
A
Event : Finish writing 2049 words to the FIFO.
Event : The almost_full flag is asserted.
Event : The full flag is asserted four write cycles after almost_full flag is asserted (assuming no reads).
Event : The write_err flag is asserted one wrclk cycle after attempting to write a full FIFO.
B
C
D
wrclk
rdclk
wren
rden
din
Note: This timing diagram assumes:
1. wptr_sync_stages = 2’b00
2. en_wr_when_empty = 1’b0
wrd 2048 wrd 2049
A
D
A
Event : In process of writing 2050 (wrd 0 through wrd 2049) words to the FIFO.
Event : The 2049th (wrd 2048) word is written to the FIFO. The first word (wrd 0) is overwritten
B
4. write_width = 40 and read_width = 40, implying a maximum FIFO depth of 2048 locations
by the 2049th word since en_wr_when_empty = 1’b1 and the maximum depth of the
FIFO is 2048 words.
5. After the FIFO was reset, a sequence of 2049 writes (wrd 0 through wrd 2048) to the FIFO occurs.
wrd 2048
wrd 2049
wrd 2
3. fwft = 1’b0
dout
D
Event : Begin reading FIFO from location 0.
B
C
E
F
G
Event : The 2050th (wrd 2049) word is written to the FIFO. The second word (wrd 1) is overwritten
C
by the 2050th word.
E
Event : First word read is wrd 2048 that overwrote wrd 0.
Event : Third word read is wrd 3.
F
Event : Second word read is wrd 2049 that overwrote wrd 1.
G