Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers

FIFO size

Altera_Forum
Honored Contributor II
1,750 Views

I want to generate a FIFO that is not 2^n in size. So, I can't use the MegaWizard. What are my options? Using Cyclone III.

0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
690 Views

As far as I know, there are no other options. If you aren't losing too much space why not use the 2^X? If you aren't using a dual clocked fifo just write your own. It's pretty much just a ring buffer as you would implement in C.

0 Kudos
Altera_Forum
Honored Contributor II
690 Views

Thanks for the quick reply. That does answer my question although not helpful. I am using dual clock and the current FIFO size is already huge (16x131,072). Doubling it would not fit in even the largest Cyclone III.

0 Kudos
Altera_Forum
Honored Contributor II
690 Views

Build two FIFOs, one that is asynchronous and131,072, and once you've crossed clock domains, a smaller one that tops off the depth you need. A little more latency through, but pretty easy. 

(Asynchronous FIFOs use gray coding to compare pointers, which are only off by one digit, even at the rollover point. If you arbitrarily had the counters rollover at some point that is not a power of 2, then you would have a transition where many bits are changing, potentially causing errors. So there's some technical reason why it doesn't allow that. Synchronous FIFOs could allow for any size technically, just the megawizard wasn't designed to do that.)
0 Kudos
Reply