Professional Documents
Culture Documents
CHAPTER 3
PROGRAMMABLE DSPS
SYLLABUS
9/21/2013
TMS320C54XX
Summary of the Architectural Features of three fixed-Points DSPsTexas Instruments, Motorola & Analog Devices
9/21/2013
Summary of the Architectural Features of three fixed-Points DSPsTexas Instruments, Motorola & Analog Devices
ARCHITECTURE OF
TMS320C54XX
9/21/2013
ARCHITECTURE OF TMS320C54XX
ARCHITECTURE OF TMS320C54XX
9/21/2013
ARCHITECTURE OF TMS320C54XX
Eight major 16-bit buses (four program/data buses and four address buses):
The p
program
g
bus (PB)
( ) carries the instruction code and immediate operands
p
from program memory.
Three data buses (CB, DB, and EB) interconnect to various elements, such as
the CPU, data address generation logic, program address generation logic,
on-chip peripherals, and data memory.
The CB and DB carry the operands that are read from data memory.
The EB carries the data to be written to memory.
F
Four
address
dd
buses
b
(PAB,
(PAB CAB,
CAB DAB
DAB, and
d EAB) carry the
h addresses
dd
needed
d d for
f
instruction execution (corresponding to PB, CB,DB & EB respectively).
The C54x DSP can generate up to two data-memory addresses per cycle
using the two auxiliary register arithmetic units (ARAU0 and ARAU1) in
DAGEN block.
This enables accessing two operands simultaneously.
9/21/2013
The PB can carry data operands stored in program space (for instance,
a coefficient table) to the multiplier and adder for multiply/accumulate
operations or to a destination in data space for data move instructions
(MVPD and READA). This capability, in conjunction with the feature of
dual-operand read, supports the execution of single-cycle, 3-operand
instructions such as the FIRS instruction.
The C54x DSP also has an on-chip
p bidirectional bus for accessing
g onchip peripherals. This bus is connected to DB and EB through the bus
exchanger in the CPU interface. Accesses that use this bus can require
two or more cycles for reads and writes, depending on the peripherals
structure.
ARCHITECTURE OF TMS320C54XX-CPU
arithmetic
i h i llogic
i uniti (ALU)
Two 40-bit accumulators
Barrel shifter
17 17-bit multiplier
40-bit adder
Compare, select, and store unit (CSSU)
Data address generation unit (DAGEN)
Program address generation unit (PAGEN)
Exponent encoder (EXP)
9/21/2013
CPU
ALU
The ALU can also function as two 16-bit ALUs and perform two
16-bit operations simultaneously.
CPU
ALU
9/21/2013
CPU
CPU
ALU
ALU
9/21/2013
ALU
OVERFLOW HANDLING
ALU
OVERFLOW HANDLING
The
reset is performed.
A conditional instruction (such as a branch, a return, a call, or
an execute) is executed on an overflow condition.
The overflow flag (OVA/OVB) is cleared.
cleared
9/21/2013
ALU
ALU
CARRY BIT
10
9/21/2013
CPU
ACCUMULATOR
CPU
ACCUMULATOR
11
9/21/2013
CPU
The temporary (T) register has many uses. For example, it may
hold:
CPU
12
9/21/2013
13
9/21/2013
CPU
The 16
Th
16-bit
bit stack-pointer
t k i t register
i t (SP) contains
t i th
the address
dd
of the top of the system stack. The SP always points to the
last element pushed onto the stack. The stack is manipulated
by interrupts, traps, calls, returns, and the PSHD, PSHM,
POPD, and POPM instructions. Pushes and pops of the stack
predecrement and postincrement, respectively, the 16-bit
value in the stack pointer.
CPU
BARREL SHIFTER
14
9/21/2013
CPU
CPU
BARREL SHIFTER
BARREL SHIFTER
15
9/21/2013
CPU
CPU
BARREL SHIFTER
BARREL SHIFTER
16
9/21/2013
CPU
BARREL SHIFTER
CPU
BARREL SHIFTER
17
9/21/2013
Multiplier/Adder Unit
18
9/21/2013
Multiplier/Adder Unit
19
9/21/2013
20
9/21/2013
Contains boot loader that is useful for booting to faster onchip or external RAM.
21
9/21/2013
cores.
Each CPU can perform a single access with zero states
to any location in 2-way shared RAM during each clock
cycle.
cycle
Shared memory is program write protected or read
only by CPU. Only DMA controller can write to shared
memory.
22
9/21/2013
Memory-Mapped Registers
23
9/21/2013
ST0 and ST1 contain the status of various conditions and modes;
PMST contains memory-setup status and control information. It is
used
d to
t configure
fi
the
th processor.
Because these registers are memory-mapped, they can be stored
into and loaded from data memory; the status of the processor
can be saved and restored for subroutines and interrupt service
routines (ISRs).
24
9/21/2013
The individual bits of the ST0 and ST1 registers can be set or cleared with the SSBX
and RSBX instructions. For example, the sign-extension mode is set with SSBX 1,
SXM, or reset with RSBX 1, SXM.
The ARP, DP, and ASM bit fields can be loaded using the LD instruction with a shortimmediate operand.
The ASM and DP fields can be also loaded with data-memory values by using the
LD instruction.
Status Register 0 (ST0) Diagram
ARP:Auxiliaryregisterpointer.TC:Test/controlflag.
C:Carrybit.OVA:OverflowflagforaccumulatorA.
OVB:OverflowflagforaccumulatorB.DP:Datamemorypagepointer.
25
9/21/2013
26
9/21/2013
27
9/21/2013
28
9/21/2013
29
9/21/2013
30
9/21/2013
Direct addressing uses seven bits of the instruction to encode the lower seven bits of an
address The seven bits are used with the data page pointer (DP) or the stack pointer (SP)
address.
to determine the actual memory address.
Stack addressing manages adding and removing items from the system stack.
31
9/21/2013
Program memory is usually addressed with the program counter (PC). With some
instructions, however, absolute addressing may be used to access data items that have
been stored in program memory.
The PC, which is used to fetch individual instructions, is loaded by the programaddress generation logic (PAGEN).
The program-address generation logic (PAGEN) generates the address used to access
instructions, coefficient tables, 16-bit immediate operands, or other information stored
in program memory, and puts this address on the PAB.
PAGEN consists
i off fi
five registers:
i
32
9/21/2013
Immediate Addressing
Absolute Addressing
33
9/21/2013
Absolute Addressing
Absolute Addressing
34
9/21/2013
Absolute Addressing
Absolute Addressing
35
9/21/2013
Accumulator Addressing
READA Smem
WRITA Smem
Direct Addressing
In direct addressing,
g the instruction contains the lower seven bits
of the data memory address (dma).
The 7-bit dma is an address offset that is combined with a base
address, with the data-page pointer (DP), or with the stack
pointer (SP) to form a 16-bit data-memory address.
Using this form
f
off addressing, you can access any off 128
locations in random order without changing the DP or the SP.
Either DP or SP can be combined with the dma offset to generate
the actual address.
36
9/21/2013
Direct Addressing
When CPL = 0, the dma field is concatenated with the 9-bit DP field
to form the 16-bit data-memory address.
When CPL = 1, the dma field is added (positive offset) to SP to form
the 16-bit data-memory address.
Direct Addressing
37
9/21/2013
Direct Addressing
Direct Addressing
The SP points to any address in memory. The dma points to the specific location
on the page, allowing you to access a contiguous 128-word (27 1) block
in memory from any base address.
SP can also add or remove items from the stack.
38
9/21/2013
Direct Addressing
Indirect Addressing
39
9/21/2013
Indirect Addressing
Indirect Addressing
Two auxiliary register arithmetic units (ARAU0 and ARAU1) operate on the contents
of the auxiliary registers. The ARAUs perform unsigned, 16-bit auxiliary register
arithmetic operations. Some addresses can be obtained by pre-modifying the
auxiliary register.
The auxiliary registers can be:
Loaded via the data bus by writing to the memory-mapped auxiliary registers
Modified by the indirect addressing field of any instruction that supports indirect addressing
M difi d b
Modified
by th
the modify
dif auxiliary
ili
register
i t (MAR) iinstruction
t ti
Figure shows the ARAUs used to generate an address in the indirect addressing mode
using a single data-memory operand. As the figure shows, the main components used
for address generation in indirect addressing are the auxiliary register arithmetic
units (ARAU0 and ARAU1) and the auxiliary registers (AR0AR7).
40
9/21/2013
Indirect Addressing
Indirect Addressing
41
9/21/2013
42
9/21/2013
Problem
Assuming the current content of AR3 to be 200h, what
will be its contents after each of the following
TMS320C54xx addressing modes is used? Assume that
the contents of AR0 are 20h.
a. *AR3+0
b. *AR3-0
c. *AR3+
d. *AR3e. *AR3
f. *+AR3(40h)
g. *+AR3(-40h)
Solution
43
9/21/2013
Indirect Addressing
Indirect Addressing
44
9/21/2013
Indirect Addressing
Place the first (lowest) address of the circular buffer on a 2N boundary where 2N is larger
than the circular buffer size.
The first time the circular queue is addressed, the auxiliary register must point to an
element in the circular queue.
Indirect Addressing
45
9/21/2013
Indirect Addressing
Indirect Addressing
46
9/21/2013
Indirect Addressing
Problem
47
9/21/2013
Indirect Addressing
48
9/21/2013
49
9/21/2013
50
9/21/2013
51
9/21/2013
The system stack is used to automatically store the program counter during interrupts
and subroutines. It can also be used at your discretion to store additional items of
context or to pass data values
values. The stack is filled from the highest to the lowest
memory address. The processor uses a 16-bit memory mapped register, the stack
pointer (SP), to address the stack. SP always points to the last element stored onto
the stack.
Four instructions access the stack using the stack addressing mode:
Stack Addressing
Stack Addressing
52
9/21/2013
M
E
M
O
R
Y
S
P
A
C
E
MEMORY SPACE
53
9/21/2013
54
9/21/2013
Program Control
55