
Philips Semiconductors
Endian-ness
File: endian.fm5, modified 7/23/99
PRELIMINARY INFORMATION
C-3
C.4.2
Instruction Cache
It is assumed that the Instruction Cache always operate
in Little Endian regardless of the host and TM1100 endi-
an-ness. Instruction Cache does not use the PCSW’s
byte sex bit (BSX). The compiler supports the loading of
instructions in memory differently for Big Endian and Lit-
tle Endian modes.
C.4.3
TM1100’s PCI Interface Unit (BIU)
TM1100’s highway bus and the PCI bus are address in-
variant buses, i.e. a data corresponding to address zero
is always transferred through the byte-zero line regard-
less of the endian-ness. This address invariant nature of
the PCI and the highway buses allows to transfer the
data from/to PCI bus directly to/from SDRAM without
byte-swapping in either Big or Little Endian mode The
byte-swapping of data for Big Endian mode is performed
by the Data Cache unit. However, the MMIO data does
not go through the byte swapper in the Data cache. This
results in using a byte-swapper in BIU to byte-swap the
MMIO data in Big Endian mode.
TM1100’s PCI interface unit (BIU) has a separate byte
sex (SE, Swap Enabled) flag defined in its control regis-
ter (BIU_CTL). This byte-sex flag has to be set by the
software, i.e. MMIO write operation from the host CPU.
This byte-sex flag is used only for MMIO data accesses
and non of the MMIO data accesses is affected by this
SE flag.
Table C-4 shows the byte-swap logic to handle
the MMIO accesses from DSPCPU, Host CPU and the
non MMIO data accesses from any source.
BIU has several special registers to handle memory, PCI
configuration, I/O and DMA accesses. BIU does not
byte-swap the in/out data from the special registers.
The Data Cache and software does perform the neces-
sary byte-swap for this data.
When using TM1100 in Little Endian based systems, the
first transaction to the TM1100 is to set the SE bit in BIU’s
configuration register to avoid unnecessary software
byte-swapping in the host CPU for the subsequent MMIO
read/write accesses. The SE bit in BIU_CTL register
controls the byte swapping of outgoing and incoming
data from PCI bus. The default value of SE is zero, i.e
BIU byte-swapes the MMIO data including the write op-
eration to BIU_CTL register. Software is required to byte
swap the BIU_CTL register value within the host CPU
before storing the value in BIU_CTL register. Once, the
BIU.SE bit has been set, no additional software byte-
swap is required for further read/write operations to any
MMIO registers.
C.4.4
Image Co-Processor (ICP)
The source data for the image co-processor (ICP) might
come from different places such as Video-in, DSPCPU,
PCI bus, etc. through the SDRAM. The data consistency
needs to be maintained when the TM1100 operates in
Little or Big Endian systems/mode. The ICP needs the
capability to operate on the SDRAM as source data and
SDRAM or PCI as destination data in either Little or Big
Figure C-6 illustrate the Big and Little Endian memory
image format for the image input format (
Figure C-3) and
the three supported image overlay formats.
ICP can output the data to either SDRAM or PCI bus.
RGB 8R and RGB 8A pixel formats are byte streams and
therefore do not require any swapping in Big Endian
mode or Little Endian mode.
Figure C-9 pictures the data
format. RGB-24
+α, RGB-15+α, RGB-16 and YUV-4:2:2
pixel formats can be used to output the pixels to PCI or
SDRAM in both endian mode. Output formats are shown,
an mode. Little Endian data format is shown in
Figure C-Table C-3. Big Endian data format in TM1100 register, Highway, SDRAM memory, PCI bus, Host memory, Host
CPU register
PCSW-
BSX
value
Endian
Mode
Data Transaction
type
Address
Data in
DSPCPU
register
msb
lsb
Data in Highway/
Dcache/SDRAM/
PCI-bus
byte3
byte0
[31:24]
[7:0]
Data in Host
CPU register
msb
lsb
Data in Host
memory
byte0
byte3
[31:24]
[7:0]
0
Big
Word r/w
00001000
01020304
04030201
01020304
0
Big
Half-Word r/w
00001000
xxxx0304
xxxx0403
xxxx0304
0304xxxx
0
Big
Half-Word r/w
00001002
xxxx0304
0403xxxx
xxxx0304
0
Big
Byte read/write
00001000
xxxxxx04
04xxxxxx
0
Big
Byte read/write
00001001
xxxxxx04
xxxx04xx
xxxxxx04
xx04xxxx
0
Big
Byte read/write
00001002
xxxxxx04
xx04xxxx
xxxxxx04
xxxx04xx
0
Big
Byte read/write
00001003
xxxxxx04
04xxxxxx
xxxxxx04
Table C-4. BIU.SE bit usage in processing data in
BIU unit
BIU.SE
value
Endian
Mode
MMIO
access
from
DSPCPU
MMIO
access
from PCI
side
Non
MMIO
data
0
Big
Endian
No byte-
swap
Byte-swap
No byte-
swap
1
Little
Endian
No byte-
swap
No byte-
swap
No byte-
swap