Altera_Forum
Honored Contributor
20 years agousing packet data types on nios
I am creating a large embedded file system on my board. Memory constraints may require that I use packed data types. I realize there are issues with data alignment and code efficiency, but maybe there are smarter ways to do it. I also need to xfer the file system data to/from a windows machine, and expect to have a translation module on the PC side.
There is a short discussion about this for the ARM processor here, and I wonder if the same basic rules apply to the Nios: http://www.arm.com/support/faqdev/1228.html (http://www.arm.com/support/faqdev/1228.html) By using __alignof__() and sizeof(), I can see the Nios compiler behavior is to pad in the same way as the ARM. So has anyone gone down this path before on the Nios and could give recommendations? Is it just a matter of declaring __packed structures and pointers, or is there more pain involved? thanks