
NXP Semiconductors
PNX15xx/952x Series
Volume 1 of 1
Chapter 29: Endian Mode
PNX15XX_PNX952X_SER_N_4
NXP B.V. 2007. All rights reserved.
Product data sheet
Rev. 4.0 — 03 December 2007
29-808
Remark: The packing and ordering of packed bit structure fields in C compilers are
not precisely defined. Typically, big-endian C compilers pack fields from left (msb) to
right (lsb). Little-endian C compilers pack from right to left. Because of this and also
because of inherent inefficient code when accessing structure fields, it is not
recommended to use C structure declarations to access MMIO register fields.
4.3 Module DMA
Every DMA capable module in PNX15xx/952x Series observes the system big-
endian signal, and therefore the global SYS_ENDIANMODE.BIG_ENDIAN value, to
determine how to write each data item or unit to memory.
An example of a unit would be:
16-bit audio sample
32-bit audio sample
32-bit unit containing a RGBa 8888 true color pixel with alpha value.
The module performs byte swapping within units as needed, and packs units as
needed for transmission across on-chip buses. Byte swapping is done in such a
fashion that 8, 16 and 32-bit units always end up in memory bytes in the form
prescribed by the CPU rule. Successive item packing are placed in incrementing
addresses, as designated by the DMA rule.
4.4 SIMD Programming Issues
The module DMA hardware architecture ensures that software dealing with loads and
stores of unit size data can be written in a way that is oblivious to the endian mode.
With the current TM32 CPU core, this is not possible for software that performs Single
Instruction Multiple Data (SIMD) style programming using multimedia operations.
Consider the case of a FIR lter, operating on 16-bit sample units, but using
2-at-a-time load/store/multiply operations. Which of the two 16-bit halfwords is the
earlier sample?
For big-endian mode, the msb halfword contains the earlier sample.
For little-endian mode, the lsb halfword contains the earlier sample.
The current TM32 CPU core on PNX15xx/952x Series requires that SIMD software
be written aware of endian mode.
4.5 Optional Endian Mode Override
Some PNX15xx/952x Series DMA modules have bits in a control register that allow
override of the global endian mode. Refer to each module for details. This method is
used only in modules that deal with DMA of data of a single, xed size (in a given
mode). Such modules implement a eld that allows selection of the following modes:
Normal mode (reset default), obey global PNX15xx/952x Series endian mode
Explicit little-endian, unswapped