Professional Documents
Culture Documents
FIFO Design
FIFO Design
ASYNCHRONOUS FIFO
4/14/2023 1
Multiple clock domain circuits
No clk is accurately supplied
to all areas of the circuit at
almost precisely the same time.
GALS
4/14/2023 2
Situations in data transfer
Synchronous data transfer. (same clock domain: control & HS signals)
Asynchronous data transfer. (clock domain crossing)
Various scenarios
Writing
writing speed reading speed
>>>>
reading
reading >> writing
Burst input
data has larger system
????
width than
output data Burst output
data is larger
width than
input data
4/14/2023 3
Design of FIFO
Two clocks,
one for writing other for reading
Synthesizable
Dual-clock architecture
Configurable data width
Configurable fifo depth
Gray-coded read/write pointers
Full/Empty flags
4/14/2023 5
Pin-out Description
Pin Name I/O Description Active
state
Data_in[7:0] In FIFO data input Data
Data_out[7:0] Out FIFO data output data
Read_en In Enable reading Posedge
Write_en In Enable writing posedge
reset In Global reset posedge
Wclk In Input Clk in write posedge
domain
Rclk In Input Clk in read posedge
domain
Fifo_empty Out Fifo empty flag in low
read domain
Fifo_full out Fifo full flag in low
write domain
4/14/2023 6
Dual Port FIFO Architecture
8 Datain
8
Dataout
wr Binary
addr addr Binary
counter
counter rd
Wclk FIFO
Mem
rdclk
Dual port
Binary to gray Binary to gray
converter
RAM converter
wrptr
wrpointer
DFF DFF
rdclk
rdpointer rdptr
DFF DFF
wclk
4/14/2023 7
Synchronizers
Synchronization is achieved by a chain of flip-flops to
resolve metastability
If 2 flip-flops are chained together, the synchronizer
will now have roughly 2 clock periods to resolve
possible metastable events
Using binary to gray converters ensures the glitches
free signals
binary to gray converters + 2 flip-flops are chained
together = Synchronization
Metastability
setup and hold time violation
8
Binary to Gray to Write
Write
gray code binary code _ptr
_ptr
converter converter sync
Read
clk
4/14/2023 9
Source File Description
Source file (verilog) Description
4/14/2023 10
Synthesis
Device utilization summary:---------------------------
Spartan III
Selected Device : 3s200pq208-4
4/14/2023 11
FIFO Depth Calculation For Burst Data Input
Writing speed faster than reading Reading speed faster than writing
Ex:
Writing speed = 10ns • Both pointers are going to cross
Reading speed = 25 ns any how!!!
Burst data = 16 • So handshake signaling must be
used.
For 16 data time taken to write = 16
x10 ns =160 ns • Read will wait till valid writing of
data happens
For 16 data time taken to read = 16 x
25 ns = 400ns • Write block sends signal that it is
busy writing.
Hence depth = 400/160 = 3
• Read block sends
acknowledgement signal , it has
finished reading.
4/14/2023 12
HANDSHAKE SIGNALING
wrclk rdclk
Confirmation to read
rst
rst
Write block read block
wr
rd
Acc to write
4/14/2023 13
A big deal-----VERIFICATION
Verification is expensive……..
DESIGN, 30
VERIFICATION
, 70
4/14/2023 15
Verification Plan
Verifying the specification
Architectural specification : functional requirement
Design specification : implementation of architecture
down the block
Levels of verification
Unit level
Reusable component
System level
Board level
Prioritizing the features
Must have : for first time success
Should have : commercial success
Nice to have : optional
4/14/2023 16
FIFO features verified in this project
1.Features
data_out : data which written first should be read first.
fifo_full :i. when memory is full the fifo_full flag is set
ii. no writing should happen after fifo_full flag is set
fifo_empty : i. when memory is empty fifo_empty is set or not
ii. no reading should happen after fifo_empty flag is set
4/14/2023 17
Verification model
Monitor Flags
Stimuli Driver
FIFO
Generator Data Checker
UUT
Write
Task
FIFO
Behavioral
Read
Task
testing
4/14/2023 18
Stimuli generation
Clock sources to be generated for verification:
4/14/2023 19
Task
4/14/2023 20
Test cases
Normal function tests:
Reset, Data read
4/14/2023 21
Progress of a directed test case approach
100 %
% of
completeness
of test cases
time
4/14/2023 22
Applications
Used for interfacing units with unrelated clocks in
high-speed applications.
Architecture is well suited for all dual-clock
applications and achieves area utilization;
This architecture can be utilized as a drop-in module
to many applications.
Suited for communication between processors and
peripheral devices with different data widths.
This is best suited for the communication between
communication protocols
4/14/2023 23
Future scope
Memory is the largest block in the FIFO, investigations
into power and area reductions while maintaining
reliability could have substantial impact on the overall
module design
4/14/2023 24
Conclusion
When we started to design FIFO we felt its very easy
to design and verify , but when FIFO is required for
specific application then we realize that we need to
change the modules accordingly and also verify them.
Hence every time new corner cases need to be taken
care.
4/14/2023 25