ColdFire is a registered trademark and DigitalDNA is a trademark of Motorola, Inc.
I2C is a registered trademark of Philips Semiconductors
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
C Interface Memory Map.......................................................................................... A-8
Title
Page
Number
xxxMCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
About This Book
The primary objective of this user’s manual is to define the functionality of the MCF5307
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 they are using the most recent version 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 for the MCF5307. It is assumed that the reader
understands operating systems, microprocessor system design, basic principles of software
and hardware, and basic details of the ColdFire architecture.
Organization
Following is a summary and a brief description of the major sections of this manual:
•Chapter 1, “Overview,” includes general descriptions of the modules and features
incorporated in the MCF5307, focussing in particular on new features.
•Part I is intended for system designers who need to understand the operation of the
MCF5307 ColdFire core.
— Chapter 2, “ColdFire Core,” provides an ov erview of the microprocessor core of
the MCF5307. The chapter begins with a description of enhancements from the
V2 ColdFire core, and then fully describes the V3 programming model as it is
implemented on the MCF5307. It also includes a full description of exception
handling, data formats, an instruction set summary, and a table of instruction
timings.
— Chapter 3, “Hardware Multiply/Accumulate (MAC) Unit,” describes the
MCF5307 multiply/accumulate unit, which executes integer multiply,
multiply-accumulate, and miscellaneous register instructions. The MAC is
integrated into the operand execution pipeline (OEP).
About This Book xxxi
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Organization
— Chapter 4, “Local Memory.” This chapter describes the MCF5307
implementation of the ColdFire V3 local memory specification. It consists of the
two following major sections.
(SRAM) implementation. It covers general operations, configuration, and
initialization. It also provides information and examples showing how to
minimize power consumption when using the SRAM.
– Section 4.7, “Cache Overview,” describes the MCF5307 cache
implementation, including organization, configuration, and coherency. It
describes cache operations and how the cache interacts with other memory
structures.
— Chapter 5, “Deb ug Support,” describes the Re vision C enhanced hardware debug
support in the MCF5307. This revision of the ColdFire debug architecture
encompasses earlier revisions.
•Part II, “System Integration Module (SIM),” describes the system integration
module, which provides overall control of the bus and serves as the interface
between the ColdFire core processor complex and internal peripheral devices. It
includes a general description of the SIM and individual chapters that describe
components of the SIM, such as the phase-lock loop (PLL) timing source, interrupt
controller for peripherals, configuration and operation of chip selects, and the
SDRAM controller.
— Chapter 6, “SIM Overview,” describes the SIM programming model, bus
arbitration, and system-protection functions for the MCF5307.
— Chapter 7, “Phase-Locked Loop (PLL),” describes configuration and operation
of the PLL module. It describes in detail the registers and signals that support the
PLL implementation.
— Chapter 8, “I
protocol, clock synchronization, and the registers in the I
2
C Module,” describes the MCF5307 I2C module, including I2C
2
C programing model.
It also provides extensive programming examples.
— Chapter 9, “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 10, “Chip-Select Module,” describes the MCF5307 chip-select
implementation, including the operation and programming model, which
includes the chip-select address, mask, and control registers.
— Chapter 11, “Synchronous/Asynchronous DRAM Controller Module,”
describes configuration and operation of the synchronous/asynchronous DRAM
controller component of the SIM. It begins with a general description and brief
glossary, and includes a description of signals involved in DRAM operations.
The remainder of the chapter is divided between descriptions of asynchronous
and synchronous operations.
xxxiiMCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
•Part III, “Peripheral Module,” describes the operation and configuration of the
MCF5307 DMA, timer, UART, and parallel port modules, and describes how they
interface with the system integration unit, described in Part II.
— Chapter 12, “DMA Controller Module,” provides an overview of the DMA
controller module and describes in detail its signals and registers. The latter
sections of this chapter describe operations, features, and supported data transfer
modes in detail, showing timing diagrams for various operations.
— Chapter 13, “Timer Module,” describes configuration and operation of the two
general-purpose timer modules, timer 0 and timer 1. It includes programming
examples.
— Chapter 14, “UART Modules,” describes the use of the universal
asynchronous/synchronous receiver/transmitters (UARTs) implemented on the
MCF5307 and includes programming examples.
— Chapter 15, “Parallel Port (General-Purpose I/O),” describes the operation and
programming model of the parallel port pin assignment, direction-control, and
data registers. It includes a code example for setting up the parallel port.
•Part IV, “Hardware Interface,” provides a pinout and both electrical and functional
descriptions of the MCF5307 signals. It also describes how these signals interact to
support the variety of bus operations shown in timing diagrams.
Organization
— Chapter 16, “Mechanical Data,” provides a functional pin listing and package
diagram for the MCF5307.
— Chapter 17, “Signal Descriptions,” provides an alphabetical listing of MCF5307
signals. This chapter describes the MCF5307 signals. In particular, it shows
which are inputs or outputs, how they are multiplexed, which signals require
pull-up resistors, and the state of each signal at reset.
— Chapter 18, “Bus Operation,” describes data transfers, error conditions, bus
arbitration, and reset operations. It describes transfers initiated by the MCF5307
and by an external bus master, and includes detailed timing diagrams showing
the interaction of signals in supported bus operations. Note that Chapter 11,
“Synchronous/Asynchronous DRAM Controller Module,” describes DRAM
cycles.
— Chapter 19, “IEEE 1149.1 Test Access Port (JTAG),” describes configuration
and operation of the MCF5307 JT A G test implementation. It describes the use of
JTAG instructions and provides information on how to disable JTAG
functionality.
— Chapter 20, “Electrical Specifications,” describes AC and DC electrical
specifications and thermal characteristics for the MCF5307. 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.
About This Book xxxiii
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Suggested Reading
This manual includes the following appendix:
•Appendix A, “List of Memory Maps,” lists the entire address-map for MCF5307
memory-mapped registers.
This manual also includes a glossary and 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.
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
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
About This Bookxxxv
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Acronyms and Abbreviations
Table i. Acronyms and Abbreviated Terms (Continued)
TermMeaning
GPIOGeneral-purpose I/O
2
I
CInter-integrated circuit
IEEEInstitute for Electrical and Electronics Engineers
IFPInstruction fetch pipeline
IPLInterrupt priority level
JEDECJoint Electron Device Engineering Council
JTAGJoint Test Action Group
LIFOLast-in, first-out
LRULeast recently used
LSBLeast-significant byte
lsbLeast-significant bit
MACMultiple accumulate unit
MBARMemory base address register
MSBMost-significant byte
msbMost-significant bit
MuxMultiplex
NOPNo operation
OEPOperand execution pipeline
PCProgram counter
PCLKProcessor clock
PLLPhase-locked loop
PLRUPseudo least recently used
PORPower-on reset
PQFPPlastic quad flat pack
RISCReduced instruction set computing
RxReceive
SIMSystem integration module
SOFStart of frame
TAPTest access port
TTLTransistor-to-transistor logic
TxTransmit
UARTUniversal asynchronous/synchronous receiver transmitter
xxxviMCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Terminology and Notational Conventions
Terminology and Notational Conventions
Table ii shows notational 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
PSTDDATAProcessor status/debug data port
Miscellaneous Operands
#<data>Immediate data following the 16-bit operation word of the instruction
Í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
dcData cache
About This Bookxxxvii
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Terminology and Notational Conventions
Table ii Notational Conventions (Continued)
InstructionOperand Syntax
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>
{}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 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.
Subfields and Qualifiers
Displacement value, n-bits wide (example: d16 is a 16-bit displacement)
xxxviiiMCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Table ii Notational Conventions (Continued)
InstructionOperand Syntax
CCarry
NNegative
VOverflow
XExtend
ZZero
Terminology and Notational Conventions
Condition Code Register Bit Names
About This Book xxxix
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Terminology and Notational Conventions
xlMCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Chapter 1
Overview
This chapter is an overview of the MCF5307 ColdFire processor. It includes general
descriptions of the modules and features incorporated in the MCF5307.
1.1 Features
The MCF5307 integrated microprocessor combines a V3 ColdFire processor core with the
following components, as shown in Figure 1-1:
•8-Kbyte unified cache
•4-Kbyte on-chip SRAM
•Integer/fractional multiply-accumulate (MAC) unit
•Divide unit
•System debug interface
•DRAM controller for synchronous and asynchronous DRAM
•Four-channel DMA controller
•Two general-purpose timers
•Two UARTs
2C™
•I
•Parallel I/O interface
•System integration module (SIM)
Designed for embedded control applications, the MCF5307 delivers 75 Dhrystone 2.1
MIPS at 90 MHz while minimizing system costs.
interface
Chapter 1. Overview 1-1
Features
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
JTAG
V3 COLDFIRE PROCESSOR COMPLEX
Instruction Unit
Branch Logic
CCR
GeneralPurpose
Registers
A0–A7
31
0
D0–D7
31
0
DIV
Debug
Module
Local
BCLKO
(sent off-chip
and to on-chip
peripherals)
CLKIN
RSTI
PLL
X n
PSTCLK
PCLK
RSTO
SRAM Controller
RAMBAR
4-Kbyte
SRAM
Cache Controller
CACR
ACR0
ACR1
8-Kbyte
Cache
Memory
31
Local Memory Bus
Instruction Fetch
IAG
Pipeline (IFP)
IC1
IC2
IED
Eight-Instruction
FIFO Buffer
Operand Execution
Pipeline (OEP)
DSOC
AGEX
0
4-Entry
Store
Buffer
MAC
SYSTEM INTEGRATION MODULE (SIM)
System Control PLL Control
SWIVR
DMR0/1
RSR
SWSR SYPCR
888
CSARs CSCRs CSMRs
PLL
DRAM ControllerChip-Select ModuleExternal
DRAM Control
DCR
Addr/Cntrl Mask
DACR0/1
DRAM Controller
Outputs
CS[7:0]
Base Address
MBAR
8
Bus Master Park
MPARK
Bus Interface
32-Bit Address Bus
32-Bit Data Bus
Control Signals
Figure 1-1. MCF5307 Block Diagram
1-2MCF5307 User’s Manual
Parallel Port
PLL
Interrupt Controller
10 ICRs
IRQ
IRQPAR
IPR
IMR
AVR
4
[1,3,5,7]
DMA
Four
Channels
Software
Watchdog
2
I
C Module
Two UARTs
Two
GeneralPurpose
Timers
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Features
Features common to many embedded applications, such as DMAs, various DRAM
controller interfaces, and on-chip memories, are integrated using advanced process
technologies.
The MCF5307 extends the legacy of Motorola’ s 68K family by pro viding a compatible path
for 68K and ColdFire customers in which development tools and customer code can be
leveraged. In fact, customers moving from 68K to ColdFire can use code translation and
emulation tools that facilitate modifying 68K assembly code to the ColdFire architecture.
Based on the concept of variable-length RISC technology, the ColdFire family combines
the architectural simplicity of conventional 32-bit RISC with a memory-saving,
variable-length instruction set. In defining the ColdFire architecture for embedded
processing applications, a 68K-code compatible core combines performance advantages of
a RISC architecture with the optimum code density of a streamlined, variable-length
M68000 instruction set.
By using a variable-length instruction set architecture, embedded system designers using
ColdFire RISC processors enjoy significant advantages over conventional fixed-length
RISC architectures. The denser binary code for ColdFire processors consumes less memory
than many fixed-length instruction set RISC processors available. This improved code
density means more efficient system memory use for a giv en application and allows use of
slower, less costly memory to help achieve a target performance level.
The MCF5307 is the first standard product to implement the Version 3 ColdFire
microprocessor core. To reach higher levels of frequency and performance, numerous
enhancements were made to the V2 architecture. Most notable are a deeper instruction
pipeline, branch acceleration, and a unified cache, which together provide 75 (Dhrystone
2.1) MIPS at 90 MHz. Increasing the internal speed of the core also allows higher
performance while providing the system designer with an easy-to-use lower speed system
interface. The processor complex frequency is an integer multiple, 2 to 4 times, of the
external bus frequency. The core clock can be stopped to support a low-power mode.
Serial communication channels are provided by an I
2
C interface module and two
programmable full-duplex UAR Ts. F our channels of DMA allow for fast data transfer using
a programmable burst mode independent of processor execution. The two 16-bit
general-purpose multimode timers provide separate input and output signals. For system
protection, the processor includes a programmable 16-bit software watchdog timer. In
addition, common system functions such as chip selects, interrupt control, bus arbitration,
and an IEEE 1149.1 JTAG module are included. A sophisticated debug interface supports
background-debug mode plus real-time trace and debug with expanded flexibility of
on-chip breakpoint registers. This interface is present in all ColdFire standard products and
allows common emulator support across the entire family of microprocessors.
Chapter 1. Overview 1-3
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
MCF5307 Features
1.2 MCF5307 Features
The following list summarizes MCF5307 features:
•ColdFire processor core
— Variable-length RISC, clock-multiplied Version 3 microprocessor core
— Fully code compatible with Version 2 processors
— T wo independent decoupled pipelines: four-stage instruction fetch pipeline (IFP)
and two-stage operand execution pipeline (OEP)
— Eight-instruction FIFO buffer provides decoupling between the pipelines
— Branch prediction mechanisms for accelerating program execution
— 32-bit internal address bus supporting 4 Gbytes of linear address space
— 32-bit data bus
— 16 user-accessible, 32-bit-wide, general-purpose registers
— Supervisor/user modes for system protection
— Vector base register to relocate exception-vector table
— Optimized for high-level language constructs
•Multiply and accumulate unit (MAC)
— High-speed, complex arithmetic processing for DSP applications
— Tightly coupled to the OEP
— Three-stage execute pipeline with one clock issue rate for 16 x 16 operations
— 16 x 16 and 32 x 32 multiplies support, all with 32-bit accumulate
— Signed or unsigned integer support, plus signed fractional operands
•Hardware integer divide unit
— Unsigned and signed integer divide support
— Tightly coupled to the OEP
— 32/16 and 32/32 operation support producing quotient and/or remainder results
•8-Kbyte unified cache
— Four-way set-associative organization
— Operates at higher processor core frequency
— Provides pipelined, single-cycle access to critical code and data
— Supports write-through and copyback modes
— Four-entry, 32-bit store buffer to improve performance of operand writes
•4-Kbyte SRAM
— Programmable location anywhere within 4-Gbyte linear address space
— Higher core-frequency operation
— Pipelined, single-cycle access to critical code or data
1-4
MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
MCF5307 Features
•DMA controller
— Four fully programmable channels: two support external requests
— Dual-address and single-address transfer support with 8-, 16-, and 32-bit data
capability
— Source/destination address pointers that can increment or remain constant
— 24-bit transfer counter per channel
— Operand packing and unpacking supported
— Auto-alignment transfers supported for efficient block movement
— Bursting and cycle steal support
— Two-bus-clock internal access
— Automatic DMA transfers from on-chip UARTs using internal interrupts
•DRAM controller
— Synchronous DRAM (SDRAM), extended-data-out (EDO) DRAM, and fast
page mode support
— Up to 512 Mbytes of DRAM
— Programmable timer provides CAS-before-RAS refresh for asynchronous
DRAMs
— Support for two separate memory blocks
•Two UARTs
— Full-duplex operation
— Programmable clock
— Modem control signals available (CTS
, RTS)
— Processor-interrupt capability
•Dual 16-bit general-purpose multiple-mode timers
— 8-bit prescaler
— Timer input and output pins
— Processor-interrupt capability
— Up to 22-nS resolution at 45 MHz
2
C module
•I
— Interchip bus interface for EEPROMs, LCD controllers, A/D converters, and
keypads
— Fully compatible with industry-standard I
2
C bus
— Master or slave modes support multiple masters
— Automatic interrupt generation with programmable level
•System interface module (SIM)
— Chip selects provide direct interface to 8-, 16-, and 32-bit SRAM, ROM,
Chapter 1. Overview 1-5
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
MCF5307 Features
FLASH, and memory-mapped I/O devices
— Eight fully programmable chip selects, each with a base address register
— Programmable wait states and port sizes per chip select
— User-programmable processor clock/input clock frequency ratio
— Programmable interrupt controller
— Low interrupt latency
— Four external interrupt request inputs
— Programmable autovector generator
— Software watchdog timer
•16-bit general-purpose I/O interface
•IEEE 1149.1 test (JTAG) module
•System debug support
— Real-time trace for determining dynamic execution path while in emulator mode
— Background debug mode (BDM) for debug features while halted
— Real-time debug support, including 6 user-visible hardware breakpoint re gisters
supporting a variety of breakpoint configurations
— Supports comprehensive emulator functions through trace and breakpoint logic
•Product offerings
— 75 Dhrystone 2.1 MIPS at 90 MHz
— Implemented in 0.35 µ, triple-layer-metal process technology with 3.3-V
operation (5.0-V compliant I/O pads)
— 208-pin plastic QFP package
— 0°–70° C operating temperature
1.2.1 Process
The MCF5307 is manufactured in a 0.35-µ CMOS process with triple-layer-metal routing
technology. This process combines the high performance and low power needed for
embedded system applications. Inputs are 3.3-V tolerant; outputs are CMOS or open-drain
CMOS with outputs operating from VDD + 0.5 V to GND - 0.5 V, with guaranteed
TTL-level specifications.
1-6
MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
ColdFire Module Description
1.3 ColdFire Module Description
The following sections provide overviews of the various modules incorporated in the
MCF5307.
1.3.1 ColdFire Core
The Version 4 ColdFire core consists of two independent and decoupled pipelines to
maximize performance—the instruction fetch pipeline (IFP) and the operand execution
pipeline (OEP).
1.3.1.1 Instruction Fetch Pipeline (IFP)
The four-stage instruction fetch pipeline (IFP) is designed to prefetch instructions for the
operand execution pipeline (OEP). Because the fetch and execution pipelines are decoupled
by a eight-instruction FIFO buffer, the fetch mechanism can prefetch instructions in
advance of their use by the OEP, thereby minimizing the time stalled waiting for
instructions. To maximize the performance of branch instructions, the Version 3 IFP
implements a branch prediction mechanism. Backward branches are predicted to be taken.
The prediction for forward branches is controlled by a bit in the Condition Code Register
(CCR). These predictions allow the IFP to redirect the fetch stream do wn the path predicted
to be taken well in advance of the actual instruction execution. The result is significantly
improved performance.
1.3.1.2 Operand Execution Pipeline (OEP)
The prefetched instruction stream is gated from the FIFO buffer into the two-stage OEP.
The OEP consists of a traditional two-stage RISC compute engine with a register file access
feeding an arithmetic/logic unit (ALU). The OEP decodes the instruction, fetches the
required operands and then executes the required function.
1.3.1.3 MAC Module
The MAC unit provides signal processing capabilities for the MCF5307 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.
1.3.1.4 Integer Divide Module
Integrated into the OEP, the divide module performs operations using signed and unsigned
integers. The module supports word and longword divides producing quotients and/or
remainders.
Chapter 1. Overview 1-7
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
ColdFire Module Description
1.3.1.5 8-Kbyte Unified Cache
The MCF5307 architecture includes an 8-Kbyte unified cache. This four-way,
set-associative cache provides pipelined, single-cycle access on cached instructions and
operands.
As with all ColdFire caches, the cache controller implements a non-lockup, streaming
design. The use of processor-local memories decouples performance from external
memory speeds and increases available bandwidth for external devices or the on-chip
4-channel DMA.
The cache implements line-fill buffers to optimize 16-byte line b urst accesses. Additionally ,
the cache supports copyback, write-through, or cache-inhibited modes. A 4-entry, 32-bit
buffer is used for cache line push operations and can be configured for deferred write
buffering in write-through or cache-inhibited modes.
1.3.1.6 Internal 4-Kbyte SRAM
The 4-Kbyte on-chip SRAM module provides pipelined, single-cycle access to memory
regions mapped to these devices. The memory can be mapped to any 0-modulo-32K
location in the 4-Gbyte address space. The SRAM module is useful for storing time-critical
functions, the system stack, or heavily-referenced data operands.
1.3.2 DRAM Controller
The MCF5307 DRAM controller provides a direct interface for up to two blocks of DRAM.
The controller supports 8-, 16-, or 32-bit memory widths and can easily interface to PC-100
DIMMs. A unique addressing scheme allows for increases in system memory size without
rerouting address lines and rewiring boards. The controller operates in normal mode or in
page mode and supports SDRAMs and EDO DRAMs.
1.3.3 DMA Controller
The MCF5307 provides four fully programmable DMA channels for quick data transfer.
Dual- and single-address modes support bursting and cycle steal. Data transfers are 32 bits
long with packing and unpacking supported along with an auto-alignment option for
efficient block transfers. Automatic block transfers from on-chip serial UARTs are also
supported through the DMA channels.
1.3.4 UART Modules
The MCF5307 contains two UARTs, which function independently. Either UART can be
clocked by the system bus clock, eliminating the need for an external crystal. Each UART
module interfaces directly to the CPU, as shown in Figure 1-2.
1-8
MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
System Integration
Module (SIM)
Interrupt
Controller
Figure 1-2. UART Module Block Diagram
Internal Channel
Control Logic
Interrupt Control
Logic
UART
Communications
Programmable
Generation
Serial
Channel
Clock
ColdFire Module Description
CTS
RTS
RxD
TxD
BCLKO
or
External clock (TIN)
Each UART module consists of the following major functional areas:
•Serial communication channel
•16-bit divider for clock generation
•Internal channel control logic
•Interrupt control logic
Each UART contains an programmable clock-rate generator. Data formats can be 5, 6, 7,
or 8 bits with even, odd, or no parity, and up to 2 stop bits in 1/16 increments. The UARTs
include 4-byte and 2-byte FIFO buffers. The UART modules also provide several
error-detection and maskable-interrupt capabilities. Modem support includes
request-to-send (RTS
) and clear-to-send (CTS) lines.
BCLKO provides the time base through a programmable prescaler. The UART time scale
can also be sourced from a timer input. Full-duplex, auto-echo loopback, local loopback,
and remote loopback modes allow testing of UART connections. The programmable
UARTs can interrupt the CPU on various normal or error-condition events.
1.3.5 Timer Module
The timer module includes two general-purpose timers, each of which contains a
free-running 16-bit timer for use in any of three modes. One mode captures the timer value
with an external event. Another mode triggers an e xternal signal or interrupts the CPU when
the timer reaches a set value, while a third mode counts external events.
The timer unit has an 8-bit prescaler that allows programming of the clock input frequency,
which is derived from the system bus cycle or an external clock input pin (TIN). The
programmable timer-output pin generates either an active-low pulse or toggles the output.
1.3.6 I
The I
between devices. The I
2
C Module
2
C interface is a two-wire, bidirectional serial bus used for quick data exchanges
2
C minimizes the interconnection between devices in the end system
and is best suited for applications that need occasional bursts of rapid communication over
Chapter 1. Overview 1-9
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
ColdFire Module Description
short distances among several devices. The I
2
C can operate in master, slave, or
multiple-master modes.
1.3.7 System Interface
The MCF5307 processor provides a direct interface to 8-, 16-, and 32-bit FLASH, SRAM,
ROM, and peripheral de vices through the use of fully programmable chip selects and write
enables. Support for burst ROMs is also included. Through the on-chip PLL, users can
input a slower clock (16.6 to 45 MHz) that is internally multiplied to create the faster
processor clock (33.3 to 90 MHz).
1.3.7.1 External Bus Interface
The bus interface controller transfers information between the ColdFire core or DMA and
memory, peripherals, or other devices on the external bus. The external bus interface
provides up to 32 bits of address bus space, a 32-bit data bus, and all associated control
signals. This interface implements an extended synchronous protocol that supports bursting
operations.
Simple two-wire request/acknowledge bus arbitration between the MCF5307 processor
and another bus master, such as an external DMA device, is glueless with arbitration logic
internal to the MCF5307 processor. Multiple-master arbitration is also a v ailable with some
simple external arbitration logic.
1.3.7.2 Chip Selects
Eight fully programmable chip select outputs support the use of external memory and
peripheral circuits with user-defined wait-state insertion. These signals interface to 8-, 16-,
or 32-bit ports. The base address, access permissions, and internal bus transfer terminations
are programmable with configuration registers for each chip select. CS0
global chip select functionality of boot ROM upon reset for initializing the MCF5307.
1.3.7.3 16-Bit Parallel Port Interface
A 16-bit general-purpose programmable parallel port serves as either an input or an output
on a pin-by-pin basis.
also provides
1.3.7.4 Interrupt Controller
The interrupt controller provides user-programmable control of ten internal peripheral
interrupts and implements four external fixed interrupt-request pins. Each internal interrupt
can be programmed to any one of seven interrupt le v els and four priority lev els within each
of these levels. Additionally, the external interrupt request pins can be mapped to levels 1,
3, 5, and 7 or levels 2, 4, 6, and 7. Autovector capability is available for both internal and
external interrupts.
1-10
MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
ColdFire Module Description
1.3.7.5 JTAG
To help with system diagnostics and manufacturing testing, the MCF5307 processor
includes dedicated user-accessible test logic that complies with the IEEE 1149.1a standard
for boundary-scan testability , often referred to as the Joint Test Action Group, or JTAG. F or
more information, refer to the IEEE 1149.1a standard.
1.3.8 System Debug Interface
The ColdFire processor core debug interface is provided to support system debugging in
conjunction with low-cost debug and emulator development tools. Through a standard
debug interface, users can access real-time trace and debug information. This allows the
processor and system to be debugged at full speed without the need for costly in-circuit
emulators. The debug unit in the MCF5307 is a compatible upgrade to the MCF52xx debug
module with added flexibility in the breakpoint registers and a new command to view the
program counter (PC).
The on-chip breakpoint resources include a total of 6 programmable registers—a set of
address registers (with two 32-bit registers), a set of data registers (with a 32-bit data
register plus a 32-bit data mask register), and one 32-bit PC register plus a 32-bit PC mask
register. These registers can be accessed through the dedicated deb ug serial communication
channel or from the processor’s supervisor mode programming model. The breakpoint
registers can be configured to generate triggers by combining the address, data, and PC
conditions in a variety of single or dual-level definitions. The trigger event can be
programmed to generate a processor halt or initiate a debug interrupt exception.
The MCF5307’s new interrupt servicing options during emulator mode allow real-time
critical interrupt service routines to be serviced while processing a debug interrupt event,
thereby ensuring that the system continues to operate even during debugging.
T o support program trace, the Version 3 debug module provides processor status (PST[3:0])
and debug data (DDATA[3:0]) ports. These buses and the PSTCLK output provide
execution status, captured operand data, and branch target addresses defining processor
activity at the CPU’s clock rate.
1.3.9 PLL Module
The MCF5307 PLL module is shown in Figure 1-3.
Chapter 1. Overview
1-11
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Programming Model, Addressing Modes, and Instruction Set
CLKIN
FREQ[1:0]
DIVIDE[1:0]
RSTI
PLL
CLKIN X 4by 2
Figure 1-3. PLL Module
Divide
Divide by 2,
3, or 4
RSTO
PCLK
PSTCLK
BCLKO
The PLL module’s three modes of operation are described as follows.
•Reset mode—When RSTI
asserts RST
O from the MCF5307. The core:bus frequency ratio and other MCF5307
is asserted, the PLL enters reset mode. At reset, the PLL
configuration information are sampled during reset.
•Normal mode—In normal mode, the input frequency programmed at reset is
clock-multiplied to provide the processor clock (PCLK).
•Reduced-power mode—In reduced-power mode, the PCLK is disabled by e xecuting
a sequence that includes programming a control bit in the system configuration
register (SCR) and then executing the STOP instruction. Register contents are
retained in reduced-power mode, so the system can be reenabled quickly when an
unmasked interrupt or reset is detected.
1.4 Programming Model, Addressing Modes, and
Instruction Set
The ColdFire programming model has two privilege le v els—supervisor and user. The S bit
in the status register (SR) indicates the privilege level. The processor identifies a logical
address that differentiates between supervisor and user modes by accessing either the
supervisor or user address space.
•User mode—When the processor is in user mode (SR[S] = 0), only a subset of
registers can be accessed, and privileged instructions cannot be e xecuted. Typically ,
most application processing occurs in user mode. User mode is usually entered by
executing a return from exception instruction (RTE, assuming the value of SR[S]
saved on the stack is 0) or a MOVE, SR instruction (assuming SR[S] is 0).
•Supervisor mode—This mode protects system resources from uncontrolled access
by users. In supervisor mode, complete access is provided to all registers and the
entire ColdFire instruction set. Typically, system programmers use the supervisor
programming model to implement operating system functions and provide I/O
1-12MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Programming Model, Addressing Modes, and Instruction Set
control. The supervisor programming model provides access to the same registers as
the user model, plus additional registers for configuring on-chip system resources,
as described in Section 1.4.3, “Supervisor Registers.”
Exceptions (including interrupts) are handled in supervisor mode.
MACSRMAC status register
ACCMAC accumulator
MASKMAC mask register
(CCR) SRStatus register
CACRCache control register
ACR0Access control register 0
ACR1Access control register 1
RAMBARRAM base address register
MBARModule base address register
Figure 1-4. ColdFire MCF5307 Programming Model
Chapter 1. Overview 1-13
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Programming Model, Addressing Modes, and Instruction Set
1.4.2 User Registers
The user programming model is shown in Figure 1-4 and summarized in Table 1-1.
Table 1-1. User-Level Registers
Register Description
Data registers
(D0–D7)
Address registers
(A0–A7)
Program counter
(PC)
Condition code
register (CCR)
MAC status
register (MACSR)
Accumulator
(ACC)
Mask register
(MASK)
These 32-bit registers are for bit, byte, word, and longword operands. They can also be used as
index registers.
These 32-bit registers serve as software stack pointers, index registers, or base address
registers. The base address registers can be used for word and longword operations. A7
functions as a hardware stack pointer during stacking for subroutine calls and e xception handling.
Contains the address of the instruction currently being executed by the MCF5307 processor
The CCR is the lower byte of the SR. It contains indicator flags that reflect the result of a pre vious
operation and are used for conditional instruction execution.
Defines the operating configuration of the MAC unit and contains indicator flags from the results
of MAC instructions.
General-purpose register used to accumulate the results of MAC operations
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.
1.4.3 Supervisor Registers
Table 1-2 summarizes the MCF5307 supervisor-level registers.
Table 1-2. Supervisor-Level Registers
Register Description
Status register (SR)The upper byte of the SR provides interrupt information in addition to a variety of mode indicators
Vector base register
(VBR)
Cache configuration
register (CACR)
Access control
registers (ACR0/1)
RAM base address
register (RAMBAR)
Module base address
register (MBAR)
signaling the operating state of the ColdFire processor. The lower byte of the SR is the CCR, as
shown in Figure 1-4.
Defines the upper 12 bits of the base address of the exception vector table used during exception
processing. The low-order 20 bits are forced to zero, locating the vector table on 0-modulo-1
Mbyte address.
Defines the operating modes of the Version 4 cache memories. Control fields configuring the
instruction, data, and branch cache are provided by this register, along with the default attributes
for the 4-Gbyte address space.
Define address ranges and attributes associated with various memory regions within the 4-Gbyte
address space. Each ACR defines the location of a given memory region and assigns attributes
such as write-protection and cache mode (copyback, write-through, cacheability). Additionally,
CACR fields assign default attributes to the instruction and data memory spaces.
Provide the logical base address for the 4-Kbyte SRAM module and define attributes and access
types allowed for the SRAM.
Defines the logical base address for the memory-mapped space containing the control registers
for the on-chip peripherals.
1-14MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Programming Model, Addressing Modes, and Instruction Set
1.4.4 Instruction Set
The ColdFire instruction set supports high-level languages and is optimized for those
instructions most commonly generated by compilers in embedded applications. Table 2-8
provides an alphabetized listing of the ColdFire instruction set opcodes, supported
operation sizes, and assembler syntax. For two-operand instructions, the first operand is
generally the source operand and the second is the destination.
Because the ColdFire architecture provides an upgrade path for 68K customers, its
instruction set supports most of the common 68K opcodes. A majority of the instructions
are binary compatible or optimized 68K opcodes. This feature, when coupled with the code
conversion tools from third-party developers, generally minimizes software porting issues
for customers with 68K applications.
Chapter 1. Overview 1-15
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Programming Model, Addressing Modes, and Instruction Set
1-16MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Intended Audience
Part I
MCF5307 Processor Core
Part I is intended for system designers who need a general understanding of the
functionality supported by the MCF5307. It also describes the operation of the MCF5307
Contents
•Chapter 2, “ColdFire Core,” provides an ov erview of the microprocessor core of the
MCF5307. The chapter begins with a description of enhancements from the V2
ColdFire core, and then fully describes the V3 programming model as it is
implemented on the MCF5307. It also includes a full description of exception
handling, data formats, an instruction set summary, and a table of instruction
timings.
•Chapter 3, “Hardware Multiply/Accumulate (MAC) Unit, ” describes the MCF5307
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 MCF5307 implementation
of the ColdFire V3 local memory specification. It consists of the two following
major sections.
(SRAM) implementation. It covers general operations, configuration, and
initialization. It also provides information and examples showing how to
minimize power consumption when using the SRAM.
— Section 4.7, “Cache Overview,” describes the MCF5307 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 C enhanced hardware debug
support in the MCF5307. This revision of the ColdFire debug architecture
encompasses earlier revisions.
Part I. MCF5307 Processor Core I-xvii
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Suggested Reading
The following literature may be helpful with respect to the topics in Part I:
•Using Microprocessors and Microcomputers: The Motorola Family, William C.
Wray, Ross Bannatyne, Joseph D. Greenfield
Acronyms and Abbreviations
Table I-i contains acronyms and abbreviations are used in Part I.
Table I-i. Acronyms and Abbreviated Terms
TermMeaning
ADCAnalog-to-digital conversion
ALUArithmetic logic unit
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
GPIO
2
I
CInter-integrated circuit
IEEEInstitute for Electrical and Electronics Engineers
IFPInstruction fetch pipeline
IPLInterrupt priority level
JEDECJoint Electron Device Engineering Council
JTAGJoint Test Action Group
LIFOLast-in, first-out
LRULeast recently used
LSBLeast-significant byte
lsbLeast-significant bit
I-xviiiMCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Table I-i. Acronyms and Abbreviated Terms (Continued)
TermMeaning
MACMultiple accumulate unit
MBARMemory base address register
MSBMost-significant byte
msbMost-significant bit
MuxMultiplex
NOPNo operation
OEPOperand execution pipeline
PCProgram counter
PCLKProcessor clock
PLLPhase-locked loop
PLRUPseudo least recently used
PORPower-on reset
PQFPPlastic quad flat pack
RISCReduced instruction set computing
RxReceive
SIMSystem integration module
SOFStart of frame
TAPTest access port
TTLTransistor-to-transistor logic
TxTransmit
UARTUniversal asynchronous/synchronous receiver transmitter
Part I. MCF5307 Processor Core I-xix
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
I-xxMCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Chapter 2
ColdFire Core
This chapter provides an overview of the microprocessor core of the MCF5307. The
chapter begins with a description of enhancements from the Version 2 (V2) ColdFire core,
and then fully describes the V3 programming model as it is implemented on the MCF5307.
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 MCF5307 is the first standard product to contain a Version 3 ColdFire microprocessor
core. To reach higher levels of frequency and performance, numerous enhancements were
made to the V2 architecture. Most notable are a deeper instruction pipeline, branch
acceleration, and a unified cache, which together provide 75 (Dhrystone 2.1) MIPS at 90
MHz.
The MCF5307 core design emphasizes performance, and backward compatibility
represents the next step on the ColdFire performance roadmap.
The following list summarizes MCF5307 features:
•Variable-length RISC, clock-multiplied Version 3 microprocessor core
•Vector base register to relocate exception-vector table
•Optimized for high-level language constructs
Chapter 2. ColdFire Core 2-21
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Features and Enhancements
2.1.1 Clock-Multiplied Microprocessor Core
The MCF5307 incorporates a clock-multiplying phase-locked loop (PLL). Increasing the
internal speed of the core also allows higher performance while providing the system
designer with an easy-to-use lower speed system interface.
The frequency of the processor complex can be 2x, 3x, or 4x the external bus speed.
The processor, cache, integrated SRAM, and misalignment module operate at the higher
speed clock (PCLK); other system integrated modules operate at the speed of the bus clock
(BCLKO). When combined with the enhanced pipeline structure of the Version 3 ColdFire
core, the processor and its local memories provide a high level of performance for today’s
demanding embedded applications.
PCLK can be disabled to minimize dissipation when a low-power mode is entered. This is
described in Section 7.2.3, “Reduced-Power Mode.”
2.1.2 Enhanced 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:
•Four-stage IFP (plus optional instruction buffer stage)
— Instruction address generation (IAG) calculates the next prefetch address.
— Instruction fetch cycle 1 (IC1) initiates prefetch on the processor’s local
instruction bus.
— Instruction fetch cycle 2 (IC2) completes prefetch on the processor’ s instruction
local bus.
— Instruction early decode (IED) generates time-critical decode signals needed for
the OEP.
— 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 (AGEX) Calculates the oeprand address, or
performs the execution of the instruction.
2-22MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
IAG
Instruction
Address
Generation
Features and Enhancements
Address [31:0]
Data[31:0]
Instruction
Fetch
Pipeline
Operand
Execution
Pipeline
IC1
IC2
IED
IB
DSOC
AGEX
Instruction
Fetch Cycle 1
Instruction
Fetch Cycle 2
Instruction
Early Decode
FIFO
Instruction Buffer
Decode & Select,
Operand Fetch
Address
Generation,
Execute
Figure 2-1. ColdFire Enhanced Pipeline
2.1.2.1 Instruction Fetch Pipeline (IFP)
Because the fetch and execution pipelines are decoupled by an eight-instruction FIFO
buffer, the IFP can prefetch instructions before the OEP needs them, minimizing stalls.
2.1.2.1.1 Branch Acceleration
Because the IFP and the OEP are decoupled by the instruction buffer, the increased depth
of the IFP is generally hidden from the OEP’s instruction execution. The one exception is
change-of-flow instructions such as unconditional branches or jumps, subroutine calls, and
taken conditional branches. To minimize the effects of the increased depth of the IFP, the
prefetched instruction stream is monitored for change-of-flow opcodes. When certain types
of change-of-flow instructions are detected, the target instruction address is calculated, and
fetching immediately begins in the target stream.
Chapter 2. ColdFire Core 2-23
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Features and Enhancements
For example, if an unconditional BRA instruction is detected, the IED calculates the target
of the BRA instruction, and the IAG immediately begins fetching at the target address.
Because of the decoupled nature of the two pipelines, the target instruction is available to
the OEP immediately after the BRA instruction, giving it a single-cycle execution time.
The acceleration logic uses a static prediction algorithm when processing conditional
branch (Bcc) instructions. The default scheme is forward Bcc instructions are predicted as
not-taken, while backward Bcc instructions are predicted as taken. A user-mode control bit,
CCR[7], allows users to dynamically alter the prediction algorithm for forward Bcc
instructions. See Section 2.2.1.5, “Condition Code Register (CCR).
2.1.2.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. For simple register-to-register 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.2.2.1 Illegal Opcode Handling
To aid in conversion from M68000 code, every 16-bit operation word is decoded to ensure
that each instruction is valid. If the processor attempts execution of an illegal or
unsupported instruction, an illegal instruction exception (vector 4) is taken.
2.1.2.2.2 Hardware Multiply/Accumulate (MAC) Unit
The MAC is an optional unit in Version 3 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.
2-24MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Features and Enhancements
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.2.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.3 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. The MCF5307 debug unit is a compatible
upgrade to the MCF52xx debug module with enhancements that include:
•A new command to obtain the value of the program counter (PC)
•Allowing ORing of terms in creating breakpoints
•Increased flexibility of the breakpoint registers
Chapter 2. ColdFire Core 2-25
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Programming Model
On-chip breakpoint resources include the following:
•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)
— 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.
The enhancements of the Revision B debug specification are fully backward-compatible
with the A revision. For more information, see Chapter 5, “Debug Support.”
2.2 Programming Model
The MCF5307 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
(CCR) SRStatus register
CACRCache control register
ACR0Access control register 0
ACR1Access control register 1
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.
Chapter 2. ColdFire Core 2-27
Programming Model
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
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.
Table 2-1 describes the CCR fieldsMAC Programming ModelFigure 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.
76543210
FieldP—XNZVC
Reset000Undefined
R/W R/WRR/WR/WR/WR/WR/W
Table 2-1. CCR Field Descriptions
Bits NameDescription
7PBranch prediction bit. Alters the static prediction algorithm used by the branch acceleration logic in the
6–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.
IFP on forward conditional branches.
0 Predicted as not-taken.
1 Predicted as taken.
affected or set to a specified result. Also used as an input operand for multiple-precision arithmetic.
2-28MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Table 2-1. CCR Field Descriptions (Continued)
Bits NameDescription
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
represented in the operand size; otherwise cleared.
borrow occurs in a subtraction; otherwise cleared.
Programming Model
•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 MCF5307 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 3 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)
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.
Chapter 2. ColdFire Core 2-29
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Programming Model
1514131211109876543210
FieldT—SM—IP—XNZVC
Reset00100 111 0 00 —————
R/W R/WRR/W R/WRR/WR/WRR/W R/W R/W R/W R/W
System byteCondition code register (CCR)
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–0CCRCondition code register. See Table 2-1.
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.
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.10.1, “Cache Control
Register (CACR).”
2-30MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
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.10.2, “Access Control Registers (ACR0–ACR1).”
2.2.2.5 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-32-Kbyte boundary. See Section 4.4.1, “SRAM Base Address
Register (RAMBAR).”
2.2.2.6 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.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
Chapter 2. ColdFire Core 2-31
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Organization of Data in Registers
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.
313010
msblsbBit (0 ≤ bit number ≤ 31)
3170
Not usedmsb Low order byte lsbByte (8 bits)
31150
Not usedmsbLower order wordlsbWord (16 bits)
310
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 anaddress 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.
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
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;
Chapter 2. ColdFire Core 2-33
Instruction Set Summary
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Table 2-5. ColdFire Effective Addressing Modes
—
—
X
X
X
X
X
X
Category
—
—
X
—
—
X
X
X
X
X
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
index
8-bit displacement
Program counter indirect
with displacement(d
Program counter indirect
with index
8-bit displacement
Absolute data addressing
Short
Long
Immediate#<xxx>111100XX——
Dn
An
(An)
(An)+
–(An)
(d
16
(d
8
Xi)
16
(d
8
Xi)
(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
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.
Table 2-6. Notational Conventions
InstructionOperand Syntax
Opcode Wildcard
ccLogical condition (example: NE for not equal)
2-34MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Instruction Set Summary
Table 2-6. Notational Conventions (Continued)
InstructionOperand Syntax
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
Í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)
ucUnified 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)
Chapter 2. ColdFire Core2-35
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Instruction Set Summary
Table 2-6. Notational Conventions (Continued)
InstructionOperand Syntax
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 claue 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)
By default the HALT instruction is a supervisor-mode instruction; however, it can be configured to allow user-mode
execution by setting CSR[UHE].
Table 2-8 describes supervisor-mode instructions.
Table 2-8. Supervisor-Mode Instruction Set Summary
InstructionOperand Syntax Operand SizeOperation
CPUSHL(An)UnsizedInvalidate instruction cache line
Push and invalidate data cache line
Push data cache line and invalidate (I,D)-cache lines
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)
0x006 Access control register 2 (ACR2)
0x007 Access control register 3 (ACR3)
0x801 Vector base register (VBR)
0xC04 RAM base address register 0 (RAMBAR0)
0xC05 RAM base address register 1 (RAMBAR1)
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 MCF5307, the
most common example of this type of stall involves consecutive store operations,
excluding the MOVEM instruction. For all store operations (except MOVEM),
2-40MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
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 chapter, 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.
Chapter 2. ColdFire Core 2-41
Instruction Timing
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Table 2-10 lists execution times for MOVE.{B,W} instructions.
Table 2-10. Move Byte and Word Execution Times
Source
Destination
Rx(Ax)(Ax)+-(Ax)(d16,Ax)(d8,Ax,Xi*SF) (xxx).wl
Dy1(0/0)1(0/1)1(0/1)1(0/1)1(0/1)2(0/1)1(0/1)
Ay1(0/0)1(0/1)1(0/1)1(0/1)1(0/1)2(0/1)1(0/1)
(Ay)4(1/0)4(1/1)4(1/1)4(1/1)4(1/1)5(1/1)4(1/1)
(Ay)+4(1/0)4(1/1)4(1/1)4(1/1)4(1/1)5(1/1)4(1/1)
-(Ay)4(1/0)4(1/1)4(1/1)4(1/1)4(1/1)5(1/1)4(1/1)
(d16,Ay)4(1/0)4(1/1)4(1/1)4(1/1)4(1/1)——
(d8,Ay,Xi*SF)5(1/0)5(1/1)5(1/1)5(1/1)———
(xxx).w4(1/0)4(1/1)4(1/1)4(1/1)———
(xxx).l4(1/0)4(1/1)4(1/1)4(1/1)———
(d16,PC)4(1/0)4(1/1)4(1/1)4(1/1)4(1/1)——
(d8,PC,Xi*SF)5(1/0)5(1/1)5(1/1)5(1/1)———
#<xxx>1(0/0)2(0/1)2(0/1)2(0/1)———
Table 2-11 lists timings for MOVE.L.
Table 2-11. Move Long Execution Times
Destination
Source
Rx(Ax)(Ax)+-(Ax)(d16,Ax) (d8,Ax,Xi*SF) (xxx).wl
Dy1(0/0)1(0/1)1(0/1)1(0/1)1(0/1)2(0/1)1(0/1)
Ay1(0/0)1(0/1)1(0/1)1(0/1)1(0/1)2(0/1)1(0/1)
(Ay)3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)4(1/1)3(1/1)
(Ay)+3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)4(1/1)3(1/1)
-(Ay)3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)4(1/1)3(1/1)
(d16,Ay)3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)——
(d8,Ay,Xi*SF)4(1/0)4(1/1)4(1/1)4(1/1)———
(xxx).w3(1/0)3(1/1)3(1/1)3(1/1)———
(xxx).l3(1/0)3(1/1)3(1/1)3(1/1)———
(d16,PC)3(1/0)3(1/1)3(1/1)3(1/1)3(1/1)——
(d8,PC,Xi*SF)4(1/0)4(1/1)4(1/1)4(1/1)———
#<xxx>1(0/0)2(0/1)2(0/1)2(0/1)———
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 there are no load or MAC or MSAC instruction
For the conditional branch opcodes (bcc), a static algorithm is used to determine the
prediction state of the branch. This algorithm is:
if bcc is a forward branch && CCR[7] == 0
2-46MCF5307 User’s Manual
then the bcc is predicted as not-taken
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Exception Processing Overview
if bcc is a forward branch && CCR[7] == 1
then the bcc is predicted as taken
else if bcc is a backward branch
then the bcc is predicted as taken
Table 2-17 shows timing for Bcc instructions.
Table 2-17. Bcc Instruction Execution Times
Opcode
bcc1(0/0)1(0/0)5(0/0)
Predicted
Correctly as Taken
Predicted
Correctly as Not
Taken
Predicted
Incorrectly
2.8 Exception Processing Overview
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
Chapter 2. ColdFire Core 2-47
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Exception Processing Overview
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
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
Vector NumbersVector Offset (Hex)Stacked Program Counter
62–630F8–0FC—Reserved
64–255100–3FCNextUser-defined interrupts
1
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.
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.
Chapter 2. ColdFire Core 2-49
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Exception Processing Overview
Table 2-20. Fault Status Encodings
FS[3–0]Definition
0000Not an access or address error
0001-001xReserved
0100Error on instruction fetch
0101–011xReserved
1000Error on operand write
1001Attempted write to write-protected space
101xReserved
1100Error on operand read
1101–111xReserved
•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 MCF5307 exceptions.
Table 2-21. MCF5307 Exceptions
ExceptionDescription
Access Error Access errors are reported only in conjunction with an attempted store to write-protected memory.
Address
Error
Illegal
Instruction
Divide by
Zero
Privilege
Violation
Thus, access errors associated with instruction fetch or operand read accesses are not possible.
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 were decoded and generated an
illegal instruction exception. The Version 3 processor decodes the full 16-bit opcode and generates
this exception if execution of an unsupported instruction is attempted. Additionally, attempting to
execute an illegal line A or line F opcode generates unique exception types: vectors 10 and 11,
respectively.
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.
2-50MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Exception Processing Overview
Table 2-21. MCF5307 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
Interrupt
Exception
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.
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. Autovectoring may optionally be configured through the system interface module (SIM). See
Section 9.2.2, “Autovector Register (AVR).”
Chapter 2. ColdFire Core2-51
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Exception Processing Overview
Table 2-21. MCF5307 Exceptions (Continued)
ExceptionDescription
Reset
Exception
Unsupported
Instruction
Exception
Asserting the reset input signal (RSTI) causes a reset exception. Reset has the highest exception
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 MCF5307) 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.
After RSTI
process. During this time, certain events are sampled, including the assertion of the debug
breakpoint signal. If the processor is not halted, 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.
If the MCF5307 attempts to execute a valid instruction but the required optional hardware module is
not present in the OEP, a non-supported instruction exception is generated (vector 0x61). Control is
then passed to an exception handler that can then process the opcode as required by the system.
is negated, the processor waits 80 cycles before beginning the actual reset 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.
2-52MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Chapter 3
Hardware Multiply/Accumulate (MAC)
Unit
This chapter describes the MCF5307 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 MCF5307 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
Overview
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
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
MACSRMAC status register
ACCMAC accumulator
MASKMAC mask register
Figure 3-2. MAC Programming Model
3-2MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
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.
Overview
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
Chapter 3. Hardware Multiply/Accumulate (MAC) Unit 3-3
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Overview
during the calculations.
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,RxWrite the contents of MACSR to a register
Store MACSR to CCRMOV.L MACSR,CCRWrite 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.1.4 Data Representation
The MAC unit supports three basic operand types:
3-4MCF5307 User’s Manual
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
MAC Instruction Execution Timings
•Two’s complement signed integer: In this format, an N-bit operand represents a
number within the range -2
(N-1)
< operand < 2
(N-1)
- 1. The binary point is to the right
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:
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
Table 3-2 shows standard timings for two-operand MAC instructions.
Table 3-2. Two-Operand MAC Instruction Execution Times
This chapter describes the MCF5307 implementation of the ColdFire Version 3 local
memory specification. It consists of two major sections.
•Section 4.2, “SRAM Overview,” describes the MCF5307 on-chip static RAM
(SRAM) implementation. It covers general operations, configuration, and
initialization. It also provides information and examples showing how to minimize
power consumption when using the SRAM.
•Section 4.7, “Cache Overview,” describes the MCF5307 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 RAM and cache controllers. This approach is required because
both 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 RAMBARs to mask unused address spaces whenever possible.
If the access address is mapped into the region defined by the RAM (and this region is not
masked), the RAM provides the data back to the processor , and the cache data is discarded.
Accesses from the RAM module are never cached. The complete definition of the
processor’s local bus priority scheme for read references is as follows:
) RAM supplies data to the processor
For data write references, the memory mapping into the local memories is resolved before
the appropriate destination memory is accessed. Accordingly, only the targeted local
memory is accessed for data write transfers.
if (RAM “hits”
else if (cache “hits”)
cache supplies data to the processor
else system memory reference to access data
4.2 SRAM Overview
The 4-Kbyte on-chip SRAM module is connected to the internal bus and provides pipelined,
single-cycle access to memory mapped to the module. Memory can be mapped to any
Chapter 4. Local Memory 4-1
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
SRAM Operation
0-modulo-32K location in the 4-Gbyte address space and configured to respond to either
instruction or data accesses.Time-critical functions can be mapped into instruction the
system stack. Other heavily-referenced data can be mapped into memory.
The following summarizes features of the MCF5307 SRAM implementation:
•4-Kbyte SRAM, organized as 1024 x 32 bits
•Single-cycle throughput. When the pipeline is full, one access can occur per clock
cycle.
•Physical location on the processor’s high-speed local bus
•Memory location programmable on any 0-modulo-32K address boundary
•Byte, word, and longword address capabilities
•The RAM base address register (RAMBAR) defines the logical base address,
attributes, and access types for the SRAM module.
4.3 SRAM Operation
The SRAM module provides a general-purpose memory block that the ColdFire processor
can access with single-cycle throughput. The location of the memory block can be specified
to any word-aligned address in the 4-Gbyte address space by RAMBAR[BA], described in
Section 4.4.1, “SRAM Base Address Register (RAMBAR).” The memory is ideal for
storing critical code or data structures or for use as the system stack. Because the SRAM
module connects physically to the processor’s high-speed local bus, it can service
processor-initiated accesses or memory-referencing debug module commands.
Instruction fetches and data reads can be sent to both the cache and SRAM blocks
simultaneously . If the reference is mapped into a region defined by the SRAM, the SRAM
provides data to the processor and any cache data is discarded. Data accessed from the
SRAM module are not cached.
Note also that the SRAM cannot be accessed by the on-chip DMAs. The on-chip system
configuration allows concurrent core and DMA execution, where the core can reference
code or data from the internal SRAM or cache while performing a DMA transfer.
4-2MCF5307 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.