embedded processor core, until otherwise indicated in new versions or application notes.
The following paragraph does not apply to the United Kingdom or any country where such provisions
are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES
THIS MANUAL “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in
certain transactions; therefore, this statement may not apply to you.
IBM does not warrant that the products in this publication, whether individually or as one or more groups, will
meet your requirements or that the publication or the accompanying product descriptions are error-free.
This publication could contain technical inaccuracies or typographical errors. Changes are periodically made to
the information herein; these changes will be incorporated in new editions of the publication. IBM may make
improvements and/or changes in the product(s) and/or program(s) described in this publication at any time.
It is possible that this publication may contain references to, or information about, IBM products (machines and
programs), programming, or services that are not announced in your country. Such references or information
must not be construed to mean that IBM intends to announce such IBM products, programming, or services in
your country. Any reference to an IBM licensed program in this publication is not intended to state or imply that
you can use only IBM’s licensed program. You can use any functionally equivalent program instead.
No part of this publication may be reproduced or distributed in any form or by any means, or stored in a data
base or retrieval system, without the written permission of IBM.
Requests for copies of this publication and for technical information about IBM products should be made to your
IBM Authorized Dealer or your IBM Marketing Representative.
Address technical queries about this product to ppcsupp@us.ibm.com
Address comments about this publication to:
IBM Corporation
Department YM5A
P.O. Box 12195
Research Triangle Park, NC 27709
IBM may use or distribute whatever information you supply in any way it believes appropriate without incurring
any obligation to you.
Copyright International Business Machines Corporation 1996, 2001. All rights reserved
4 3 2 1
Notice to U.S. Government Users – Documentation Related to Restricted Rights – Use, duplication, or
disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corporation.
Patents and Trademarks
IBM may have patents or pending patent applications covering the subject matter in this publication. The
furnishing of this publication does not give you any license to these patents. You can send license inquiries, in
writing, to the IBM Director of Licensing, IBM Corporation, 208 Harbor Drive, Stamford, CT 06904, United States
of America.
The following terms are trademarks of IBM Corporation:
IBM
About This Book .....................................................................................................................xxi
Who Should Use This Book .............................................................................................................................. xxi
How to Use This Book ...................................................................................................................................... xxi
PPC405 Features ............................................................................................................................................ 1-1
Instruction and Data Cache Controllers ...................................................................................................... 1-4
Instruction Cache Unit ............................................................................................................................ 1-4
Data Cache Unit ..................................................................................................................................... 1-5
Memory Management Unit .......................................................................................................................... 1-5
Processor Local Bus ............................................................................................................................... 1-8
Device Control Register Bus ................................................................................................................... 1-8
Clock and Power Management ............................................................................................................... 1-8
Auxiliary Processor Unit .......................................................................................................................... 1-8
Data Types .................................................................................................................................................. 1-8
Processor Core Register Set Summary ...................................................................................................... 1-9
General Purpose Registers .................................................................................................................... 1-9
Special Purpose Registers ..................................................................................................................... 1-9
Machine State Register .......................................................................................................................... 1-9
General Purpose Registers (R0-R31) ......................................................................................................... 2-5
Special Purpose Registers .......................................................................................................................... 2-5
Link Register (LR) .................................................................................................................................. 2-7
Fixed Point Exception Register (XER) .................................................................................................... 2-7
Special Purpose Register General (SPRG0–SPRG7) ............................................................................ 2-9
Processor Version Register (PVR) ....................................................................................................... 2-10
CR Fields after Compare Instructions ................................................................................................... 2-11
Contentsv
The CR0 Field ...................................................................................................................................... 2-12
The Time Base .......................................................................................................................................... 2-13
Machine State Register (MSR) ................................................................................................................. 2-13
Device Control Registers .......................................................................................................................... 2-15
Data Types and Alignment ............................................................................................................................ 2-16
Alignment for Storage Reference and Cache Control Instructions ........................................................... 2-16
Alignment and Endian Operation .............................................................................................................. 2-17
Summary of Instructions Causing Alignment Exceptions ......................................................................... 2-17
Instruction Set ................................................................................................................................................ 2-36
Instructions Specific to the IBM PowerPC Embedded Environment...................................................... 2-37
Interrupt Control Instructions ..................................................................................................................... 2-41
Processor State After Reset ............................................................................................................................ 3-1
Machine State Register Contents after Reset ............................................................................................. 3-2
Contents of Special Purpose Registers after Reset .................................................................................... 3-3
Initialization Code Example .............................................................................................................................. 3-5
Instruction Cachability Control ..................................................................................................................... 4-5
DCU Load and Store Strategies .................................................................................................................. 4-8
Data Cachability Control .............................................................................................................................. 4-8
Data Machine Check Handling .................................................................................................................. 5-15
Data Storage Interrupt ................................................................................................................................... 5-16
Program Interrupt .......................................................................................................................................... 5-20
System Call Interrupt ..................................................................................................................................... 5-22
Data TLB Miss Interrupt ................................................................................................................................. 5-25
Instruction TLB Miss Interrupt ........................................................................................................................ 5-25
Time Base ....................................................................................................................................................... 6-1
Reading the Time Base .............................................................................................................................. 6-3
Writing the Time Base ................................................................................................................................. 6-3
Translation Field ..................................................................................................................................... 7-4
Access Control Fields ............................................................................................................................. 7-5
Shadow Data TLB ....................................................................................................................................... 7-7
Data Storage Interrupt .............................................................................................................................. 7-10
Data TLB Miss Interrupt ............................................................................................................................ 7-11
Instruction TLB Miss Interrupt ................................................................................................................... 7-11
Program Interrupt ...................................................................................................................................... 7-11
Zone Protection .................................................................................................................................... 7-14
Access Protection for Cache Control Instructions ..................................................................................... 7-16
Access Protection for String Instructions .................................................................................................. 7-17
viiiPPC405 Core User’s Manual
Real-Mode Storage Attribute Control ............................................................................................................. 7-17
Storage Attribute Control Registers ........................................................................................................... 7-19
Data Cache Write-through Register (DCWR) ....................................................................................... 7-19
Data Cache Cachability Register (DCCR) ............................................................................................ 7-20
Development Tool Support .............................................................................................................................. 8-1
Processor Control ............................................................................................................................................ 8-3
Processor Status .............................................................................................................................................. 8-4
Debug Control Registers ............................................................................................................................. 8-4
Debug Control Register 0 (DBCR0) ........................................................................................................ 8-4
Debug Control Register1 (DBCR1) ......................................................................................................... 8-6
Debug Status Register (DBSR) .................................................................................................................. 8-7
Trace Port ...................................................................................................................................................... 8-22
Chapter 9. Instruction Set .....................................................................................................9-1
Instruction Set Portability ................................................................................................................................. 9-1
and ............................................................................................................................................................ 9-15
b ................................................................................................................................................................ 9-19
bc .............................................................................................................................................................. 9-20
nor ........................................................................................................................................................... 9-139
or ............................................................................................................................................................. 9-140
ori ............................................................................................................................................................ 9-142
General Purpose Registers ............................................................................................................................ 10-1
Machine State Register and Condition Register ............................................................................................ 10-1
Special Purpose Registers ............................................................................................................................. 10-2
Time Base Registers ...................................................................................................................................... 10-4
Device Control Registers ............................................................................................................................... 10-4
Alphabetical Listing of PPC405 Registers ..................................................................................................... 10-5
LR ............................................................................................................................................................ 10-31
TSR ......................................................................................................................................................... 10-51
Rotate and Shift Instructions ......................................................................................................................... B-40
Cache Control Instructions ............................................................................................................................ B-41
Interrupt Control Instructions ......................................................................................................................... B-42
General Rules ............................................................................................................................................. C-3
Scalar Store Instructions ............................................................................................................................. C-6
Alignment in Scalar Load and Store Instructions ........................................................................................ C-6
String and Multiple Instructions ................................................................................................................... C-6
Loads and Store Misses ............................................................................................................................. C-7
Figure 7-4. Process ID (PID) .........................................................................................................................7-14
Figure 7-5. Zone Protection Register (ZPR) .................................................................................................7-15
Figure 7-6. Generic Storage Attribute Control Register ................................................................................7-19
Figure 8-1. Debug Control Register 0 (DBCR0) .............................................................................................8-4
Figure 8-2. Debug Control Register 1 (DBCR1) .............................................................................................8-6
Figures xv
Figure 8-3. Debug Status Register (DBSR) .................................................................................................... 8-8
Figure 10-17. Instruction Cache Debug Data Register (ICDBDR) ............................................................. 10-30
Figure 10-18. Link Register (LR) ................................................................................................................ 10-31
Figure 10-19. Machine State Register (MSR) ............................................................................................ 10-32
Figure 10-20. Process ID (PID) .................................................................................................................. 10-34
Figure 10-31. Time Base Lower (TBL) ....................................................................................................... 10-48
Figure 10-32. Time Base Upper (TBU) ....................................................................................................... 10-49
Figure 10-33. Timer Control Register (TCR) .............................................................................................. 10-50
Figure 10-34. Timer Status Register (TSR) ................................................................................................ 10-51
Figure 10-35. User SPR General 0 (USPRG0) .......................................................................................... 10-52
Figure 10-36. Fixed Point Exception Register (XER) ................................................................................. 10-53
Figure 10-37. Zone Protection Register (ZPR) ........................................................................................... 10-54
xviPPC405 Core User’s Manual
Figure A-1. I Instruction Format ....................................................................................................................A-44
Figure A-2. B Instruction Format ...................................................................................................................A-44
Figure A-3. SC Instruction Format ................................................................................................................A-44
Figure A-4. D Instruction Format ...................................................................................................................A-44
Figure A-5. X Instruction Format ...................................................................................................................A-45
Figure A-6. XL Instruction Format .................................................................................................................A-45
Figure A-7. XFX Instruction Format ..............................................................................................................A-46
Figure A-8. XO Instruction Format ................................................................................................................A-46
Figure A-9. M Instruction Format ..................................................................................................................A-46
Table 2-4. Time Base Registers..................................................................................................................... 2-13
Table 2-6. Bits of the BO Field ...................................................................................................................... 2-25
Table 2-7. Conditional Branch BO Field ........................................................................................................ 2-26
Table 2-8. Example Memory Mapping............................................................................................................ 2-30
Table 5-11. Register Settings during Alignment Interrupts ............................................................................ 5-19
Table 5-12. ESR Usage for Program Interrupts ............................................................................................ 5-20
xviiiPPC405 Core User’s Manual
Table 5-13. Register Settings during Program Interrupts ..............................................................................5-21
Table 5-14. Register Settings during FPU Unavailable Interrupts .................................................................5-21
Table 5-15. Register Settings during System Call Interrupts .........................................................................5-22
Table 5-16. Register Settings during APU Unavailable Interrupts .................................................................5-22
Table 5-17. Register Settings during Programmable Interval Timer Interrupts ..............................................5-23
Table 5-18. Register Settings during Fixed Interval Timer Interrupts ............................................................5-24
Table 5-19. Register Settings during Watchdog Timer Interrupts ..................................................................5-24
Table 5-20. Register Settings during Data TLB Miss Interrupts .....................................................................5-25
Table 5-21. Register Settings during Instruction TLB Miss Interrupts ............................................................5-25
Table 5-22. SRR2 during Debug Interrupts ....................................................................................................5-26
Table 5-23. Register Settings during Debug Interrupts ..................................................................................5-26
Table 6-1. Time Base Access ..........................................................................................................................6-3
Table 6-2. FIT Controls ....................................................................................................................................6-5
Table 9-32. Extended Mnemonics for tlbre .................................................................................................. 9-185
Table 9-33. Extended Mnemonics for tlbwe ................................................................................................ 9-189
Table 9-34. Extended Mnemonics for tw ..................................................................................................... 9-191
Table 9-35. Extended Mnemonics for twi .................................................................................................... 9-194
Table 10-1. PPC405 General Purpose Registers........................................................................................... 10-1
Table 10-2. Special Purpose Registers ......................................................................................................... 10-2
Table 10-3. Time Base Registers................................................................................................................... 10-4
Table C-1. Cache Sizes, Tag Fields, and Lines.............................................................................................. C-2
Table C-2. Multiply and MAC Instruction Timing............................................................................................. C-5
Table C-3. Instruction Cache Miss Penalties................................................................................................... C-7
xxPPC405 Core User’s Manual
About This Book
This user’s manual provides the architectural overview,programming model, and detailed information
about the registers, the instruction set, and operations of the IBM™ PowerPC™ 405 (PPC405 core)
32-bit RISC embedded processor core.
The PPC405 RISC embedded processor core features:
• PowerPC Architecture™
• Single-cycle execution for most instructions
• Instruction cache unit and data cache unit
• Support for little endian operation
• Interrupt interface for one critical and one non-critical interrupt signal
• JTAG interface
• Extensive development tool support
Who Should Use This Book
This book is for system hardware and software developers, and for application developers who need
to understand the PPC405 core. The audience should understand embedded processor design,
embedded system design, operating systems, RISC processing, and design for testability.
How to Use This Book
This book describes the PPC405 device architecture, programming model, external interfaces,
internal registers, and instruction set. This book contains the following chapters, arranged in parts:
Chapter 1Overview
Chapter 2Programming Model
Chapter 3Initialization
Chapter 4Cache Operations
Chapter 5Fixed-Point Interrupts and Exceptions
Chapter 6Timer Facilities
Chapter 7Memory Management
Chapter 8Debugging
Chapter 9Instruction Set
Chapter 10Register Summary
This book contains the following appendixes:
Appendix AInstruction Summary
Appendix BInstructions by Category
Appendix CCode Optimization and Instruction Timings
About This Bookxxi
To help readers find material in these chapters, the book contains:
Contents, on page v.
Figures, on page xv.
Tables, on page xviii.
Index, on page X-1.
Conventions
The following is a list of notational conventions frequently used in this manual.
ActiveLowAn overbar indicates an active-low signal.
n
0x
0b
n
n
A decimal number
A hexadecimal number
A binary number
+Twos complement addition
–Twos complement subtraction, unary minus
×Multiplication
÷Division yielding a quotient
%Remainder of an integer division; (33 % 32) = 1.
||Concatenation
=, ≠Equal, not equal relations
<, >Signed comparison relations
u
u
,Unsigned comparison relations
>
<
if...then...else...Conditional execution; if
condition
thena elseb, wherea andb represent
one or more pseudocode statements. Indenting indicates the ranges of
andb. Ifb is null, the else does not appear.
doDo loop. “to” and “by” clauses specify incrementing an iteration variable;
“while” and “until” clauses specify terminating conditions. Indenting
indicates the scope of a loop.
leaveLeave innermost do loop or do loop specified in a leave statement.
FLDAn instruction or register field
FLD
b
FLD
b:b
xxiiPPC405 Core User’s Manual
A bit in a named instruction or register field
A range of bits in a named instruction or register field
a
FLD
REG
REG
REG
b,b, . . .
b
b:b
b,b, . . .
A list of bits, by number or name, in a named instruction or register field
A bit in a named register
A range of bits in a named register
A list of bits, by number or name, in a named register
REG[FLD]A field in a named register
REG[FLD, FLD
]A list of fields in a named register
. . .
REG[FLD:FLD]Arange of fields in a named register
GPR(r)General Purpose Register (GPR) r, where 0 ≤ r ≤ 31.
(GPR(r))The contents of GPR r, where 0 ≤ r ≤ 31.
DCR(DCRN)A Device Control Register (DCR) specified by the DCRF field in an
mfdcr or mtdcr instruction
SPR(SPRN)An SPR specified by the SPRF field in an mfspr or mtspr instruction
TBR(TBRN)A Time Base Register (TBR) specified by the TBRF field in an mftb
instruction
GPRsRA, RB,
. . .
(Rx)The contents of a GPR, wherex is A, B, S, or T
(RA|0)The contents of the register RA or 0, if the RA field is 0.
CR
FLD
c
0:3
n
bThe bit or bit valueb is replicatedn times.
The field in the condition register pointed to by a field of an instruction.
A 4-bit object used to store condition results in compare instructions.
xxBit positions which are don’t-cares.
CEIL(x)Least integer ≥ x.
EXTS(x)The result of extending
x
on the left with sign bits.
PCProgram counter.
RESERVEReserve bit; indicates whether a process has reserved a block of
storage.
CIACurrent instruction address; the 32-bit address of the instruction being
described by a sequence of pseudocode. This address is used to set the
next instruction address (NIA). Does not correspond to any architected
register.
NIANext instruction address; the 32-bit address of the next instruction to be
executed. In pseudocode, a successful branch is indicated by assigning
a value to NIA. For instructions that do not branch, the NIA is CIA +4.
n
MS(addr, n)The number of bytes represented by
addr
represented by
.
at the location in main storage
EAEffective address; the 32-bit address, derived by applying indexing or
indirect addressing rules to the specified operand, that specifies a
location in main storage.
About This Bookxxiii
EA
EA
b
b:b
A bit in an effective address.
A range of bits in an effective address.
ROTL((RS),n)Rotate left; the contents of RS are shifted left the number of bits
specified byn.
MASK(MB,ME)Mask having 1s in positions MB through ME (wrapping if MB > ME) and
0s elsewhere.
instruction(EA)An instruction operating on a data or instruction cache block associated
with an EA.
xxivPPC405 Core User’s Manual
Chapter 1.Overview
The IBM 405 32-bit reduced instruction set computer (RISC) processor core, referred to as the
PPC405 core, implements the PowerPC Architecture with extensions for embedded applications.
This chapter describes:
• PPC405 core features
• The PowerPC Architecture
• The PPC405 implementation of the IBM PowerPC Embedded Environment, an extension of the
PowerPC Architecture for embedded applications
• PPC405 organization, including a block diagram and descriptions of the functional units
• PPC405 registers
• PPC405 addressing modes
1.1PPC405 Features
The PPC405 core provides high performance and low power consumption. The PPC405 RISC CPU
executes at sustained speeds approaching one cycle per instruction. On-chip instruction and data
caches arrays can be implemented to reduce chip count and design complexity in systems and
improve system throughput.
The PowerPC RISC fixed-point CPU features:
• PowerPC User Instruction Set Architecture (UISA) and extensions for embedded applications
• Thirty-two 32-bit general purpose registers (GPRs)
• Static branch prediction
• Five-stage pipeline with single-cycle execution of most instructions, including loads/stores
• Unaligned load/store support to cache arrays, main memory, and on-chip memory (OCM)
• Storage control
– Separate, configurable, two-way set-associative instruction and data cache units; for the
PPC405B3, the instruction cache array is 16KB and the data cache array is 8KB
– Eight words (32 bytes) per cache line
– Support for any combination of 0KB, 4KB, 8KB, and 16KB, and 32KB instruction and data cache
arrays, depending on model
Overview1-1
– Instruction cache unit (ICU) non-blocking during line fills, data cache unit (DCU) non-blocking
during line fills and flushes
– Read and write line buffers
– Instruction fetch hits are supplied from line buffer
– Data load/store hits are supplied to line buffer
– Programmable ICU prefetching of next sequential line into line buffer
– Programmable ICU prefetching of non-cacheable instructions, full line (eight words) or half line
(four words)
– Write-back or write-through DCU write strategies
– Programmable allocation on loads and stores
– Operand forwarding during cache line fills
• Memory Management
– Translation of the 4GB logical address space into physical addresses
– Independent enabling of instruction and data translation/protection
– Page level access control using the translation mechanism
– Software control of page replacement strategy
– Additional control over protection using zones
• WIU0GE storage attribute control for thirty-two real 128MB regions in real mode
• Support for OCM that provides memory access performance identical to cache hits
• Full PowerPC floating-point unit (FPU) support using the auxiliary processor unit (APU) interface
(the PPC405 does not include an FPU)
• PowerPC timer facilities
– 64-bit time base
– PIT, FIT, and watchdog timers
– Synchronous external time base clock input
• Debug Support
– Enhanced debug support with logical operators
– Four instruction address compares (IACs)
– Two data address compares (DACs)
– Two data value compares (DVCs)
– JTAG instruction to write to ICU
– Forward or backward instruction tracing
• Minimized interrupt latency
• Advanced power management support
1-2PPC405 Core User’s Manual
1.2PowerPC Architecture
The PowerPC Architecture comprises three levels of standards:
• PowerPC User Instruction Set Architecture (UISA), including the base user-level instruction set,
user-level registers, programming model, data types, and addressing modes. This is referred to as
Book I of the PowerPC Architecture.
control instructions, address aliasing, and related issues. While accessible from the user level,
these features are intended to be accessed from within library routines provided by the system
software. This is referred to as Book II of the PowerPC Architecture.
• PowerPC Operating Environment Architecture, including the memory management model,
supervisor-level registers, and the exception model. These features are not accessible from the
user level. This is referred to as Book III of the PowerPC Architecture.
Book I and Book II define the instruction set and facilities available to the application programmer.
Book III defines features, such as system-level instructions, that are not directly accessible by user
applications. The PowerPC Architecture is described in
for a New Family of RISC Processors
The PowerPC Architecture provides compatibility of PowerPC Book I application code across all
PowerPC implementations to help maximize the portability of applications developed for PowerPC
processors. This is accomplished through compliance with the first level of the architectural definition,
the PowerPC UISA, which is common to all PowerPC implementations.
.
The PowerPC Architecture: A Specification
1.3The PPC405 as a PowerPC Implementation
The PPC405 implements the PowerPC UISA, user-level registers, programming model, data types,
addressing modes, and 32-bit fixed-point operations. The PPC405 fully complies with the PowerPC
UISA. The UISA 64-bit operations are not implemented, nor are the floating point operations, unless a
floating point unit (FPU) is implemented. The floating point operations, which cause exceptions, can
then be emulated by software.
Most of the features of the PPC405 are compatible with the PowerPC Virtual Environment and
Operating Environment Architectures, as implemented in PowerPC processors such as the
6xx/7xx family. The PPC405 also provides a number of optimizations and extensions to these layers
of the PowerPC Architecture. The full architecture of the PPC405 is defined by the PowerPC
Embedded Environment and the PowerPC User Instruction Set Architecture.
The primary extensions of the PowerPC Architecture defined in the Embedded Environment are:
• A simplified memory management mechanism with enhancements for embedded applications
• An enhanced, dual-level interrupt structure
• An architected DCR address space for integrated peripheral control
• The addition of several instructions to support these modified and extended resources
Finally, some of the specific implementation features of the PPC405 are beyond the scope of the
PowerPC Architecture. These features are included to enhance performance, integrate functionality,
and reduce system complexity in embedded control applications.
Overview1-3
1.4Processor Core Organization
The processor core consists of a 5-stage pipeline, separate instruction and data cache units, virtual
memory management unit (MMU), three timers, debug, and interfaces to other functions.
Figure 1-1 illustrates the logical organization of the PPC405.
PLB MasterInstruction
InterfaceOCM
I-CacheI-Cache
ControllerArray
Instruction
Cache
Unit
Cache Units
Data
Cache
Unit
D-Cache D-Cache
ControllerArray
PLB MasterData
InterfaceOCM
MMU
Instruction Shadow
TLB
(4 Entry)
Unified TLB
(64 Entry)
Data Shadow
TLB
(8 Entry)
405 CPU
Fetch
Decode
Logic
Execute Unit (EXU)
32 x 32
GPR
3-Element
and
ALU
Figure 1-1. PPC405 Block Diagram
Fetch
Queue
(PFB1,
PFB0,
DCD)
MAC
APU/FPU
Timers
(FIT,
PIT,
Watchdog)
Timers
&
Debug
Debug Logic
(4 IAC,
2 DAC,
2 DVC)
JTAGInstruction
Trace
1.4.1Instruction and Data Cache Controllers
The instruction cache unit (ICU) and data cache unit (DCU) enable concurrent accesses and
minimize pipeline stalls. The storage capacity of the cache units, which can range from 0KB–32KB,
depends upon the implementation. Both cache units are two-way set-associative, use a 32-byte line
size. The instruction set provides a rich assortment of cache control instructions, including
instructions to read tag information and data arrays. See Chapter 4, “Cache Operations,” for detailed
information about the ICU and DCU.
The cache units are PLB-compliant for use in the IBM Core+ASIC program.
1.4.1.1Instruction Cache Unit
The ICU provides one or two instructions per cycle to the execution unit (EXU) over a 64-bit bus. A
line buffer (built into the output of the array for manufacturing test) enables the ICU to be accessed
only once for every four instructions, to reduce power consumption by the array.
The ICU can forward any or all of the words of a line fill to the EXU to minimize pipeline stalls caused
by cache misses. The ICU aborts speculative fetches abandoned by the EXU, eliminating
1-4PPC405 Core User’s Manual
unnecessary line fills and enabling the ICU to handle the next EXU fetch. Aborting abandoned
requests also eliminates unnecessary external bus activity to increase external bus utilization.
1.4.1.2Data Cache Unit
The DCU transfers 1, 2, 3, 4, or 8 bytes per cycle, depending on the number of byte enables
presented by the CPU.The DCU contains a single-element command and store data queue to reduce
pipeline stalls; this queue enables the DCU to independently process load/store and cache control
instructions. Dynamic PLB request prioritization reduces pipeline stalls evenfurther.When the DCU is
busy with a low-priority request while a subsequent storage operation requested by the CPU is
stalled, the DCU automatically increases the priority of the current request to the PLB.
The DCU uses a two-line flush queue to minimize pipeline stalls caused by cache misses. Line
flushes are postponed until after a line fill is completed. Registers comprise the first position of the
flush queue; the line buffer built into the output of the array for manufacturing test serves as the
second position of the flush queue. Pipeline stalls are further reduced by forwarding the requested
word to the CPU during the line fill. Single-queued flushes are non-blocking. When a flush operation
is pending, the DCU can continue to access the array to determine subsequent load or store hits.
Under these conditions, load hits can occur concurrently with store hits to write-back memory without
stalling the pipeline. Requests abandoned by the CPU can also be aborted by the cache controller.
Additional DCU features enable the programmer to tailor performance for a given application. The
DCU can function in write-back or write-through mode, as controlled by the Data Cache Write-through
Register (DCWR) or the translation look-aside buffer (TLB). DCU performance can be tuned to
balance performance and memory coherency.Store-without-allocate, controlled by the SWOA field of
the Core Configuration Register 0 (CCR0), can inhibit line fills caused by store misses to further
reduce potential pipeline stalls and unwanted external bus traffic. Similarly, load-without-allocate,
controlled by CCR0[LWOA], can inhibit line fills caused by load misses.
1.4.2Memory Management Unit
The 4GB address space of the PPC405 is presented as a flat address space.
The MMU provides address translation, protection functions, and storage attribute control for
embeddedembedded applications. The MMU supports demand paged virtual memory and other
management schemes that require precise control of logical to physical address mapping and flexible
memory protection. Working with appropriate system level software, the MMU provides the following
functions:
• Translation of the 4GB logical address space into physical addresses
• Independent enabling of instruction and data translation/protection
• Page level access control using the translation mechanism
• Software control of page replacement strategy
• Additional control over protection using zones
• Storage attributes for cache policy and speculative memory access control
The MMU can be disabled under software control. If the MMU is not used, the PPC405 core provides
other storage control mechanisms.
The translation lookaside buffer (TLB) is the hardware resource that controls translation and
protection. It consists of 64 entries, each specifying a page to be translated. The TLB is fully
Overview1-5
associative; a page entry can be placed anywhere in the TLB. The translation function of the MMU
occurs pre-cache for data accesses. Cache tags and indexing use physical addresses for data
accesses; instruction fetches are virtually indexed and physically tagged.
Software manages the establishment and replacement of TLB entries. This gives system software
significant flexibility in implementing a custom page replacement strategy. For example, to reduce
TLB thrashing or translation delays, software can reserve several TLB entries for globally accessible
static mappings. The instruction set provides several instructions to manage TLB entries. These
instructions are privileged and require the software to be executingin supervisor state. Additional TLB
instructions are provided to move TLB entry fields to and from GPRs.
The MMU divides logical storage into pages. Eight page sizes (1KB, 4KB, 16KB, 64KB, 256KB, 1MB,
4MB, 16MB) are simultaneously supported, so that, at any given time, the TLB can contain entries for
any combination of page sizes. For a logical to physical translation to occur, a valid entry for the page
containing the logical address must be in the TLB. Addresses for which no TLB entry exists cause
TLB-Miss exceptions.
To improve performance, 4 instruction-side and 8 data-side TLB entries are kept in shadow arrays.
The shadow arrays prevent TLB contention. Hardware manages the replacement and invalidation of
shadow-TLB entries; no system software action is required. The shadow arrays can be thought of as
level 1 TLBs, with the main TLB serving as a level 2 TLB.
When address translation is enabled, the translation mechanism provides a basic level of protection.
Physical addresses not mapped by a page entry are inaccessible when translation is enabled. Read
access is implied by the existence of the valid entry in the TLB. The EX and WR bits in the TLB entry
further define levels of access for the page, by permitting execute and write access, respectively.
The Zone Protection Register (ZPR) enables the system software to override the TLB access
controls. For example, the ZPR provides a way to deny read access to application programs. The
ZPR can be used to classify storage by type; access by type can be changed without manipulating
individual TLB entries.
The PowerPC Architecture provides WIU0GE (write-back/write through, cachability, user-defined 0,
guarded, endian) storage attributes that control memory accesses, using bits in the TLB or, when
address translation is disabled, storage attribute control registers.
When address translation is enabled (MSR[IR, DR] = 1), storage attribute control bits in the TLB
control the storage attributes associated with the current page. When address translation is disabled
(MSR[IR, DR] = 0), bits in each storage attribute control register control the storage attributes
associated with storage regions. Each storage attribute control register contains 32 fields. Each field
sets the associated storage attribute for a 128MB memory region. See “Real-Mode Storage Attribute
Control” on page 7-17 for more information about the storage attribute control registers.
1.4.3Timer Facilities
The processor core contains a time base and three timers:
• Programmable Interval Timer (PIT)
• Fixed Interval Timer (FIT)
• Watchdog timer
1-6PPC405 Core User’s Manual
Loading...
+ 522 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.