ColdFire is a registered trademark and DigitalDNA is a trademark of Motorola, Inc.
Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty,
representation or guarantee regarding the suitability of its products for any particular purpose, nor does Motorola assume any liability
arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation
consequential or incidental damages. “Typical” parameters which may be provided in Motorola data sheets and/or specifications can
and do vary in different applications and actual performance may vary over time. All operating parameters, including “Typicals” must
be validated for each customer application by customer’s technical experts. Motorola does not convey any license under its patent
rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in systems
intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in
which the failure of the Motorola product could create a situation where personal injury or death may occur. Should Buyer purchase or
use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers,
employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable
attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or
unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part. Motorola
and are registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
How to reach us:
USA/EUROPE/Locations Not Listed:
or 1–800–441–2447
JAPAN:
Motorola Japan Ltd.; SPS, Technical Information Center, 3–20–1, Minami–Azabu. Minato–ku, Tokyo 106–8573 Japan.
81–3–3440–3569
ASIA/PACIFIC:
Hong Kong. 852–26668334
Motorola Semiconductors H.K. Ltd.; Silicon Harbour Centre, 2 Dai King Street, Tai Po Industrial Estate, Tai Po, N.T.,
Motorola Literature Distribution; P.O. Box 5405, Denver, Colorado 80217. 1–303–675–2140
General-Purpose I/O Module
Pulse-Width Modulation (PWM) Module
Signal Descriptions
Bus Operation
IEEE 1149.1 Test Access Port (JTAG)
Mechanical Data
Electrical Characteristics
Appendix A: List of Memory Maps
Appendix B: Buffering and Impedence Matching
Index
The primary objective of this user’s manual is to define the functionality of the MCF5272
processors for use by software and hardware developers.
The information in this book is subject to change without notice, as described in the
disclaimers on the title page of this book. As with any technical documentation, it is the
readers’ responsibility to be sure he is using the most recent v ersion of the documentation.
T o locate an y published errata or updates for this document, refer to the world-wide web at
http://www.motorola.com/coldfire.
Audience
This manual is intended for system software and hardware developers and applications
programmers who want to develop products with the MCF5272. It is assumed that the
reader understands operating systems, microprocessor system design, basic principles of
software and hardware, and basic details of the ColdFire
Organization
Following is a summary and brief description of the major sections of this manual:
•Chapter 1, “Overview,” includes general descriptions of the modules and features
incorporated in the MCF5272, focussing in particular on new features.
•Chapter 2, “ColdFire Core,” provides an ov erview of the microprocessor core of the
MCF5272. The chapter describes the organization of the Version 2 (V2) ColdFire
5200 processor core and an overview of the program-visible registers (the
programming model) as they are implemented on the MCF5272. It also includes a
full description of exception handling and a table of instruction timings.
•Chapter 3, “Hardware Multiply/Accumulate (MAC) Unit, ” describes the MCF5272
multiply/accumulate unit, which executes integer multiply, multiply-accumulate,
and miscellaneous register instructions. The MAC is integrated into the operand
execution pipeline (OEP).
•Chapter 4, “Local Memory.” This chapter describes the MCF5272 implementation
of the ColdFire V2 local memory specification. It consists of three major sections,
as follows.
(SRAM) implementation. It covers general operations, configuration, and
initialization. It also provides information and examples of how to minimize
power consumption when using the SRAM.
The ROM module contains tabular data that the ColdFire core can access in a
single cycle.
— Section 4.5, “Instruction Cache Overview,” describes the MCF5272 cache
implementation, including organization, configuration, and coherency. It
describes cache operations and how the cache interacts with other memory
structures.
•Chapter 5, “Debug Support,” describes the Revision A hardware debug support in
the MCF5272.
•Chapter 6, “System Integration Module (SIM),” describes the SIM programming
model, bus arbitration, power management, and system-protection functions for the
MCF5272.
•Chapter 7, “Interrupt Controller,” describes operation of the interrupt controller
portion of the SIM. Includes descriptions of the registers in the interrupt controller
memory map and the interrupt priority scheme.
•Chapter 8, “Chip Select Module,” describes the MCF5272 chip-select
implementation, including the operation and programming model, which includes
the chip-select address, mask, and control registers.
•Chapter 9, “SDRAM Controller,” describes configuration and operation of the
synchronous DRAM controller component of the SIM, including a general
description of signals involved in SDRAM operations. It provides interface
information for memory configurations using most common SDRAM devices for
both 16- and 32-bit-wide data buses. The chapter concludes with signal timing
diagrams.
•Chapter 10, “DMA Controller,” provides an overview of the MCF5272’s
one-channel DMA controller intended for memory-to-memory block data transfers.
This chapter describes in detail its signals, registers, and operating modes.
•Chapter 11, “Ethernet Module,” describes the MCF5272 fast Ethernet media access
controller (MAC). This chapter begins with a feature-set overview, a functional
block diagram, and transceiver connection information for both MII and se ven-wire
serial interfaces. The chapter concludes with detailed descriptions of operation and
the programming model.
•Chapter 12, “Universal Serial Bus (USB), ” provides an o verview of the USB module
of the MCF5272, including detailed operation information and the USB
programming model. Connection examples and circuit board layout considerations
are also provided.
xlMCF5407 User’s Manual
Page 41
Organization
The USB Specification, Revision 1.1 is a recommended supplement to this chapter.
It can be downloaded from http://www.usb.org. Chapter 2 of this specification,
Terms and Abbreviations, provides definitions of many of the words found here.
•Chapter 13, “Physical Layer Interface Controller (PLIC),” provides detailed
information about the MCF5272’s physical layer interface controller, a module
intended to support ISDN applications. The chapter begins with a description of
operation and a series of related block diagrams starting with a high-level ov erview.
Each successive diagram depicts progressively more internal detail. The chapter
then describes timing generation and the programming model and concludes with
three application examples.
•Chapter 14, “Queued Serial Peripheral Interface (QSPI) Module,” provides a
feature-set overview and description of operation, including details of the QSPI’s
internal RAM organization. The chapter concludes with the programming model
and a timing diagram.
•Chapter 15, “Timer Module,” describes configuration and operation of the four
general-purpose timer modules, timer 0, 1, 2 and 3.
•Chapter 16, “UART Modules,” describes the use of the universal
asynchronous/synchronous receiver/transmitters (UARTs) implemented on the
MCF5272, including example register values for typical configurations.
•Chapter 17, “General Purpose I/O Module,” describes the operation and
programming model of the three general purpose I/O (GPIO) ports on the
MCF5272. The chapter details pin assignment, direction-control, and data registers.
•Chapter 18, “Pulse Width Modulation (PWM) Module, ” describes the configuration
and operation of the pulse width modulation (PWM) module. It includes a block
diagram, programming model, and timing diagram.
•Chapter 19, “Signal Descriptions,” provides a listing and brief description of all the
MCF5272 signals. Specifically, it shows which are inputs or outputs, how they are
multiplexed, and the state of each signal at reset. The first listing is organized by
function, with signals appearing alphabetically within each functional group. This is
followed by a second listing sorted by pin number.
•Chapter 20, “Bus Operation,” describes the functioning of the bus for data-transfer
operations, error conditions, bus arbitration, and reset operations. It includes
detailed timing diagrams showing signal interaction. Operation of the bus is defined
for transfers initiated by the MCF5272 as a bus master. The MCF5272 does not
support external bus masters. Note that Chapter 9, “SDRAM Controller, ” describes
DRAM cycles.
About This Book xli
Page 42
Suggested Reading
•Chapter 21, “IEEE 1149.1 Test Access Port (JTAG),” describes configuration and
operation of the MCF5272 Joint Test Action Group (JTAG) implementation. It
describes those items required by the IEEE 1149.1 standard and provides additional
information specific to the MCF5272. For internal details and sample applications,
see the IEEE 1149.1 document.
•Chapter 22, “Mechanical Data,” provides a functional pin listing and package
diagram for the MCF5272.
•Chapter 23, “Electrical Characteristics,” describes AC and DC electrical
specifications and thermal characteristics for the MCF5272. Because additional
speeds may have become available since the publication of this book, consult
Motorola’s ColdFire web page, http://www.motorola.com/coldfire, to confirm that
this is the latest information.
This manual includes the following two appendixes:
•Appendix A, “List of Memory Maps,” provides the entire address-map for
MCF5272 memory-mapped registers.
•Appendix B, “Buffering and Impedance Matching,” provides some suggestions
regarding interface circuitry between the MCF5272 and SDRAMs.
This manual also includes an index.
Suggested Reading
This section lists additional reading that provides background for the information in this
manual as well as general information about the ColdFire architecture.
General Information
The following documentation provides useful information about the ColdFire architecture
and computer architecture in general:
ColdFire Documentation
The ColdFire documentation is available from the sources listed on the back cover of this
manual. Document order numbers are included in parentheses for ease in ordering.
•User’s manuals—These books provide details about individual ColdFire
implementations and are intended to be used in conjunction with The ColdFire Programmers Reference Manual. These include the following:
•Using Microprocessors and Microcomputers: The Motorola Family, William C.
Wray, Ross Bannatyne, Joseph D. Greenfield
Additional literature on ColdFire implementations is being released as new processors
become available. For a current list of ColdFire documentation, refer to the World Wide
Web at http://www.motorola.com/ColdFire/.
Conventions
This document uses the following notational conventions:
MNEMONICSIn text, instruction mnemonics are shown in uppercase.
mnemonicsIn code and tables, instruction mnemonics are shown in lowercase.
italicsItalics indicate variable command parameters.
Book titles in text are set in italics.
0x0Prefix to denote hexadecimal number
0b0Prefix to denote binary number
REG[FIELD]Abbreviations for registers are shown in uppercase. Specific bits,
fields, or ranges appear in brackets. For example, RAMBAR[BA]
identifies the base address field in the RAM base address register.
nibble A 4-bit data unit
byte An 8-bit data unit
word A 16-bit data unit
longword A 32-bit data unit
xIn some contexts, such as signal encodings, x indicates a don’t care.
nUsed to express an undefined numerical value
¬NOT logical operator
&AND logical operator
|OR logical operator
1
1
The only exceptions to this appear in the discussion of serial communication modules that support variable-length data transmission units. To simplify the discussion these units are referred to as words regardless
of length.
About This Book xliii
Page 44
Acronyms and Abbreviations
Acronyms and Abbreviations
Table i lists acronyms and abbreviations used in this document.
Table i. Acronyms and Abbreviated Terms
TermMeaning
ADCAnalog-to-digital conversion
ALUArithmetic logic unit
AVECAutovector
BDMBackground debug mode
BISTBuilt-in self test
BSDLBoundary-scan description language
CODECCode/decode
DACDigital-to-analog conversion
DMADirect memory access
DSPDigital signal processing
EAEffective address
EDOExtended data output (DRAM)
FIFOFirst-in, first-out
GPIOGeneral-purpose I/O
2
I
CInter-integrated circuit
IEEEInstitute for Electrical and Electronics Engineers
Table ii shows terminology conventions used throughout this document.
Table ii Notational Conventions
InstructionOperand Syntax
Opcode Wildcard
ccLogical condition (example: NE for not equal)
Register Specifications
AnAny address register n (example: A3 is address register 3)
Ay,AxSource and destination address registers, respectively
DnAny data register n (example: D5 is data register 5)
Dy,DxSource and destination data registers, respectively
RcAny control register (example VBR is the vector base register)
RmMAC registers (ACC, MAC, MASK)
RnAny address or data register
RwDestination register w (used for MAC instructions only)
Ry,RxAny source and destination registers, respectively
Xiindex register i (can be an address or data register: Ai, Di)
Register Names
ACCMAC accumulator register
CCRCondition code register (lower byte of SR)
MACSRMAC status register
MASKMAC mask register
PCProgram counter
SRStatus register
Port Name
DDATADebug data port
PSTProcessor status port
Miscellaneous Operands
#<data>Immediate data following the 16-bit operation word of the instruction
<ea>Effective address
<ea>y,<ea>xSource and destination effective addresses, respectively
<label>Assembly language program label
<list>List of registers for MOVEM instruction (example: D3–D0)
<shift>Shift operation: shift left (<<), shift right (>>)
<size>Operand data size: byte (B), word (W), longword (L)
bcBoth instruction and data caches
xlviMCF5407 User’s Manual
Page 47
Terminology Conventions
Table ii Notational Conventions (Continued)
InstructionOperand Syntax
dcData cache
icInstruction cache
# <vector>Identifies the 4-bit vector number for trap instructions
<>identifies an indirect data address referencing memory
<xxx>identifies an absolute address referencing memory
dnSignal displacement value, n bits wide (example: d16 is a 16-bit displacement)
SFScale factor (x1, x2, x4 for indexed addressing mode, <<1n>> for MAC operations)
Operations
+Arithmetic addition or postincrement indicator
–Arithmetic subtraction or predecrement indicator
xArithmetic multiplication
/Arithmetic division
~Invert; operand is logically complemented
&Logical AND
|Logical OR
^Logical exclusive OR
<<Shift left (example: D0 << 3 is shift D0 left 3 bits)
>>Shift right (example: D0 >> 3 is shift D0 right 3 bits)
→Source operand is moved to destination operand
←→Two operands are exchanged
sign-extendedAll bits of the upper portion are made equal to the high-order bit of the lower portion
If <condition>
then
<operations>
else
<operations>
Test the condition. If true, the operations after ‘then’ are performed. If the condition is f alse and the
optional ‘else’ clause is present, the operations after ‘else’ are performed. If the condition is false
and else is omitted, the instruction performs no operation. Refer to the Bcc instruction description
as an example.
About This Book xlvii
Page 48
Terminology Conventions
Table ii Notational Conventions (Continued)
InstructionOperand Syntax
Subfields and Qualifiers
{}Optional operation
()Identifies an indirect address
d
n
AddressCalculated effective address (pointer)
BitBit selection (example: Bit 3 of D0)
lsbLeast significant bit (example: lsb of D0)
LSBLeast significant byte
LSWLeast significant word
msbMost significant bit
MSBMost significant byte
MSWMost significant word
CCarry
NNegative
VOverflow
XExtend
ZZero
Displacement value, n-bits wide (example: d16 is a 16-bit displacement)
Condition Code Register Bit Names
xlviiiMCF5407 User’s Manual
Page 49
Chapter 1
Overview
This chapter provides an overvie w of the MCF5272 microprocessor features, including the
major functional components.
1.1 MCF5272 Key Features
A block diagram of the MCF5272 is shown in Figure 1-1. The main features are as follows:
•Static Version 2 ColdFire variable-length RISC processor
— 32-bit address and data path on-chip
— 66-MHz processor core and bus frequency
— Sixteen general-purpose 32-bit data and address registers
— Multiply-accumulate unit (MAC) for DSP and fast multiply operations
•On-chip memories
— 4-Kbyte SRAM on CPU internal bus
— 16-Kbyte ROM on CPU internal bus
— 1-Kbyte instruction cache
•Power management
— Fully-static operation with processor sleep and whole-chip stop modes
— Very rapid response to interrupts from the low-power sleep mode (wake-up
feature)
— Clock enable/disable for each peripheral when not used
— Software-controlled disable of external clock input for virtually zero power
consumption (low-power stop mode)
•Two universal asynchronous/synchronous receiver transmitters (UARTs)
— Full-duplex operation
— Based on MC68681 dual-UART (DUART) programming model
— Flexible baud rate generator
— Modem control signals available (CTS
— Processor interrupt and wake-up capability
— Enhanced Tx, Rx FIFOs, 24 bytes each
•Universal serial bus (USB) module
— 12 Mbps (full-speed)
— Fully compatible with USB 1.1 specifications
— Eight endpoints (control, bulk, interrupt Rx, isochronous)
— Endpoint FIFOs
— Selectable on-chip analog interface
•External memory interface
— External glueless 8, 16, and 32-bit SRAM and ROM interface bus
— SDRAM controller supports 16–256 Mbit devices
— External bus configurable for 16 or 32 bits width for SDRAM
— Glueless interface to SRAM devices with or without byte strobe inputs
— Programmable wait state generator
•Queued serial peripheral interface (QSPI)
— Full-duplex, three-wire synchronous transfer
— Up to four chip selects available
— Master operation
— Programmable master bit rates
— Up to 16 preprogrammed transfers
– Input capture and output compare pins for timers 1 and 2
– Programmable prescaler
— 15-nS resolution at 66-MHz clock frequency
— Software watchdog timer
— Software watchdog can generate interrupt before reset
— Processor interrupt for each timer
•Pulse width modulation (PWM) unit
— Three identical channels
— Independent prescaler TAP point
— Period/duty range variable
Chapter 1. Overview 1-3
Page 52
MCF5272 Architecture
•System integration module (SIM)
— System configuration including internal and external address mapping
— System protection by hardware watchdog
— Versatile programmable chip select signals with wait state generation logic
— Up to three 16-bit parallel input/output ports
— Latchable interrupt inputs with programmable priority and edge triggering
— Programmable interrupt vectors for on-chip peripherals
•Physical layer interface controller (PLIC)
— Allows connection using general circuit interface (GCI) or interchip digital link
(IDL) physical layer protocols for 2B + D data
— Three physical interfaces
— Four time-division multiplex (TDM) ports
•IEEE 1149.1 boundary-scan test access port (JTAG) for board-level testing
•Operating voltage: 3.3 V ±0.3 V
•Operating temperature: 0
°
–70
°
C
•Operating frequency: DC to 66 MHz, from external CMOS oscillator
This section briefly describes the MCF5272 core, SIM, UART , and timer modules, and test
access port.
1.2.1 Version 2 ColdFire Core
Based on the concept of variable-length RISC technology, ColdFire combines the
simplicity of conventional 32-bit RISC architectures with a memory-saving,
variable-length instruction set. The main features of the MCF5272 core are as follows:
•32-bit address bus directly addresses up to 4 Gbytes of address space
•32-bit data bus
•Variable-length RISC
•Optimized instruction set for high-level language constructs
•Sixteen general-purpose 32-bit data and address registers
•MAC unit for DSP applications
•Supervisor/user modes for system protection
•Vector base register to relocate exception-vector table
•Special core interfacing signals for integrated memories
•Full debug support
1-4
MCF5272 User’s Manual
Page 53
MCF5272 Architecture
The Version 2 ColdFire core has a 32-bit address bus and a 32-bit data bus. The address bus
allows direct addressing of up to 4 Gbytes. It supports misaligned data accesses and a bus
arbitration unit for multiple bus masters.
The Version 2 ColdFire supports an enhanced subset of the 68000 instruction set. The MAC
provides new instructions for DSP applications; otherwise, Version 2 ColdFire user code
runs unchanged on 68020, 68030, 68040, and 68060 processors. The removed instructions
include BCD, bit field, logical rotate, decrement and branch, integer division, and integer
multiply with a 64-bit result. Also, four indirect addressing modes have been eliminated.
The ColdFire 2 core incorporates a complete debug module that provides real-time trace,
background debug mode, and real-time debug support.
1.2.2 System Integration Module (SIM)
The MCF5272 SIM provides the external bus interface for the ColdFire 2 architecture. It
also eliminates most or all of the glue logic that typically supports the microprocessor and
its interface with the peripheral and memory system. The SIM provides programmable
circuits to perform address-decoding and chip selects, wait-state insertion, interrupt
handling, clock generation, discrete I/O, and power management features.
1.2.2.1 External Bus Interface
The external bus interface (EBI) handles the transfer of information between the internal
core and memory , peripherals, or other processing elements in the external address space.
1.2.2.2 Chip Select and Wait State Generation
Programmable chip select outputs provide signals to enable external memory and
peripheral circuits, providing all handshaking and timing signals for automatic wait-state
insertion and data bus sizing.
Base memory address and block size are programmable, with some restrictions. For
example, the starting address must be on a boundary that is a multiple of the block size.
Each chip select is general purpose; however, any one of the chip selects can be
programmed to provide read and write enable signals suitable for use with most popular
static RAMs and peripherals. Data bus width (8-bit, 16-bit, or 32-bit) is programmable on
all chip selects, and further decoding is available for protection from user mode access or
read-only access.
1.2.2.3 System Configuration and Protection
The SIM provides configuration registers that allow general system functions to be
controlled and monitored. For example, all on-chip registers can be relocated as a block by
programming a module base address, power management modes can be selected, and the
source of the most recent RESET or BERR can be checked. The hardware watchdog
features can be enabled or disabled, and the bus time-out period can be programmed.
Chapter 1. Overview 1-5
Page 54
MCF5272 Architecture
A software watchdog timer is also provided for system protection. If programmed, the
timer causes a reset to the MCF5272 if it is not refreshed periodically by software.
1.2.2.4 Power Management
The sleep and stop power management modes reduce power consumption by allowing
software to shut down the core, peripherals, or the whole device during inacti v e periods. To
reduce power consumption further , software can individually disable internal clocks to the
on-chip peripheral modules. The power-saving modes are described as follows:
•Sleep mode uses interrupt control logic to allow any interrupt condition to wake the
processor. As the MCF5272 is fully static, sleep mode is simply the disabling of the
core’s clock after the current instruction completes. An interrupt from any internal
or external source causes on-chip power management logic to reenable the core’s
clock; execution resumes with the next instruction. This allows rapid return from
power-down state as compared to a dynamic implementation that must perform
power-on reset processing before software can handle the interrupt request. If
interrupts are enabled at the appropriate priority level, program control passes to the
relevant interrupt service routine.
•Stop mode is entered by the disabling of the external clock input and is achieved by
software setting a bit in a control register . Program e xecution stops after the current
instruction. In stop mode, neither the core nor peripherals are active. The MCF5272
consumes very little power in this mode. To resume normal operation, the external
interrupts cause the power management logic to re-enable the external clock input.
The MCF5272 resumes program execution from where it entered stop mode (if no
interrupt are pending), or starts interrupt exception processing if interrupts are
pending.
1.2.2.5 Parallel Input/Output Ports
The MCF5272 has up to three 16-bit general-purpose parallel ports, each line of which can
be programmed as either an input or output. Some port lines have dedicated pins and others
are shared with other MCF5272 functions. Some outputs have high driv e current capability .
1.2.2.6 Interrupt Inputs
The MCF5272 has flexible latched interrupt inputs each of which can generate a separate,
maskable interrupt with programmable interrupt priority level and triggering edge (falling
or rising). Each interrupt has its own interrupt vector.
1.2.3 UART Module
The MCF5272 has two full-duplex UART modules with an on-chip baud rate generator
providing both standard and non-standard baud rates up to 5 Mbps. The module is
functionally equivalent to the MC68681 DU ART with enhanced features including 24-byte
Tx and Rx FIFOs. Data formats can be 5, 6, 7, or 8 bits with even, odd, or no parity and up
1-6
MCF5272 User’s Manual
Page 55
System Design
to 2 stop bits in 1/16-bit increments. Receive and transmit FIFOs minimize CPU service
calls. A wide variety of error detection and maskable interrupt capability is provided.
Using a programmable prescaler or an external source, the MCF5272 system clock
supports various baud rates. Modem support is provided with request-to-send (R
clear-to-send (CTS
loopback, and remote loopback modes can be selected.
The UART can be programmed to interrupt or wake-up the CPU on various normal or
abnormal events. To reduce power consumption, the UART can be disabled by software if
not in use.
) lines available externally. Full-duplex autoecho loopback, local
TS) and
1.2.4 Timer Module
The timer module contains five timers arranged in two submodules. One submodule
contains a programmable software watchdog timer. The other contains four independent,
identical general-purpose timer units, each containing a free-running 16-bit timer for use in
various modes, including capturing the timer value with an external event, counting
external events, or triggering an external signal or interrupting the CPU when the timer
reaches a set value. Each unit has an 8-bit prescaler for deriving the clock input frequency
from the system clock or external clock input. The output pin associated with each timer
has programmable modes.
To reduce power consumption, the timer module can be disabled by software.
1.2.5 Test Access Port
For system diagnostics and manufacturing testing, the MCF5272 includes user-accessible
test logic that complies with the IEEE 1149.1 standard for boundary scan testing, often
referred to as JTAG (Joint Test Action Group). The IEEE 1149.1 Standard provides more
information.
1.3 System Design
This section presents issues to consider when designing with the MCF5272. It describes
differences between the MCF5272 (core and peripherals) and various other standard
components that are replaced by moving to an integrated device like the MCF5272.
1.3.1 System Bus Configuration
The MCF5272 has flexibility in its system bus interfacing due to the dynamic bus sizing
feature in which 32-,16-, and 8-bit data bus sizes are programmable on a per-chip select
basis. The programmable nature of the strobe signals (including OE
CS
n
) should ensure that external decode logic is minimal or nonexistent. Configuration
software is required upon power-on reset before chip-selected devices can be used, except
Chapter 1. Overview 1-7
/RD, R/W , BS[3:0], and
Page 56
MCF5272-Specific Features
for chip select 0 (CS0
BUSW1 and BUSW0 select the initial data bus width for CS0
mode or a restart from stop mode does not require reconfiguration of the chip select
registers or other system configuration registers.
), which is active after power-on reset until programmed otherwise.
only . A wake-up from sleep
1.4 MCF5272-Specific Features
This section describes features peculiar to the MCF5272.
1.4.1 Physical Layer Interface Controller (PLIC)
The physical layer interface controller (PLIC) allows the MCF5272 to connect at a physical
level with external CODECs and other peripheral de vices that use either the general circuit
interface (GCI), or interchip digital link (IDL), physical layer protocols. This module is
primarily intended to facilitate designs that include ISDN interfaces.
1.4.2 Pulse-Width Modulation (PWM) Unit
The PWM unit is intended for use in control applications. W ith a suitable low-pass filter, it
can be used as a digital-to-analog converter. This module generates a synchronous series of
pulses. The duty cycle of the pulses is under software control.
Its main features include the following:
•Double-buffered width register
•Variable-divide prescale
•Three identical, independent PWM modules
•Byte-wide width register provides programmable control of duty cycle.
The PWM implements a simple free-running counter with a width register and comparator
such that the output is cleared when the counter exceeds the value of the width register.
When the counter wraps around, its value is not greater than the width register value, and
the output is set high. With a suitable low-pass filter, the PWM can be used as a
digital-to-analog converter.
1.4.3 Queued Serial Peripheral Interface (QSPI)
The QSPI module provides a serial peripheral interface with queued transfer capability. It
supports up to 16 stacked transfers at a time, making CPU intervention between transfers
unnecessary. Transfer RAMs in the QSPI are indirectly accessible using address and data
registers. Functionality is similar to the QSPI portion of the QSM (queued serial module)
implemented in the MC68332.
The QSPI has the following features:
•Programmable queue to support up to 16 transfers without user intervention
1-8
MCF5272 User’s Manual
Page 57
MCF5272-Specific Features
•Supports transfer sizes of 8 to 16 bits in 1-bit increments
•Four peripheral chip-select lines for control of up to 15 devices
•Baud rates from 129.4 Kbps to 33 Mbps at 66 MHz.
•Programmable delays before and after transfers
•Programmable clock phase and polarity
•Supports wrap-around mode for continuous transfers
1.4.4 Universal Serial Bus (USB) Module
The USB controller on the MCF5272 supports device mode data communications with a
USB host (typically a PC). One host and up to 127 attached peripherals share USB
bandwidth through a host-scheduled, token-based protocol. The USB uses a tiered star
topology with a hub at the center of each star. Each wire segment is a point-to-point
connection between the host connector and a peripheral connector.
Chapter 1. Overview 1-9
Page 58
MCF5272-Specific Features
1-10MCF5272 User’s Manual
Page 59
Chapter 2
ColdFire Core
This chapter provides an overview of the microprocessor core of the MCF5272. The
chapter describes the V2 programming model as it is implemented on the MCF5272. It also
includes a full description of exception handling, data formats, an instruction set summary ,
and a table of instruction timings.
2.1 Features and Enhancements
The MCF5272 is the most highly-integrated V2 standard product, containing a variety of
communications and general-purpose peripherals. The V2 core was designed to maximize
code density and performance while minimizing die area.
The following list summarizes MCF5272 features:
•Variable-length RISC Version 2 microprocessor core
•Vector base register to relocate exception-vector table
•Optimized for high-level language constructs
2.1.1 Decoupled Pipelines
The IFP prefetches instructions. The OEP decodes instructions, fetches required operands,
then executes the specified function. The two independent, decoupled pipeline structures
maximize performance while minimizing core size. Pipeline stages are shown in Figure 2-1
and are summarized as follows:
•Two-stage IFP (plus optional instruction buffer stage)
— Instruction address generation (IAG) calculates the next prefetch address.
Chapter 2. ColdFire Core 2-11
Page 60
Features and Enhancements
— Instruction fetch cycle (IC) initiates prefetch on the processor’ s local instruction
bus.
— Instruction buffer (IB) optional stage uses FIFO queue to minimize effects of
fetch latency.
•Two-stage OEP
— Decode, select/operand fetch (DSOC) decodes the instruction and selects the
required components for the effective address calculation, or the operand fetch
cycle.
— Address generation/execute (A GEX) calculates the operand address, or performs
the execution of the instruction.
Instruction
IAG
Address
Generation
IC
Instruction
Fetch Cycle
Address [31:0]
Instruction
Fetch
Pipeline
FIFO
Instruction Buffer
Decode & Select,
Operand Fetch
Data[31:0]
Operand
IB
DSOC
Execution
Pipeline
AGEX
Address
Generation,
Execute
Figure 2-1. ColdFire Pipeline
2.1.1.1 Instruction Fetch Pipeline (IFP)
The IFP generates instruction addresses and fetches. Because the fetch and execution
pipelines are decoupled by a 3 longword FIFO buffer, the IFP can prefetch instructions
before the OEP needs them, minimizing stalls.
2-12MCF5272 User’s Manual
Page 61
Features and Enhancements
2.1.1.2 Operand Execution Pipeline (OEP)
The OEP is a two-stage pipeline featuring a traditional RISC datapath with a register file
feeding an arithmetic/logic unit (ALU). For simple register-to-re gister instructions, the first
stage of the OEP performs the instruction decode and fetching of the required register
operands (OC), while the actual instruction execution is performed in the second stage
(EX).
For memory-to-register instructions, the instruction is effectively staged through the OEP
twice in the following way:
•The instruction is decoded and the components of the operand address are selected
(DS).
•The operand address is generated using the execute engine (AG).
•The memory operand is fetched while any register operand is simultaneously
fetched (OC).
•The instruction is executed (EX).
For register-to-memory operations, the stage functions (DS/OC, AG/EX) are effectively
performed simultaneously allowing single-cycle execution. For read-modify-write
instructions, the pipeline effectiv ely combines a memory-to-register operation with a store
operation.
2.1.1.2.1 Illegal Opcode Handling
On Version 2 ColdFire implementations, only some illegal opcodes (0x0000 and 0x4AFC)
are decoded and generate an illegal instruction exception. Additionally, attempting to
execute an illegal line A or line F opcode generates unique exception types. If any other
unsupported opcode is executed, the resulting operation is undefined.
2.1.1.2.2 Hardware Multiply/Accumulate (MAC) Unit
The MAC is an optional unit in Version 2 that provides hardware support for a limited set
of digital signal processing (DSP) operations used in embedded code, while supporting the
integer multiply instructions in the ColdFire microprocessor family. The MAC features a
three-stage execution pipeline, optimized for 16 x 16 multiplies. It is tightly coupled to the
OEP, which can issue a 16 x 16 multiply with a 32-bit accumulation plus fetch a 32-bit
operand in a single cycle. A 32 x 32 multiply with a 32-bit accumulation requires three
cycles before the next instruction can be issued.
Figure 2-2 shows basic functionality of the MAC. A full set of instructions are pro vided for
signed and unsigned integers plus signed, fixed-point fractional input operands.
The MAC provides functionality in the following three related areas, which are described
in detail in Chapter 3, “Hardware Multiply/Accumulate (MAC) Unit.”
•Signed and unsigned integer multiplies
•Multiply-accumulate operations with signed and unsigned fractional operands
•Miscellaneous register operations
2.1.1.2.3 Hardware Divide Unit
The hardware divide unit performs the following integer division operations:
•32-bit operand/16-bit operand producing a 16-bit quotient and a 16-bit remainder
•32-bit operand/32-bit operand producing a 32-bit quotient
•32-bit operand/32-bit operand producing a 32-bit remainder
2.1.2 Debug Module Enhancements
The ColdFire processor core debug interface supports system integration in conjunction
with low-cost development tools. Real-time trace and debug information can be accessed
through a standard interface, which allows the processor and system to be debugged at full
speed without costly in-circuit emulators. On-chip breakpoint resources include the
following:
•Configuration/status register (CSR)
•Bus attributes and mask register (AATR)
•Breakpoint registers. These can be used to define triggers combining address, data,
and PC conditions in single- or dual-level definitions. They include the following:
— PC breakpoint register (PBR)
— PC breakpoint mask register (PBMR)
2-14MCF5272 User’s Manual
Page 63
Programming Model
— Data operand address breakpoint registers (ABHR/ABLR)
— Data breakpoint register (DBR)
•Data breakpoint mask register (DBMR)
•Trigger definition register (TDR) can be programmed to generate a processor halt or
initiate a debug interrupt exception.
These registers can be accessed through the dedicated debug serial communication channel,
or from the processor’s supervisor programming model, using the WDEBUG instruction.
2.2 Programming Model
The MCF5272 programming model consists of three instruction and register groups—user,
MAC (also user-mode), and supervisor, shown in Figure 2-2. User mode programs are
restricted to user and MAC instructions and programming models. Supervisor-mode
system software can reference all user-mode and MAC instructions and registers and
additional supervisor instructions and control registers. The user or supervisor
programming model is selected based on SR[S]. The following sections describe the
registers in the user, MAC, and supervisor programming models.
MACSRMAC status register
ACCMAC accumulator
MASKMAC mask register
CACRCache control register
ACR0Access control register 0
ACR1Access control register 1
ROMBARROM base address register
RAMBARRAM base address register
MBARModule base address register
Figure 2-3. ColdFire Programming Model
2.2.1 User Programming Model
As Figure 2-3 shows, the user programming model consists of the following registers:
•16 general-purpose 32-bit registers, D0–D7 and A0–A7
•32-bit program counter
•8-bit condition code register
2.2.1.1 Data Registers (D0–D7)
Registers D0–D7 are used as data registers for bit, byte (8-bit), word (16-bit), and longword
(32-bit) operations. They may also be used as index registers.
2.2.1.2 Address Registers (A0–A6)
The address registers (A0–A6) can be used as software stack pointers, index registers, or
base address registers and may be used for word and longword operations.
2-16MCF5272 User’s Manual
Page 65
Programming Model
2.2.1.3 Stack Pointer (A7, SP)
The processor core supports a single hardware stack pointer (A7) used during stacking for
subroutine calls, returns, and exception handling. The stack pointer is implicitly referenced
by certain operations and can be explicitly referenced by any instruction specifying an
address register. The initial value of A7 is loaded from the reset exception vector, address
0x0000. The same register is used for user and supervisor modes, and may be used for word
and longword operations.
A subroutine call saves the program counter (PC) on the stack and the return restores the
PC from the stack. The PC and the status register (SR) are saved on the stack during
exception and interrupt processing. The return from exception instruction restores SR and
PC values from the stack.
2.2.1.4 Program Counter (PC)
The PC holds the address of the executing instruction. For sequential instructions, the
processor automatically increments PC. When program flow changes, the PC is updated
with the target instruction. For some instructions, the PC specifies the base address for
PC-relative operand addressing modes.
2.2.1.5 Condition Code Register (CCR)
The CCR, Figure 2-4, occupies SR[7–0], as shown in Figure 2-3. CCR[4–0] are indicator
flags based on results generated by arithmetic operations.
76543210
Field—XNZVC
Reset000Undefined
R/WRR/WR/WR/WR/WR/W
Figure 2-4. Condition Code Register (CCR)
CCR fields are described in Table 2-1.
Table 2-1. CCR Field Descriptions
Bits NameDescription
7–5—Reserved, should be cleared.
4XExtend condition code bit. Assigned the value of the carry bit for arithmetic operations; otherwise not
3NNegative condition code bit. Set if the msb of the result is set; otherwise cleared.
2ZZero condition code bit. Set if the result equals zero; otherwise cleared.
1VOverflow condition code bit. Set if an arithmetic overflow occurs, implying that the result cannot be
0CCarry condition code bit. Set if a carry-out of the data operand msb occurs for an addition or if a
affected or set to a specified result. Also used as an input operand for multiple-precision arithmetic.
represented in the operand size; otherwise cleared.
borrow occurs in a subtraction; otherwise cleared.
Chapter 2. ColdFire Core 2-17
Page 66
Programming Model
2.2.1.6 MAC Programming Model
Figure 2-3 shows the registers in the MAC portion of the user programming model. These
registers are described as follows:
•Accumulator (ACC)—This 32-bit, read/write, general-purpose register is used to
accumulate the results of MAC operations.
•Mask register (MASK)—This 16-bit general-purpose register provides an optional
address mask for MAC instructions that fetch operands from memory. It is useful in
the implementation of circular queues in operand memory.
•MAC status register (MACSR)—This 8-bit register defines configuration of the
MAC unit and contains indicator flags af fected by MAC instructions. Unless noted
otherwise, MACSR indicator flag settings are based on the final result, that is, the
result of the final operation involving the product and accumulator.
2.2.2 Supervisor Programming Model
The MCF5272 supervisor programming model is shown in Figure 2-3. Typically, system
programmers use the supervisor programming model to implement operating system
functions and provide memory and I/O control. The supervisor programming model
provides access to the user registers and additional supervisor registers, which include the
upper byte of the status register (SR), the vector base register (VBR), and registers for
configuring attributes of the address space connected to the Version 2 processor core. Most
supervisor-mode registers are accessed by using the MOVEC instruction with the control
register definitions in Table 2-2.
Table 2-2. MOVEC Register Map
Rc[11–0]Register Definition
0x002Cache control register (CACR)
0x004Access control register 0 (ACR0)
0x005Access control register 1 (ACR1)
0x801Vector base register (VBR)
0xC00ROM base address register
0xC04RAM base address register (RAMBAR)
0xC0FModule base address register (MBAR)
2.2.2.1 Status Register (SR)
The SR stores the processor status, the interrupt priority mask, and other control bits.
Supervisor software can read or write the entire SR; user software can read or write only
SR[7–0], described in Section 2.2.1.5, “Condition Code Register (CCR).” The control bits
indicate processor states—trace mode (T), supervisor or user mode (S), and master or
interrupt state (M). SR is set to 0x27xx after reset.
2-18MCF5272 User’s Manual
Page 67
Programming Model
15870
System byteCondition code register (CCR)
FieldT—SM—I—XNZVC
Reset00100 111000—————
R/W R/WRR/W R/WRR/WRR/W R/W R/W R/W R/W
Figure 2-5. Status Register (SR)
Table 2-3 describes SR fields.
Table 2-3. Status Field Descriptions
BitsNameDescription
15TTrace enable. When T is set, the processor performs a trace exception after every instruction.
13SSupervisor/user state. Indicates whether the processor is in supervisor or user mode
12MMaster/interrupt state. Cleared by an interrupt exception. It can be set by software during execution
10–8IInterrupt priority mask. Defines the current interrupt priority. Interrupt requests are inhibited for all
7–0CCR Condition code register. See Table 2-4.
0 User mode
1 Supervisor mode
of the RTE or move to SR instructions so the OS can emulate an interrupt stack pointer.
priority levels less than or equal to the current priority, except the edge-sensitive level-7 request,
which cannot be masked.
2.2.2.2 Vector Base Register (VBR)
The VBR holds the base address of the exception vector table in memory . The displacement
of an exception vector is added to the value in this register to access the vector table.
VBR[19–0] are not implemented and are assumed to be zero, forcing the vector table to be
aligned on a 0-modulo-1-Mbyte boundary.
3120 190
Field Exception vector table base address—
Reset0000_0000_0000_0000_0000_0000_0000_0000
R/W Written from a BDM serial command or from the CPU using the MOVEC instruction. VBR can be read from
Rc[11–0]0x801
the debug module only. The upper 12 bits are returned, the low-order 20 bits are undefined.
Figure 2-6. Vector Base Register (VBR)
2.2.2.3 Cache Control Register (CACR)
The CACR controls operation of both the instruction and data cache memory. It includes
bits for enabling, freezing, and inv alidating cache contents. It also includes bits for defining
the default cache mode and write-protect fields. See Section 4.5.3.1, “Cache Control
Register (CACR).”
Chapter 2. ColdFire Core 2-19
Page 68
Integer Data Formats
2.2.2.4 Access Control Registers (ACR0–ACR1)
The access control registers (ACR0–ACR1) define attributes for two user-defined memory
regions. Attributes include definition of cache mode, write protect and buf fer write enables.
See Section 4.5.3.2, “Access Control Registers (ACR0 and ACR1).”
2.2.2.5 ROM Base Address Register (ROMBAR)
The ROMBAR base address register determines the base address of the internal ROM
module and indicates the types of references mapped to it. The ROMBAR includes a base
address, write-protect bit, address space mask bits, and an enable. Note that the MCF5272
ROM contains data for the HDLC module and is not user programmable. See
Section 4.4.2.1, “ROM Base Address Register (ROMBAR).”
2.2.2.6 RAM Base Address Register (RAMBAR)
The RAMBAR register determines the base address location of the internal SRAM module
and indicates the types of references mapped to it. The RAMBAR includes a base address,
write-protect bit, address space mask bits, and an enable. The RAM base address must be
aligned on a 0-modulo-4-Kbyte boundary. See Section 4.3.2.1, “SRAM Base Address
Register (RAMBAR).”
2.2.2.7 Module Base Address Register (MBAR)
The module base address register (MBAR) defines the logical base address for the
memory-mapped space containing the control registers for the on-chip peripherals. See
Section 6.2.2, “Module Base Address Register (MBAR).”
2.3 Integer Data Formats
Table 2-4 lists the integer operand data formats. Integer operands can reside in registers,
memory, or instructions. The operand size for each instruction is either explicitly encoded
in the instruction or implicitly defined by the instruction operation.
Table 2-4. Integer Data Formats
Operand Data FormatSize
Bit1 bit
Byte integer8 bits
Word integer16 bits
Longword integer32 bits
2.4 Organization of Data in Registers
The following sections describe data organization within the data, address, and control
registers.
2-20MCF5272 User’s Manual
Page 69
Organization of Data in Registers
2.4.1 Organization of Integer Data Formats in Registers
Figure 2-7 shows the integer format for data registers. Each integer data register is 32 bits
wide. Byte and word operands occupy the lower 8- and 16-bit portions of integer data
registers, respectively. Longword operands occupy the entire 32 bits of integer data
registers. A data re gister that is either a source or destination operand only uses or changes
the appropriate lower 8 or 16 bits in byte or word operations, respectively. The remaining
high-order portion does not change. The least significant bit (lsb) of all integer sizes is zero,
the most-significant bit (msb) of a longword integer is 31, the msb of a word integer is 15,
and the msb of a byte integer is 7.
31 3010
msblsbBit (0 ≤ bit number ≤ 31)
318 7 610
Not usedmsb Low order byte lsbByte (8 bits)
3116 151410
Not usedmsbLower order wordlsbWord (16 bits)
31 3010
msbLongwordlsbLongword (32 bits)
Figure 2-7. Organization of Integer Data Formats in Data Registers
The instruction set encodings do not allow the use of address registers for byte-sized
operands. When an address register is a source operand, either the low-order word or the
entire longword operand is used, depending on the operation size. Word-length source
operands are sign-extended to 32 bits and then used in the operation with an address register
destination. When an address register is a destination, the entire register is affected,
regardless of the operation size. Figure 2-8 shows integer formats for address registers.
3116 150
Sign-Extended16-Bit Address Operand
310
Full 32-Bit Address Operand
Figure 2-8. Organization of Integer Data Formats in Address Registers
The size of control registers varies according to function. Some have undefined bits
reserved for future definition by Motorola. Those particular bits read as zeros and must be
written as zeros for future compatibility.
All operations to the SR and CCR are word-size operations. For all CCR operations, the
upper byte is read as all zeros and is ignored when written, regardless of privilege mode.
Chapter 2. ColdFire Core 2-21
Page 70
Addressing Mode Summary
2.4.2 Organization of Integer Data Formats in Memory
All ColdFire processors use a big-endian addressing scheme. The byte-addressable
organization of memory allows lower addresses to correspond to higher order bytes. The
address N of a longword data item corresponds to the address of the high-order word. The
lower order word is located at address N + 2. The address N of a word data item corresponds
to the address of the high-order byte. The lower order byte is located at address N + 1. This
organization is shown in Figure 2-9.
Addressing modes are categorized by how they are used. Data addressing modes refer to
data operands. Memory addressing modes refer to memory operands. Alterable addressing
modes refer to alterable (writable) data operands. Control addressing modes refer to
memory operands without an associated size.
These categories sometimes combine to form more restrictive categories. Two combined
classifications are alterable memory (both alterable and memory) and data alterable (both
alterable and data). Twelve of the most commonly used effective addressing modes from
the M68000 Family are available on ColdFire microprocessors. Table 2-5 summarizes
these modes and their categories.
2-22MCF5272 User’s Manual
Page 71
Instruction Set Summary
Table 2-5. ColdFire Effective Addressing Modes
—
—
X
X
X
X
X
X
Category
—
—
X
—
—
X
X
X
Addressing ModesSyntax
Register direct
Data
Address
Register indirect
Address
Address with
Postincrement
Address with
Predecrement
Address with
Displacement
Address register indirect with
scaled index
8-bit displacement
Program counter indirect
with displacement(d
Program counter indirect
with scaled index
8-bit displacement
Absolute data addressing
Short
Long
Immediate#<xxx>111100XX——
Dn
An
(An)
(An)+
–(An)
(d
16
(d
8
Xi*SF)
16
(d
8
Xi*SF)
(xxx).W
(xxx).L
Mode
Field
000
001
010
011
100
, An)
, An,
, PC)111010XXX—
, PC,
101
110reg. no.XXXX
111011XXX—
111
111
Reg.
Field
reg. no.
reg. no.X—
reg. no.
reg. no.
reg. no.
reg. no.
DataMemoryControlAlterable
000
001
X
X
X
X
X
X
2.6 Instruction Set Summary
X
X
X
X
X
X
—
—
The ColdFire instruction set is a simplified version of the M68000 instruction set. The
removed instructions include BCD, bit field, logical rotate, decrement and branch, and
integer multiply with a 64-bit result. Nine new MAC instructions have been added.
Table 2-6 lists notational conventions used throughout this manual.
Chapter 2. ColdFire Core 2-23
Page 72
Instruction Set Summary
Table 2-6. Notational Conventions
InstructionOperand Syntax
Opcode Wildcard
ccLogical condition (example: NE for not equal)
Register Specifications
AnAny address register n (example: A3 is address register 3)
Ay,AxSource and destination address registers, respectively
DnAny data register n (example: D5 is data register 5)
Dy,DxSource and destination data registers, respectively
RcAny control register (example VBR is the vector base register)
RmMAC registers (ACC, MAC, MASK)
RnAny address or data register
RwDestination register w (used for MAC instructions only)
Ry,RxAny source and destination registers, respectively
Xiindex register i (can be an address or data register: Ai, Di)
Register Names
ACCMAC accumulator register
CCRCondition code register (lower byte of SR)
MACSRMAC status register
MASKMAC mask register
PCProgram counter
SRStatus register
Port Names
DDATADebug data port
PSTProcessor status port
Miscellaneous Operands
#<data>Immediate data following the 16-bit operation word of the instruction
<ea>Effective address
<ea>y,<ea>xSource and destination effective addresses, respectively
<label>Assembly language program label
<list>List of registers for MOVEM instruction (example: D3–D0)
<shift>Shift operation: shift left (<<), shift right (>>)
<size>Operand data size: byte (B), word (W), longword (L)
bcInstruction cache
# <vector>Identifies the 4-bit vector number for trap instructions
<>identifies an indirect data address referencing memory
<xxx>identifies an absolute address referencing memory
2-24MCF5272 User’s Manual
Page 73
Instruction Set Summary
Table 2-6. Notational Conventions (Continued)
InstructionOperand Syntax
dnSignal displacement value, n bits wide (example: d16 is a 16-bit displacement)
SFScale factor (x1, x2, x4 for indexed addressing mode, <<1n>> for MAC operations)
Operations
+Arithmetic addition or postincrement indicator
–Arithmetic subtraction or predecrement indicator
xArithmetic multiplication
/Arithmetic division
~Invert; operand is logically complemented
&Logical AND
|Logical OR
^Logical exclusive OR
<<Shift left (example: D0 << 3 is shift D0 left 3 bits)
>>Shift right (example: D0 >> 3 is shift D0 right 3 bits)
→Source operand is moved to destination operand
←→Two operands are exchanged
sign-extendedAll bits of the upper portion are made equal to the high-order bit of the lower portion
If <condition>
then
<operations>
else
<operations>
{}Optional operation
()Identifies an indirect address
d
n
AddressCalculated effective address (pointer)
BitBit selection (example: Bit 3 of D0)
lsbLeast significant bit (example: lsb of D0)
LSBLeast significant byte
LSWLeast significant word
msbMost significant bit
MSBMost significant byte
MSWMost significant word
Test the condition. If the condition is true, the operations in the then clause are performed. If the
condition is false and the optional else clause is present, the operations in the else clause are
performed. If the condition is false and the else clause is omitted, the instruction performs no
operation. Refer to the Bcc instruction description as an example.
Subfields and Qualifiers
Displacement value, n-bits wide (example: d16 is a 16-bit displacement)
Chapter 2. ColdFire Core 2-25
Page 74
Instruction Set Summary
Table 2-6. Notational Conventions (Continued)
InstructionOperand Syntax
Condition Code Register Bit Names
CCarry
NNegative
VOverflow
XExtend
ZZero
2.6.1 Instruction Set Summary
Table 2-7 lists implemented user-mode instructions by opcode.
Table 2-7. User-Mode Instruction Set Summary
InstructionOperand SyntaxOperand SizeOperation
ADDDy,<ea>x
<ea>y,Dx
ADDA<ea>y,Ax.LSource + destination → destination
ADDI#<data>,Dx.LImmediate data + destination → destination
ADDQ#<data>,<ea>x.LImmediate data + destination → destination
ADDXDy,Dx.LSource + destination + X → destination
ANDDy,<ea>x
<ea>y,Dx
ANDI#<data>,Dx.LImmediate data & destination → destination
ASLDy,Dx
#<data>,Dx
ASRDy,Dx
#<data>,Dx
Bcc <label>.B,.W If condition true, then PC + 2 + dn → PC
BCHGDy,<ea>x
#<data>,<ea-1>x
BCLRDy,<ea>x
#<data>,<ea-1>x
BRA<label>.B,.WPC + 2 + d
BSETDy,<ea>x
#<data>,<ea-1>x
BSR<label>.B,.WSP – 4 → SP; next sequential PC→ (SP); PC + 2 + dn → PC
BTSTDy,<ea>x
By default the HALT instruction is a supervisor-mode instruction; however, it can be configured to allow user-mode
execution by setting CSR[UHE].
#<data>
Unsized
.W
.L
PC + 2 → PC
PC + 4 → PC
PC + 6 → PC
Table 2-8 describes supervisor-mode instructions.
Table 2-8. Supervisor-Mode Instruction Set Summary
InstructionOperand Syntax Operand SizeOperation
CPUSHL(bc),(Ax)UnsizedInvalidate instruction cache line
1
HALT
MOVE from SRSR, Dx.WSR → Dx
MOVE to SRDy,SR
MOVECRy,Rc.LRy → Rc
RTENoneUnsized(SP+2) → SR; SP+4 → SP; (SP) → PC; SP + formatfield SP
STOP#<data>.WImmediate data → SR; enter stopped state
WDEBUG<ea-2>y.L<ea-2>y → debug module
1
The HALT instruction can be configured to allow user-mode execution by setting CSR[UHE].
noneUnsizedEnter halted state
.WSource → SR
#<data>,SR
RcRegister Definition
0x002 Cache control register (CACR)
0x004 Access control register 0 (ACR0)
0x005 Access control register 1 (ACR1)
0x801 Vector base register (VBR)
0xC00 ROM base address register (ROMBAR)
0xC04 RAM base address register (RAMBAR)
0xC0F Module base address register (MBAR)
2.7 Instruction Timing
The timing data presented in this section assumes the following:
•The OEP is loaded with the opword and all required extension words at the
beginning of each instruction execution. This implies that the OEP spends no time
waiting for the IFP to supply opwords and/or extension words.
•The OEP experiences no sequence-related pipeline stalls. For the MCF5272,the
most common example of this type of stall involves consecutive store operations,
excluding the MOVEM instruction. For all store operations (except MOVEM),
Chapter 2. ColdFire Core 2-29
Page 78
Instruction Timing
certain hardware resources within the processor are marked as busy for two clock
cycles after the final DSOC cycle of the store instruction. If a subsequent store
instruction is encountered within this two-cycle window, it is stalled until the
resource again becomes available. Thus, the maximum pipeline stall involving
consecutive store operations is two cycles.
•The OEP can complete all memory accesses without memory causing any stall
conditions. Thus, timing details in this section assume an infinite zero-wait state
memory attached to the core.
•All operand data accesses are assumed to be aligned on the same byte boundary as
the operand size:
— 16-bit operands aligned on 0-modulo-2 addresses
— 32-bit operands aligned on 0-modulo-4 addresses
Operands that do not meet these guidelines are misaligned. T able 2-9 shows how the
core decomposes a misaligned operand reference into a series of aligned accesses.
Table 2-9. Misaligned Operand References
A[1:0]SizeBus OperationsAdditional C(R/W)
x1WordByte, Byte2(1/0) if read
x1LongByte, Word, Byte3(2/0) if read
10LongWord, Word2(1/0) if read
1
Each timing entry is presented as C(r/w), described as follows:
C is the number of processor clock cycles, including all applicable operand f etches and writes, as
well as all internal core cycles required to complete the instruction execution.
r/w is the number of operand reads (r) and writes (w) required by the instruction. An operation
performing a read-modify write function is denoted as (1/1).
1(0/1) if write
2(0/2) if write
1(0/1) if write
1
2.7.1 MOVE Instruction Execution Times
The execution times for the MOVE.{B,W,L} instructions are shown in the next tables.
Table 2-12 shows the timing for the other generic move operations.
NOTE:
For all tables in this section, the execution time of any
instruction using the PC-relative effective addressing modes is
equivalent to the time using comparable An-relative mode.
ET with {<ea> = (d16,PC)} equals ET with {<ea> = (d16,An)}
ET with {<ea> = (d8,PC,Xi*SF)} equals ET with {<ea> = (d8,An,Xi*SF)}
The nomenclature “(xxx).wl” refers to both forms of absolute
addressing, (xxx).w and (xxx).l.
2-30MCF5272 User’s Manual
Page 79
Table 2-10 lists execution times for MOVE.{B,W} instructions.
Table 2-12 gives execution times for MOVE.L instructions accessing program-visible
registers of the MAC unit, along with other MOVE.L timings. Execution times for moving
contents of the ACC or MACSR into a destination location represent the best-case scenario
when the store instruction is executed and no load, MAC, or MSAC instructions are in the
Chapter 2. ColdFire Core 2-31
Page 80
Instruction Timing
MAC execution pipeline. In general, these store operations require only one cycle for
execution, but if the y are preceded immediately by a load, MAC, or MSAC instruction, the
MAC pipeline depth is exposed and execution time is three cycles.
Exception processing for ColdFire processors is streamlined for performance. Differences
from previous M68000 Family processors include the following:
•A simplified exception vector table
•Reduced relocation capabilities using the vector base register
•A single exception stack frame format
•Use of a single, self-aligning system stack pointer
ColdFire processors use an instruction restart exception model but require more software
support to recover from certain access errors. See Table 2-18 for details.
Exception processing can be defined as the time from the detection of the fault condition
until the fetch of the first handler instruction has been initiated. It is comprised of the
following four major steps:
1. The processor makes an internal copy of the SR and then enters supervisor mode by
setting SR[S] and disabling trace mode by clearing SR[T]. The occurrence of an
interrupt exception also forces SR[M] to be cleared and the interrupt priority mask
to be set to the level of the current interrupt request.
2. The processor determines the exception vector number. For all faults except
interrupts, the processor performs this calculation based on the exception type. For
interrupts, the processor performs an interrupt-acknowledge (IACK) bus cycle to
obtain the vector number from a peripheral device. The IACK cycle is mapped to a
special acknowledge address space with the interrupt level encoded in the address.
3. The processor saves the current context by creating an exception stack frame on the
system stack. ColdFire processors support a single stack pointer in the A7 address
register; therefore, there is no notion of separate supervisor and user stack pointers.
As a result, the exception stack frame is created at a 0-modulo-4 address on the top
of the current system stack. Additionally, the processor uses a simplified
fixed-length stack frame for all exceptions. The exception type determines whether
the program counter in the exception stack frame defines the address of the faulting
instruction (fault) or of the next instruction to be executed (next).
4. The processor acquires the address of the first instruction of the exception handler.
The exception vector table is aligned on a 1-Mbyte boundary. This instruction
address is obtained by fetching a value from the table at the address defined in the
vector base register. The index into the exception table is calculated as
2-36MCF5272 User’s Manual
Page 85
Exception Processing Overview
4 x vector_number. When the index value is generated, the vector table contents
determine the address of the first instruction of the desired handler. After the fetch
of the first opcode of the handler is initiated, exception processing terminates and
normal instruction processing continues in the handler.
ColdFire processors support a 1024-byte vector table aligned on any 1-Mbyte address
boundary; see Table 2-18. The table contains 256 exception vectors where the first 64 are
defined by Motorola; the remaining 192 are user-defined interrupt vectors.
Table 2-18. Exception Vector Assignments
Vector NumbersVector Offset (Hex)Stacked Program Counter
0000—Initial stack pointer
1004—Initial program counter
2008Fault Access error
300CFaultAddress error
4010FaultIllegal instruction
5014FaultDivide by zero
The term ‘fault’ refers to the PC of the instruction that caused the exception. The term ‘next’ refers to the PC
of the instruction that immediately follows the instruction that caused the fault.
1
Assignment
ColdFire processors inhibit sampling for interrupts during the first instruction of all
exception handlers. This allows any handler to effectively disable interrupts, if necessary,
by raising the interrupt mask level contained in the status register.
Chapter 2. ColdFire Core 2-37
Page 86
Exception Processing Overview
2.8.1 Exception Stack Frame Definition
The exception stack frame is shown in Figure 2-10. The first longword of the exception
stack frame contains the 16-bit format/vector word (F/V) and the 16-bit status register. The
second longword contains the 32-bit program counter address.
3128 27262518 1716 150
A7→FormatFS[3–2]Vector[7–0]FS[1–0] Status Register
+ 0x04Program Counter [31–0]
Figure 2-10. Exception Stack Frame Form
The 16-bit format/vector word contains three unique fields:
•Format field—This 4-bit field at the top of the system stack is always written with a
value of {4,5,6,7} by the processor indicating a 2-longword frame format. See
Table 2-19. This field records any longword misalignment of the stack pointer that
may have existed when the exception occurred.
•Fault status field—The 4-bit field, FS[3–0], at the top of the system stack is defined
for access and address errors along with interrupted debug service routines. See
Table 2-20.
Table 2-20. Fault Status Encodings
FS[3–0]Definition
0000-001xReserved
0100Error on instruction fetch
0101–011xReserved
1000Error on operand write
1001Attempted write to write-protected space
101xReserved
1100Error on operand read
1101–111xReserved
2-38MCF5272 User’s Manual
Page 87
Exception Processing Overview
•Vector number—This 8-bit field, vector[7–0], defines the exception type. It is
calculated by the processor for internal faults and is supplied by the peripheral for
interrupts. See Table 2-18.
2.8.2 Processor Exceptions
Table 2-21 describes MCF5272 exceptions.
Table 2-21. MCF5272 Exceptions
ExceptionDescription
Access Error Caused by an error when accessing memory. For an access error on an instruction fetch, the
Address
Error
Illegal
Instruction
Divide by
Zero
Privilege
Violation
processor postpones the error reporting until the instruction at the faulted reference is executed.
Thus, faults that occur during instruction prefetches that are followed by a change of instruction flow
do not generate an exception. When the processor attempts to execute an instruction with a faulted
opword or extension word, the access error is signaled, and the instruction is aborted. For this type of
exception, the programming model is not altered by the faulted instruction.
If an access error occurs on an operand read, the processor immediately aborts the current
instruction execution and initiates exception processing. In this case, any address register changes
caused by the auto-addressing modes, (An)+ and -(An), have already occurred. In addition, if an
access error occurs during the execution of a MOVEM instruction loading from memory, registers
updated before the fault occurs contain the memory operand.
Due to the processor pipeline implementation, a write cycle may be decoupled from the execution of
the instruction causing the write. Thus, if an access error occurs on an operand write, the signaling of
the error is imprecise. Accordingly, the PC contained in the exception stack frame represents the
location in the program when the access error is signaled, not necessarily the instruction causing the
fault. All programming model updates associated with the write instruction are complete. The NOP
instruction can be used to help identify write access errors. A NOP is not executed until all previous
operations, including any pending writes are complete. Thus if any previous write terminates with an
access error, it is guaranteed to be reported on the NOP.
Caused by an attempted execution transf erring control to an odd instruction address (that is, if bit 0 of
the target address is set), an attempted use of a word-sized index register (Xi.w) or a scale factor of
8 on an indexed effectiv e addressing mode , or attempted ex ecution of an instruction with a full-f ormat
indexed addressing mode.
On Version 2 ColdFire implementations, only some illegal opcodes (0x0000 and 0x4AFC) are
decoded and generate an illegal instruction exception. Additionally, attempting to execute an illegal
line A or line F opcode generates unique exception types: vectors 10 and 11, respectively. If any
other nonsupported opcode is executed, the resulting operation is undefined.
ColdFire processors do not provide illegal instruction detection on extension words of any instruction,
including MOVEC. Attempting to execute an instruction with an illegal extension word causes
undefined results.
Attempted division by zero causes an exception (vector 5, offset = 0x014) e xcept when the PC points
to the faulting instruction (DIVU, DIVS, REMU, REMS).
Caused by attempted execution of a supervisor mode instruction while in user mode. The ColdFire Programmer’s Reference Manual lists supervisor- and user-mode instructions.
Chapter 2. ColdFire Core 2-39
Page 88
Exception Processing Overview
Table 2-21. MCF5272 Exceptions (Continued)
ExceptionDescription
Trace
Exception
Debug
Interrupt
RTE and
Format Error
Exceptions
TRAPExecuting TRAP always forces an exception and is useful for implementing system calls. The trap
ColdFire processors provide instruction-by-instruction tracing. While the processor is in trace mode
(SR[T] = 1), instruction completion signals a trace exception. This allows a debugger to monitor
program execution.
The only exception to this definition is the STOP instruction. If the processor is in trace mode, the
instruction before the STOP executes and then generates a trace exception. In the exception stack
frame, the PC points to the STOP opcode. When the trace handler is exited, the STOP instruction is
executed, loading the SR with the immediate operand from the instruction. The processor then
generates a trace exception. The PC in the exception stack frame points to the instruction after
STOP, and the SR reflects the just-loaded value.
If the processor is not in trace mode and executes a STOP instruction where the immediate operand
sets the trace bit in the SR, hardware loads the SR and generates a trace exception. The PC in the
exception stack frame points to the instruction after STOP, and the SR reflects the just-loaded value.
Because ColdFire processors do not support hardware stacking of multiple exceptions, it is the
responsibility of the operating system to check for trace mode after processing other e xception types.
As an example, consider a TRAP instruction executing in trace mode. The processor initiates the
TRAP exception and passes control to the corresponding handler. If the system requires that a trace
exception be processed, the TRAP exception handler must check for this condition (SR[15] in the
exception stack frame asserted) and pass control to the trace handler before returning from the
original exception.
Caused by a hardware breakpoint register trigger. Rather than generating an IACK cycle, the
processor internally calculates the vector number (12). Additionally, the M bit and the interrupt priority
mask fields of the SR are unaffected by the interrupt. See Section 2.2.2.1, “Status Register (SR).”
When an RTE instruction executes, the processor first examines the 4-bit format field to validate the
frame type. For a ColdFire processor, any attempted execution of an RTE where the format is not
equal to {4,5,6,7} generates a format error. The exception stack frame for the format error is created
without disturbing the original exception frame and the stacked PC points to R TE.The selection of the
format value provides limited debug support for porting code from M68000 applications. On M68000
Family processors, the SR was at the top of the stack. Bit 30 of the longword addressed by the
system stack pointer is typically zero; so, attempting an RTE using this old format generates a format
error on a ColdFire processor.
If the format field defines a valid type, the processor does the following:
1 Reloads the SR operand.
2 Fetches the second longword operand.
3 Adjusts the stack pointer by adding the format value to the auto-incremented address after the first
longword fetch.
4 Transfers control to the instruction address defined by the second longword operand in the stack
frame.
instruction may be used to change from user to supervisor mode.
2-40MCF5272 User’s Manual
Page 89
Exception Processing Overview
Table 2-21. MCF5272 Exceptions (Continued)
ExceptionDescription
Interrupt
Exception
Reset
Exception
Interrupt exception processing, with interrupt recognition and vector fetching, includes uninitialized
and spurious interrupts as well as those where the requesting device supplies the 8-bit interrupt
vector.
Asserting the reset input signal (RSTI
priority; it provides for system initialization and recovery from catastrophic failure. When assertion of
RSTI
is recognized, current processing is aborted and cannot be recovered. The reset exception
places the processor in supervisor mode by setting SR[S] and disables tracing by clearing SR[T].
This exception also clears SR[M] and sets the processor’s interrupt priority mask in the SR to the
highest level (lev el 7). Next, the VBR is initializ ed to 0x0000_0000. Configuration registers controlling
the operation of all processor-local memories (cache and RAM modules on the MCF5272) are
invalidated, disabling the memories.
Note: Other implementation-specific supervisor registers are also affected. Refer to each of the
modules in this manual for details on these registers.
If the processor is not halted and it has ownership of the bus, it initiates the reset exception by
performing two longword read bus cycles. The longword at address 0 is loaded into the stack pointer
and the longword at address 4 is loaded into the PC. After the initial instruction is fetched from
memory, program execution begins at the address in the PC. If an access error or address error
occurs before the first instruction executes, the processor enters the fault-on-fault halted state.
) causes a reset exception. Reset has the highest exception
If a ColdFire processor encounters any type of fault during the exception processing of
another fault, the processor immediately halts execution with the catastrophic fault-on-fault
condition. A reset is required to force the processor to exit this halted state.
Chapter 2. ColdFire Core 2-41
Page 90
Exception Processing Overview
2-42MCF5272 User’s Manual
Page 91
Chapter 3
Hardware Multiply/Accumulate (MAC)
Unit
This chapter describes the MCF5272 multiply/accumulate (MAC) unit, which executes
integer multiply, multiply-accumulate, and miscellaneous register instructions. The MAC
is integrated into the operand execution pipeline (OEP).
3.1 Overview
The MAC unit provides hardware support for a limited set of digital signal processing
(DSP) operations used in embedded code, while supporting the integer multiply
instructions in the ColdFire microprocessor family.
The MAC unit provides signal processing capabilities for the MCF5272 in a variety of
applications including digital audio and servo control. Integrated as an ex ecution unit in the
processor’s OEP, the MAC unit implements a three-stage arithmetic pipeline optimized for
16 x 16 multiplies. Both 16- and 32-bit input operands are supported by this design in
addition to a full set of extensions for signed and unsigned integers plus signed, fixed-point
fractional input operands.
The MAC unit provides functionality in three related areas:
•Signed and unsigned integer multiplies
•Multiply-accumulate operations supporting signed, unsigned, and signed fractional
operands
•Miscellaneous register operations
Each of the three areas of support is addressed in detail in the succeeding sections. Logic
that supports this functionality is contained in a MAC module, as shown in Figure 3-1.
The MAC unit is tightly coupled to the OEP and features a three-stage execution pipeline.
To minimize silicon costs, the ColdFire MAC is optimized for 16 x 16 multiply
instructions. The OEP can issue a 16 x 16 multiply with a 32-bit accumulation and fetch a
32-bit operand in the same cycle. A 32 x 32 multiply with a 32-bit accumulation takes three
cycles before the next instruction can be issued. Figure 3-1 shows the basic functionality of
the ColdFire MAC. A full set of instructions is provided for signed and unsigned integers
plus signed, fixed-point, fractional input operands.
Chapter 3. Hardware Multiply/Accumulate (MAC) Unit 3-1
Page 92
Overview
Operand YOperand X
X
Shift 0,1,-1
+/-
Accumulator
Figure 3-1. ColdFire MAC Multiplication and Accumulation
The MAC unit is an extension of the basic multiplier found on most microprocessors. It can
perform operations native to signal processing algorithms in an acceptable number of
cycles, given the application constraints. F or example, small digital filters can tolerate some
variance in the execution time of the algorithm; larger, more complicated algorithms such
as orthogonal transforms may have more demanding speed requirements exceeding the
scope of any processor architecture and requiring a fully developed DSP implementation.
The M68000 architecture was not designed for high-speed signal processing, and a large
DSP engine would be excessive in an embedded environment. In striking a middle ground
between speed, size, and functionality , the ColdFire MAC unit is optimized for a small set
of operations that involve multiplication and cumulative additions. Specifically, the
multiplier array is optimized for single-cycle, 16 x 16 multiplies producing a 32-bit result,
with a possible accumulation cycle following. This is common in a large portion of signal
processing applications. In addition, the ColdFire core architecture has been modified to
allow for an operand fetch in parallel with a multiply, increasing overall performance for
certain DSP operations.
3.1.1 MAC Programming Model
Figure 3-2 shows the registers in the MAC portion of the user programming model.
31 0
Figure 3-2. MAC Programming Model
3-2MCF5272 User’s Manual
MACSRMAC status register
ACCMAC accumulator
MASKMAC mask register
Page 93
Overview
These registers are described as follows:
•Accumulator (ACC)—This 32-bit, read/write, general-purpose register is used to
accumulate the results of MAC operations.
•Mask register (MASK)—This 16-bit general-purpose register provides an optional
address mask for MAC instructions that fetch operands from memory. It is useful in
the implementation of circular queues in operand memory.
•MAC status register (MACSR)—This 8-bit register defines configuration of the
MAC unit and contains indicator flags af fected by MAC instructions. Unless noted
otherwise, the setting of MACSR indicator flags is based on the final result, that is,
the result of the final operation involving the product and accumulator.
3.1.2 General Operation
The MAC unit supports the ColdFire integer multiply instructions (MULS and MULU) and
provides additional functionality for multiply-accumulate operations. The added MAC
instructions to the ColdFire ISA provide for the multiplication of two numbers, followed
by the addition or subtraction of this number to or from the value contained in the
accumulator. The product may be optionally shifted left or right one bit before the addition
or subtraction takes place. Hardware support for saturation arithmetic may be enabled to
minimize software overhead when dealing with potential ov erflo w conditions using signed
or unsigned operands.
These MAC operations treat the operands as one of the following formats:
•Signed integers
•Unsigned integers
•Signed, fixed-point, fractional numbers
To maintain compactness, the MAC module is optimized for 16-bit multiplications. Two
16-bit operands produce a 32-bit product. Longword operations are performed by reusing
the 16-bit multiplier array at the expense of a small amount of extra control logic. Again,
the product of two 32-bit operands is a 32-bit result. For longword integer operations, only
the least significant 32 bits of the product are calculated. For fractional operations, the
entire 63-bit product is calculated and then either truncated or rounded to a 32-bit result
using the round-to-nearest (even) method.
Because the multiplier array is implemented in a 3-stage pipeline, MAC instructions can
have an effective issue rate of one clock for word operations, three for longword integer
operations, and four for 32-bit fractional operations. Arithmetic operations use
register-based input operands, and summed values are stored internally in the accumulator.
Thus, an additional MOVE instruction is necessary to store data in a general-purpose
register. MAC instructions can choose the upper or lower word of a register as the input,
which helps filtering operations in which one data register is loaded with input data and
another is loaded with coefficient data. Two 16-bit MAC operations can be performed
without fetching additional operands between instructions by alternating the word choice
during the calculations.
Chapter 3. Hardware Multiply/Accumulate (MAC) Unit 3-3
Page 94
Overview
The need to move large amounts of data quickly can limit throughput in DSP engines.
However, data can be moved efficiently by using the MOVEM instruction, which
automatically generates line-sized burst references and is ideal for filling registers quickly
with input data, filter coefficients, and output data. Loading an operand from memory into
a register during a MAC operation makes some DSP operations, especially filtering and
convolution, more manageable.
The MACSR has a 4-bit operational mode field and three condition flags. The operational
mode bits control the overflow/saturation mode, whether operands are signed or unsigned,
whether operands are treated as integers or fractions, and how rounding is performed.
Negative, zero and overflow flags are also provided.
The three program-visible MAC registers, a 32-bit accumulator (ACC), the MAC mask
register (MASK), and MACSR, are described in Section 3.1.1, “MAC Programming
Model.”
3.1.3 MAC Instruction Set Summary
The MAC unit supports the integer multiply operations defined by the baseline ColdFire
architecture, as well as the new multiply-accumulate instructions. Table 3-1 summarizes
the MAC unit instruction set.
Table 3-1. MAC Instruction Summary
Instruction MnemonicDescription
Multiply SignedMULS <ea>y,DxMultiplies two signed operands yielding a signed result
Multiply UnsignedMULU <ea>y,DxMultiplies two unsigned operands yielding an unsigned result
Multiply AccumulateMAC Ry,RxSF
Multiply Accumulate
with Load
Load AccumulatorMOV.L {Ry,#imm},ACCLoads the accumulator with a 32-bit operand
Store AccumulatorMOV.L ACC,RxWrites the contents of the accumulator to a register
Load MACSRMOV.L {Ry,#imm},MACSR Writes a value to the MACSR
Store MACSRMOV.L MACSR,RxWrites the contents of MACSR to a register
Store MACSR to CCRMOV.L MACSR,CCRWrites the contents of MACSR to the processor’s CCR register
Load MASKMOV.L {Ry,#imm},MASKWrites a value to MASK
Store MASKMOV.L MASK,RxWrites the contents of MASK to a register
MSAC Ry,RxSF
MAC Ry,RxSF,Rw
MSAC Ry,RxSF,Rw
Multiplies two operands, then adds or subtracts the product
to/from the accumulator
Multiplies two operands, then adds or subtracts the product
to/from the accumulator while loading a register with the
memory operand
3-4MCF5272 User’s Manual
Page 95
MAC Instruction Execution Timings
3.1.4 Data Representation
The MAC unit supports three basic operand types:
•Two’s complement signed integer: In this format, an N-bit operand represents a
number within the range -2
(N-1)
< operand < 2
of the least significant bit.
•Two’s complement unsigned integer: In this format, an N-bit operand represents a
number within the range 0 <
operand < 2N - 1. The binary point is to the right of the
least significant bit.
•T wo’ s complement, signed fractional: In an N-bit number , the first bit is the sign bit.
The remaining bits signify the first N-1 bits after the binary point. Given an N-bit
number, a
N-1aN-2aN-3
... a2a1a0, its value is given by the following formula:
(N-1)
- 1. The binary point is to the right
N2–
i0=
This format can represent numbers in the range -1 <
i1N–+()
2
∑
ai⋅
operand < 1 - 2
(N-1)
.
For words and longwords, the greatest negati ve number that can be represented is -1,
whose internal representation is 0x8000 and 0x0x8000_0000, respectively. The
most positive word is 0x7FFF or (1 - 2
0x7FFF_FFFF or (1 - 2
-31
).
-15
); the most positive longword is
3.2 MAC Instruction Ex ecution Timings
For information on MAC instruction execution timings, refer to Section 2.7, “Instruction
Timing.”
Chapter 3. Hardware Multiply/Accumulate (MAC) Unit 3-5
Page 96
MAC Instruction Execution Timings
3-6MCF5272 User’s Manual
Page 97
Chapter 4
Local Memory
This chapter describes the MCF5272 implementation of the ColdFire Version 2 core local
memory specification. It consists of the following sections.
•Section 4.3, “SRAM Overview,” and Section 4.4, “ROM Overview,” describe the
on-chip static RAM (SRAM) and ROM implementations. These chapters cover
general operations, configuration, and initialization. They also provide information
and examples showing ho w to minimize power consumption when using the ROM
and SRAM.
•Section 4.5, “Instruction Cache Overview,” describes the cache implementation,
including organization, configuration, and coherency. It describes cache operations
and how the cache interfaces with other memory structures.
4.1 Interactions between Local Memory Modules
Depending on configuration information, instruction fetches and data read accesses may be
sent simultaneously to the SRAM, ROM, and cache controllers. This approach is required
because the controllers are memory-mapped devices and the hit/miss determination is made
concurrently with the read data access. Power dissipation can be minimized by configuring
the ROM and SRAM base address registers (ROMBAR and RAMBAR) to mask unused
address spaces whenever possible.
If the access address is mapped into the region defined by the SRAM (and this region is not
masked), it provides the data back to the processor and any cache or R OM data is discarded.
If the access address does not hit the SRAM, but is mapped into the region defined by the
ROM (and this region is not mask ed), the R OM provides the data back to the processor and
any cache data is discarded. Accesses from the SRAM and ROM modules are ne ver cached.
The complete definition of the processor’s local bus priority scheme for read references is
as follows:
if (SRAM “hits”)
SRAM supplies data to the processor
if (ROM “hits”)
ROM supplies data to the processor
else if (cache “hits”)
cache supplies data to the processor
else system memory reference to access data
Chapter 4. Local Memory 4-1
Page 98
Local Memory Registers
4.2 Local Memory Registers
Table 4-1 lists the local memory registers. Note the following:
•Addresses not assigned to the register and undefined register bits are reserved. Write
accesses to these bits have no effect; read accesses return zeros.
•The reset value column indicates the register initial value at reset. Uninitialized
fields may contain random values after reset.
Table 4-1. Memory Map of Instruction Cache Registers
Address (using MOVEC)NameWidthDescription Reset Value
0x002CACR32Cache control register0x0000
0x004ACR032Access control register 00x0000
0x005ACR132Access control register 10x0000
0xC00ROMBAR32ROM base address registerUninitialized (except V = 0)
0xC04RAMBAR32SRAM base address register Uninitialized (except V = 0)
4.3 SRAM Overview
The SRAM module has the following features:
•4-Kbyte SRAM, organized as 1K x 32 bits
•Single-cycle access
•Physically located on the ColdFire core's high-speed local bus
•Byte, word, longword address capabilities
•Programmable memory mapping
4.3.1 SRAM Operation
The SRAM module provides a general-purpose memory block the ColdFire core can access
in a single cycle. The location of the memory block can be set to any 4-Kbyte address
boundary within the 4-Gbyte address space. The memory is ideal for storing critical code
or data structures or for use as the system stack. Because the SRAM module is physically
connected to the processor's high-speed local bus, it can quickly service core-initiated
accesses or memory-referencing commands from the debug module.
Section 4.1, “Interactions between Local Memory Modules,” describes priorities when an
access address hits multiple local memory resources.
4.3.2 SRAM Programming Model
The MCF5272 implements the SRAM base address register (RAMBAR), shown in
Figure 4-1 and described in the following section.
4-2MCF5272 User’s Manual
Page 99
SRAM Overview
4.3.2.1 SRAM Base Address Register (RAMBAR)
RAMBAR determines the base address location of the internal SRAM module, as well as
the definition of the types of accesses allowed for it.
•RAMBAR is a 32-bit write-only supervisor control register. It is accessed in the
CPU address space via the MOVEC instruction with an Rc encoding of 0xC04.
RAMBAR can be read or written in background debug mode (BDM). At system
reset, the V bit is cleared and the remaining bits are uninitialized. To access the
SRAM module, RAMBAR must be written with the appropriate base address after
system reset.
•The SRAM base address register (RAMBAR) can be accessed only in supervisor
mode using the MOVEC instruction with an Rc value of 0xC04.
3112 11987654321 0
FieldBA—WP—C/I SC SD UC UD V
Reset—0
R/WW for CPU; R/W for debug
AddressCPU space + 0xC04
Figure 4-1. SRAM Base Address Register (RAMBAR)
RAMBAR fields are described in Table 4-2.
Table 4-2. RAMBAR Field Description
BitsNameDescription
31–12BABase address. SRAM module base address. The SRAM module occupies a 4-Kbyte space
11–9—Reserved, should be cleared.
8WP Write protect. Controls read/write properties of the SRAM.
7–6—Reserved, should be cleared.
defined by BA. SRAM can reside on any 4-Kbyte boundary in the 4-Gbyte address space.
0 Allows read and write accesses to the SRAM module.
1 Allows only read accesses to the SRAM module. Any attempted write reference generates an
access error exception to the ColdFire processor core.
Chapter 4. Local Memory 4-3
Page 100
SRAM Overview
Table 4-2. RAMBAR Field Description (Continued)
BitsNameDescription
5–1C/I,
0V Valid. Enables/disables the SRAM module. V is cleared at reset.
Address space masks (ASn). These fields allow certain types of accesses to be masked, or
inhibited from accessing the SRAM module. These bits are useful for power management as
SC,
described in Section 4.3.2.3, “Programming RAMBAR for P ow er Management.” In particular, C/I is
SD,
typically set.
UC,
The address space mask bits are follows:
UD
C/I = CPU space/interrupt acknowledge cycle mask. Note that C/I must be set if BA = 0.
SC = Supervisor code address space mask
SD = Supervisor data address space mask
UC = User code address space mask
UD = User data address space mask
For each ASn bit:
0 An access to the SRAM module can occur for this address space
1 Disable this address space from the SRAM module. References to this address space cannot
access the SRAM module and are processed like other non-SRAM references.
0 RAMBAR contents are not valid.
1 RAMBAR contents are valid.
The mapping of a given access into the SRAM uses the following algorithm to determine
if the access hits in the memory:
if (RAMBAR[0] = 1)
if (requested address[31:12] = RAMBAR[31:12])
if (address space mask of the requested type = 0)
Access is mapped to the SRAM module
if (access = read)
Read the SRAM and return the data
if (access = write)
if (RAMBAR[8] = 0)
Write the data into the SRAM
else Signal a write-protect access error
4.3.2.2 SRAM Initialization
After a hardware reset, the contents of the SRAM module are undefined. The valid bit of
RAMBAR is cleared, disabling the module. If the SRAM needs to be initialized with
instructions or data, the following steps should be performed:
1. Load RAMBAR, mapping the SRAM module to the desired location.
2. Read the source data and write it to the SRAM. Various instructions support this
function, including memory-to-memory MOVE instructions and the MOVEM
opcode. The MOVEM instruction is optimized to generate line-sized burst fetches
on 0-modulo-16 addresses, so this opcode generally provides the best performance.
3. After data is loaded into the SRAM, it may be appropriate to load a revised value
into RAMBAR with new write-protect and address space mask attributes. These
attributes consist of the write-protect and address-space mask fields.
The ColdFire processor or an external BDM emulator using the debug module can perform
this initialization.
4-4MCF5272 User’s Manual
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.