Forum Discussion
6 Replies
- Altera_Forum
Honored Contributor
FIFOs can not be accessed the way arrays can be (i.e. you can not access any location, it has to be like first in first out). So you can not use FIFO as a array so there is no question of array of arrays! Please correct me if I have misunderstood your question.
- Altera_Forum
Honored Contributor
I'm aware of that fact :) My question deals more with the memory aspect. The analog in C would be a fifo whose elements are pointers to arrays.
- Altera_Forum
Honored Contributor
So you may instatiate a FIFO in order to save your pointers in it, and the FIFO output will be connected to the read_address of a RAM (or ROM if needed) which will be filled with your arrays. Is this a suitable solution for you?
- Altera_Forum
Honored Contributor
So basically, the FIFO elements should be memory addresses?
(And) would it make sense to be using malloc while doing the C programming in Nios II? - Altera_Forum
Honored Contributor
The FIFO cells are physically implemented in the FPGA RAM blocks but its cells are never addressable in a one-by-one fashion like in a RAM, you can only write to the last address and read from the first one.
Once you have physically created you RAM interface in your design, you ar free to use the ANSI C function to allocate your memory. - Altera_Forum
Honored Contributor
Sorry, I forgot to answer to your first question. Yes, the FIFO contents would be memory addresses.