Forum Discussion
Altera_Forum
Honored Contributor
14 years agoThe double read behavior depends on the tools and IP being accessed.
In SOPC Builder if you perform a 32-bit access in your code to a 16-bit slave two things could happen: Slaves that uses native addressing (no byte enables) --> a single access occurs and the upper 16-bits drop off during writes or get zero padded on reads. Slaves that use dynamic addressing (byte enables) --> two accesses occur at the two 16-bit locations being accessed. In Qsys there is only dynamic addressing so any native slave gets treated as a 32-bit slave port and the accesses behave as if there were byte enables present in the slave. So in that case if your slave port was native and 16-bit and Nios II performs a 32-bit access you'll end up with two accesses regardless if the slave used native addressing or not. At the end of the day my advice is to avoid native addressing at all costs since the behavior changes in Qsys and native addressing also becomes limiting in cases where the master and slave do not match in width (like a 64 bit master accessing a 32 bit slave).