FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6518 Discussions

A question about rd_usedw and wr_usedw for a DCFIFO

Altera_Forum
Honored Contributor II
1,089 Views

Hello all, 

 

Recently I used a dcfifo mega core to buffer datas,  

I found there're 2 signals for usedwidth : rd_usedw and wr_usedw 

 

I don't understand the difference between these two signals. 

 

Why we need two signals to both read and write side? 

 

Do the read and write side share one fifo or do they cut the fifo into two parts, 

 

For example, we have a dcfifo with a depth of 1024 words,  

 

does it mean 512 words for read and 512 words for write? 

 

thx to advance
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
360 Views

Are you looking at the usedwd value in the read clock domain or write clock domain? You want to choose the right one so that you can safely capture it. (If you took wr_usedw and analyzed it in the read domain, you will read the wrong data because the clocks aren't synchronous).

0 Kudos
Altera_Forum
Honored Contributor II
360 Views

 

--- Quote Start ---  

 

I found there're 2 signals for usedwidth : rd_usedw and wr_usedw 

 

I don't understand the difference between these two signals. 

 

--- Quote End ---  

 

 

A dual-clock FIFO has two clock domains, the write clock domain (which uses wr_usedw) and the read clock domain (which uses rd_usedw). 

 

This is much clearer if you use Modelsim to simulate your components. 

 

Please see this thread for a zip file containing simulations of both scfifo and dcfifo components: 

 

http://www.alteraforum.com/forum/showthread.php?t=38988 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
359 Views

i understand better now , thx very much!

0 Kudos
Reply