Unpublished rights (if any) reserved under the copyright laws of the United States of America and other countries.
This document contains information that is proprietary to MIPS Tech, LLC, a Wave Computing company (“MIPS”) and MIPS’
affiliates as applicable. Any copying, reproducing, modifying or use of this information (in whole or in part) that is not expressly
permitted in writing by MIPS or MIPS’ affiliates as applicable or an authorized third party is strictly prohibited. At a minimum,
this information is protected under unfair competition and copyright laws. Violations thereof may result in criminal penalties
and fines. Any document provided in source format (i.e., in a modifiable form such as in FrameMaker or Microsoft Word
format) is subject to use and distribution restrictions that are independent of and supplemental to any and all confidentiality
restrictions. UNDER NO CIRCUMSTANCES MAY A DOCUMENT PROVIDED IN SOURCE FORMAT BE DISTRIBUTED TO A THIRD
PARTY IN SOURCE FORMAT WITHOUT THE EXPRESS WRITTEN PERMISSION OF MIPS (AND MIPS’ AFFILIATES AS APPLICABLE)
reserve the right to change the information contained in this document to improve function, design or otherwise.
MIPS and MIPS’ affiliates do not assume any liability arising out of the application or use of this information, or of any error or
omission in such information. Any warranties, whether express, statutory, implied or otherwise, including but not limited to the
implied warranties of merchantability or fitness for a particular purpose, are excluded. Except as expressly provided in any
written license agreement from MIPS or an authorized third party, the furnishing of this document does not give recipient any
license to any intellectual property rights, including any patent rights, that cover the information in this document.
The information contained in this document shall not be exported, reexported, transferred, or released, directly or indirectly, in
violation of the law of any country or international law, regulation, treaty, Executive Order, statute, amendments or
supplements thereto. Should a conflict arise regarding the export, reexport, transfer, or release of the information contained in
this document, the laws of the United States of America shall be the governing law.
The information contained in this document constitutes one or more of the following: commercial computer software,
commercial computer software documentation or other commercial items. If the user of this information, or any related
documentation of any kind, including related technical data or manuals, is an agency, department, or other entity of the United
States government ("Government"), the use, duplication, reproduction, release, modification, disclosure, or transfer of this
information, or any related documentation of any kind, is restricted in accordance with Federal Acquisition Regulation 12.212
for civilian agencies and Defense Federal Acquisition Regulation Supplement 227.7202 for military agencies. The use of this
information by the Government is further restricted in accordance with the terms of the license agreement(s) and/or applicable
contract terms and conditions covering this information from MIPS Technologies or an authorized third party.
MIPS, MIPS I, MIPS II, MIPS III, MIPS IV, MIPS V, MIPSr3, MIPS32, MIPS64, microMIPS32, microMIPS64, MIPS-3D, MIPS16,
MIPS16e, MIPS-Based, MIPSsim, MIPSpro, MIPS-VERIFIED, Aptiv logo, microAptiv logo, interAptiv logo, microMIPS logo, MIPS
Technologies logo, MIPS-VERIFIED logo, proAptiv logo, 4K, 4Kc, 4Km, 4Kp, 4KE, 4KEc, 4KEm, 4KEp, 4KS, 4KSc, 4KSd, M4K, M14K,
5K, 5Kc, 5Kf, 24K, 24Kc, 24Kf, 24KE, 24KEc, 24KEf, 34K, 34Kc, 34Kf, 74K, 74Kc, 74Kf, 1004K, 1004Kc, 1004Kf, 1074K, 1074Kc,
1074Kf, R3000, R4000, R5000, Aptiv, ASMACRO, Atlas, "At the core of the user experience.", BusBridge, Bus Navigator, CLAM,
CorExtend, CoreFPGA, CoreLV, EC, FPGA View, FS2, FS2 FIRST SILICON SOLUTIONS logo, FS2 NAVIGATOR, HyperDebug,
HyperJTAG, IASim, iFlowtrace, interAptiv, JALGO, Logic Navigator, Malta, MDMX, MED, MGB, microAptiv, microMIPS, Navigator,
OCI, PDtrace, the Pipeline, proAptiv, Pro Series, SEAD-3, SmartMIPS, SOC-it, and YAMON are trademarks or registered
trademarks of MIPS and MIPS’ affiliates as applicable in the United States and other countries.
All other trademarks referred to herein are the property of their respective owners.
MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.043
4MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.04
Table of Contents
Chapter 1: Introduction to the MIPS32® M14K™ Processor Core.....................................................4
1.1: Features ...................................................................................................................................................... 4
2.6: Data Bypassing ......................................................................................................................................... 33
3.2: Modes of Operation...................................................................................................................................44
3.2.2: User Mode........................................................................................................................................46
3.4: System Control Coprocessor..................................................................................................................... 53
Chapter 4: Exceptions and Interrupts in the M14K™ Core...............................................................55
6.2.2: Coprocessor 0 State ...................................................................................................................... 150
Chapter 7: Power Management of the M14K™ Core.......................................................................153
7.1: Register-Controlled Power Management ................................................................................................ 153
7.2: Instruction-Controlled Power Management.............................................................................................154
Chapter 8: EJTAG Debug Support in the M14K™ Core..................................................................155
8.1: Debug Control Register...........................................................................................................................155
8.3.1: Checking for Presence of Complex Break Support........................................................................ 182
8.3.2: General Complex Break Behavior.................................................................................................. 183
8.3.3: Usage of Pass Counters................................................................................................................183
8.3.4: Usage of Tuple Breakpoints...........................................................................................................184
8.3.5: Usage of Priming Conditions.......................................................................................................... 184
8.3.6: Usage of Data Qualified Breakpoints............................................................................................. 185
8.3.7: Usage of Stopwatch Timers........................................................................................................... 185
8.4: Test Access Port (TAP)...........................................................................................................................186
8.4.1: EJTAG Internal and External Interfaces......................................................................................... 186
8.4.2: Test Access Port Operation...........................................................................................................187
8.5: EJTAG TAP Registers............................................................................................................................. 193
8.9.1: PC Sampling in Wait State.............................................................................................................220
8.9.2: Data Address Sampling ................................................................................................................. 220
8.10: Fast Debug Channel.............................................................................................................................. 220
8.10.1: Common Device Memory Map..................................................................................................... 221
8.10.2: Fast Debug Channel Interrupt......................................................................................................221
Chapter 9: Instruction Set Overview.................................................................................................230
9.1: CPU Instruction Formats.........................................................................................................................230
9.2: Load and Store Instructions..................................................................................................................... 231
9.2.1: Scheduling a Load Delay Slot........................................................................................................ 231
9.3.1: Cycle Timing for Multiply and Divide Instructions........................................................................... 233
9.4: Jump and Branch Instructions.................................................................................................................233
9.4.1: Overview of Jump Instructions....................................................................................................... 233
9.4.2: Overview of Branch Instructions .................................................................................................... 233
9.5: Control Instructions.................................................................................................................................. 233
6MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.04
9.8: MCU ASE Instructions............................................................................................................................. 235
Figure 1.6: cJTAG Support ..................................................................................................................................... 21
Figure 2.1: M14K™ Core Pipeline Stages with high-performance MDU ...............................................................23
Figure 2.2: M14K™ Core Pipeline Stages with area-efficient MDU .......................................................................23
Figure 2.3: MDU Pipeline Behavior During Multiply Operations ............................................................................28
Figure 2.4: MDU Pipeline Flow During a 32x16 Multiply Operation ....................................................................... 29
Figure 2.5: MDU Pipeline Flow During a 32x32 Multiply Operation ....................................................................... 29
Figure 2.6: High-Performance MDU Pipeline Flow During a 8-bit Divide (DIV) Operation ....................................30
Figure 2.7: High-Performance MDU Pipeline Flow During a 16-bit Divide (DIV) Operation ..................................30
Figure 2.8: High-Performance MDU Pipeline Flow During a 24-bit Divide (DIV) Operation ..................................30
Figure 2.9: High-Performance MDU Pipeline Flow During a 32-bit Divide (DIV) Operation ..................................30
Figure 2.10: M14K™ Area-Efficient MDU Pipeline Flow During a Multiply Operation ...........................................31
Figure 2.11: M14K™ Core Area-Efficient MDU Pipeline Flow During a Multiply Accumulate Operation ............... 32
Figure 2.12: M14K™ Core Area-Efficient MDU Pipeline Flow During a Divide (DIV) Operation ...........................32
Figure 2.13: IU Pipeline Branch Delay ................................................................................................................... 33
Figure 2.14: IU Pipeline Data Bypass ...................................................................................................................34
Figure 2.15: IU Pipeline M to E bypass .................................................................................................................. 34
Figure 2.16: IU Pipeline A to E Data bypass .......................................................................................................... 35
Figure 2.17: IU Pipeline Slip after a MFHI ..............................................................................................................35
Figure 8.17: DVM Register Format ......................................................................................................................177
Figure 8.18: CBTC Register Format ..................................................................................................................... 178
Figure 8.19: PrCndA Register Format ..................................................................................................................179
Figure 8.20: STCtl Register Format .....................................................................................................................181
Figure 8.21: STCnt Register Format .................................................................................................................... 182
2MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.04
Figure 8.22: TAP Controller State Diagram ......................................................................................................... 188
Figure 8.23: Concatenation of the EJTAG Address, Data and Control Registers ................................................192
Figure 8.24: TDI to TDO Path When in Shift-DR State and FASTDATA Instruction is Selected ......................... 193
Figure 8.25: Device Identification Register Format .............................................................................................. 194
Figure 8.26: Implementation Register Format ......................................................................................................195
Figure 8.27: EJTAG Control Register Format ...................................................................................................... 196
Figure 8.28: Endian Formats for the PAD Register ..............................................................................................203
Table 5.2: CP0 Register R/W Field Types..............................................................................................................90
Table 5.4: HWREna Register Field Descriptions....................................................................................................91
Table 5.3: UserLocal Register Field Descriptions................................................................................................... 91
Table 5.5: BadVAddr Register Field Description.....................................................................................................92
Table 5.6: BadInstr Register Field Descriptions...................................................................................................... 93
Table 5.8: Count Register Field Description ........................................................................................................... 94
Table 5.7: BadInstrP Register Field Descriptions ................................................................................................... 94
Table 5.9: Compare Register Field Description......................................................................................................95
Table 5.10: Status Register Field Descriptions....................................................................................................... 96
Table 5.11: IntCtl Register Field Descriptions....................................................................................................... 100
Table 5.12: SRSCtl Register Field Descriptions ................................................................................................... 103
Table 5.13: Sources for new SRSCtl
Table 5.14: SRSMap Register Field Descriptions................................................................................................. 106
Table 5.15: View_IPL Register Field Descriptions................................................................................................ 107
Table 5.16: SRSMap Register Field Descriptions................................................................................................. 108
Table 5.17: Cause Register Field Descriptions..................................................................................................... 108
Table 5.18: Cause Register ExcCode Field.......................................................................................................... 112
Table 5.19: View_RIPL Register Field Descriptions ............................................................................................. 113
Table 5.20: NestedExc Register Field Descriptions.............................................................................................. 114
on an Exception or Interrupt................................................................. 106
CSS
MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.041
Table 5.21: EPC Register Field Description..........................................................................................................115
Table 5.22: NestedEPC Register Field Descriptions ............................................................................................ 116
Table 5.23: PRId Register Field Descriptions.......................................................................................................116
Table 5.24: EBase Register Field Descriptions.....................................................................................................118
Table 5.25: CDMMBase Register Field Descriptions............................................................................................ 119
Table 5.26: Config Register Field Descriptions..................................................................................................... 120
Table 8.31: EJTAG Control Register Descriptions................................................................................................ 197
Table 8.32: Fastdata Register Field Description................................................................................................... 203
Table 8.33: Operation of the FASTDATA access ................................................................................................. 204
Table 8.34: EJ_DisableProbeDebug Signal Overview.......................................................................................... 207
Table 8.35: Data Bus Encoding ............................................................................................................................ 213
Table 8.36: Tag Bit Encoding................................................................................................................................ 213
Table 8.37: Control/Status Register Field Descriptions ........................................................................................ 215
Table 8.38: ITCBTW Register Field Descriptions ................................................................................................. 216
Table 8.39: ITCBRDP Register Field Descriptions ............................................................................................... 217
Table 8.40: ITCBWRP Register Field Descriptions...............................................................................................217
Table 8.41: drseg Registers that Enable/Disable Trace from Breakpoint-Based Triggers.................................... 218
Table 8.42: FDC TAP Register Field Descriptions................................................................................................ 223
Table 8.48: FDC Transmit Register Field Descriptions......................................................................................... 228
Table 9.1: Byte Access Within a Word.................................................................................................................. 232
Table 10.1: Encoding of the Opcode Field............................................................................................................ 237
Table 10.2: Special Opcode Encoding of Function Field......................................................................................237
Table 10.3: Special2 Opcode Encoding of Function Field....................................................................................237
Table 10.4: Special3 Opcode Encoding of Function Field....................................................................................238
Table 10.5: RegImm Encoding of rt Field..............................................................................................................238
Table 10.6: COP2 Encoding of rs Field ................................................................................................................238
Table 10.7: COP2 Encoding of rt Field When rs=BC2..........................................................................................238
Table 10.8: COP0 Encoding of rs Field ................................................................................................................239
Table 10.9: COP0 Encoding of Function Field When rs=CO................................................................................ 239
Table 11.8: 32-bit Instructions introduced within microMIPS................................................................................280
MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.043
Chapter 1
Introduction to the MIPS32® M14K™ Processor Core
The MIPS32® M14K™ core from MIPS Technologies is a high-performance, low-power, 32-bit MIPS RISC processor core intended for custom system-on-silicon applications. The core is designed for semiconductor manufacturing
companies, ASIC developers, and system OEMs who want to rapidly integrate their own custom logic and peripherals with a high-performance RISC processor. The M14K core is fully synthesizable to allow maximum flexibility; it
is highly portable across processes and can easily be integrated into full system-on-silicon designs. This allows developers to focus their attention on end-user specific characteristics of their product.
The M14K core is especially well-suited for microcontrollers and applications that have real-time requirements with
a high level of performance efficiency and security requirements.
The M14K core implements the MIPS Architecture in a 5-stage pipeline. It includes support for the microMIPS™
ISA, an Instruction Set Architecture with optimized MIPS32 16-bit and 32-bit instructions that provides a significant
reduction in code size with a performance equivalent to MIPS32. The M14K core is a successor to the M4K®,
designed from the same microarchitecture, including the Microcontroller Application-Specific Extension (MCU™
ASE), enhanced interrupt handling, lower interrupt latency, a memory protection unit (MPU), a reference design of
an optimized interface for flash memory and built-in native AMBA®-3 AHB-Lite Bus Interface Unit (BIU), with
additional power saving, debug, and profiling features.
The M14K core is cacheless; in lieu of caches, it includes a simple interface to SRAM-style devices. This interface
may be configured for independent instruction and data devices or combined into a unified interface. The SRAM
interface allows deterministic latency to memory, while still maintaining high performance.
The core includes one of two different Multiply/Divide Unit (MDU) implementations, selectable at build-time, allowing the user to trade-off performance and area for integer multiply and divide operations. The high-performance
MDU option implements single-cycle multiply and multiply-accumulate (MAC) instructions that enable DSP algorithms to be performed efficiently. It allows 32-bit x 16-bit MAC instructions to be issued every cycle, while a 32-bit
x 32-bit MAC instruction can be issued every other cycle. The area-efficient MDU option handles multiplies with a
one-bit-per-clock iterative algorithm.
The MMU consists of a simple Fixed Mapping Translation (FMT) mechanism, for applications that do not require
the full capabilities of a Translation Lookaside Buffer- (TLB-) based MMU available on other MIPS cores.
The basic Enhanced JTAG (EJTAG) features provide CPU run control with stop, single-stepping and re-start, and
with software breakpoints using the SDBBP instruction. Additional EJTAG features such as instruction and data virtual address hardware breakpoints, complex hardware breakpoints, connection to an external EJTAG probe through
the Test Access Port (TAP), and PC/Data tracing, may be included as an option.
1.1 Features
•5-stage pipeline
•32-bit Address and Data Paths
MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.044
1.1 Features
•MIPS32 Instruction Set Architecture
•MIPS32 Enhanced Architecture Features
•Vectored interrupts and support for external interrupt controller
•Programmable exception vector base
•Atomic interrupt enable/disable
•GPR shadow registers (one, three, seven, or fifteen additional shadows can be optionally added to minimize
latency for interrupt handlers)
•Bit field manipulation instructions
•microMIPS Instruction Set Architecture
•microMIPS ISA is a build-time configurable option that reduces code size over MIPS32, while maintaining
MIPS32 performance.
•Combining both 16-bit and 32-bit opcodes, microMIPS supports all MIPS32 instructions (except
branch-likely instructions) with new optimized encoding. Frequently used MIPS32 instructions are available
as 16-bit instructions.
•Added fifteen new 32-bit instructions and thirty-nine 16-bit instructions.
•Stack pointer implicit in instruction.
•MIPS32 assembly and ABI-compatible.
•Supports MIPS architecture Modules and User-defined Instructions (UDIs).
•MCU™ ASE
•Increases the number of interrupt hardware inputs from 6 to 8 for Vectored Interrupt (VI) mode, and from 63
to 255 for External Interrupt Controller (EIC) mode.
•Separate priority and vector generation. 16-bit vector address is provided.
•Hardware assist combined with the use of Shadow Register Sets to reduce interrupt latency during the prologue and epilogue of an interrupt.
•Two memory-to-memory atomic read-modify-write instructions (ASET and ACLR) eases commonly used
semaphore manipulation in microcontroller applications. Interrupts are automatically disabled during the
operation to maintain coherency.
•Memory Management Unit
MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.045
Introduction to the MIPS32® M14K™ Processor Core
•Simple Fixed Mapping Translation (FMT) mechanism
•Memory Protection Unit
•Optional feature that improves system security by restricting access, execution, and trace capabilities from
untrusted code in predefined memory regions.
•Simple SRAM-Style Interface
•Cacheless operation enables deterministic response and reduces die-size
•32-bit address and data; input byte-enables enable simple connection to narrower devices
•Single or multi-cycle latencies
•Configuration option for dual or unified instruction/data interfaces
•Redirection mechanism on dual I/D interfaces permits D-side references to be handled by I-side
•Transactions can be aborted
•Reference Design
•A typical SRAM reference design is provided.
•An AHB-Lite BIU reference design is provided between the SRAM interface and AHB-Lite Bus.
•An optimized interface for slow memory (Flash) access using prefetch buffer scheme is provided.
•Parity Support
•The ISRAM and DSRAM support optional parity detection.
•Multiply/Divide Unit (area-efficient configuration )
•32 clock latency on multiply
•34 clock latency on multiply-accumulate
•33-35 clock latency on divide (sign-dependent)
•Multiply/Divide Unit (high-performance configuration)
•Maximum issue rate of one 32x16 multiply per clock via on-chip 32x16 hardware multiplier array.
•Maximum issue rate of one 32x32 multiply every other clock
•Early-in iterative divide. Minimum 11 and maximum 34 clock latency (dividend (rs) sign extension-dependent)
•CorExtend® User-Defined Instruction Set Extensions
•Allows user to define and add instructions to the core at build time
6MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.04
•Maintains full MIPS32 compatibility
•Supported by industry-standard development tools
•Single or multi-cycle instructions
•Multi-Core Support
•External lock indication enables multi-processor semaphores based on LL/SC instructions
•External sync indication allows memory ordering
•Debug support includes cross-core triggers
•Coprocessor 2 interface
•32-bit interface to an external coprocessor
•Power Control
•Minimum frequency: 0 MHz
1.1 Features
•Power-down mode (triggered by WAIT instruction)
•Support for software-controlled clock divider
•Support for extensive use of local gated clocks
•EJTAG Debug/Profiling and iFlowtrace™ Mechanism
•CPU control with start, stop, and single stepping
•Virtual instruction and data address/value breakpoints
•Hardware breakpoint supports both address match and address range triggering
•Optional simple hardware breakpoints on virtual addresses; 8I/4D, 6I/2D, 4I/2D, 2I/1D breakpoints, or no
breakpoints
•Optional complex hardware breakpoints with 8I/4D, 6I/2D simple breakpoints
•TAP controller is chainable for multi-CPU debug
•Supports EJTAG (IEEE 1149.1) and compatible with cJTAG 2-wire (IEEE 1149.7) extension protocol
•Cross-CPU breakpoint support
•iFlowtrace support for real-time instruction PC and special events
•PC and/or load/store address sampling for profiling
•Performance Counters
MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.047
Introduction to the MIPS32® M14K™ Processor Core
•Support for Fast Debug Channel (FDC)
•SecureDebug
•An optional feature that disables access via EJTAG in an untrusted environment
•Testability
•Full scan design achieves test coverage in excess of 99% (dependent on library and configuration options)
1.2 M14K™ Core Block Diagram
The M14K core contains both required and optional blocks, as shown in the block diagram in Figure 1.1. Required
blocks are the lightly shaded areas of the block diagram and are always present in any core implementation. Optional
blocks may be added to the base core, depending on the needs of a specific implementation. The required blocks are
as follows:
•Instruction Decode
•Execution Unit
•General Purposed Registers (GPR)
•Multiply/Divide Unit (MDU)
•System Control Coprocessor (CP0)
•Memory Management Unit (MMU)
•I/D SRAM Interfaces
•Power Management
Optional blocks include:
•Configurable instruction decoder supporting three ISA modes: MIPS32-only, MIPS32 and microMIPS, or microMIPS-only
•Memory Protection Unit (MPU)
•Reference Design of I/D-SRAM, BIU, Slow Memory Interface
•Debug/Profiling with Enhanced JTAG (EJTAG) Controller, Break points, Sampling, Performance counters, Fast
Debug Channel, and iFlowtrace logic
8MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.04
Introduction to the MIPS32® M14K™ Processor Core
1.2.1.2 General Purposed Register (GPR) Shadow Registers
The M14K core contains thirty-two 32-bit general-purpose registers used for integer operations and address calculation. Optionally, one, three, seven or fifteen additional register file shadow sets (each containing thirty-two registers)
can be added to minimize context switching overhead during interrupt/exception processing. The register file consists
of two read ports and one write port and is fully bypassed to minimize operation latency in the pipeline.
1.2.1.3 Multiply/Divide Unit (MDU)
The M14K core includes a multiply/divide unit (MDU) that contains a separate, dedicated pipeline for integer multiply/divide operations. This pipeline operates in parallel with the integer unit (IU) pipeline and does not stall when the
IU pipeline stalls. This allows the long-running MDU operations to be partially masked by system stalls and/or other
integer unit instructions.
The MIPS architecture defines that the result of a multiply or divide operation be placed in a pair of
HI and LO regis-
ters. Using the Move-From-HI (MFHI) and Move-From-LO (MFLO) instructions, these values can be transferred to
the general-purpose register file.
There are two configuration options for the MDU: 1) a higher performance 32x16 multiplier block; 2) an area-efficient iterative multiplier block. . The selection of the MDU style allows the implementor to determine the appropriate
performance and area trade-off for the application.
MDU with 32x16 High-Performance Multiplier
The high-performance MDU consists of a 32x16 Booth-recoded multiplier, a pair of result/accumulation registers (
HI
and LO), a divide state machine, and the necessary multiplexers and control logic. The first number shown (‘32’ of
32x16) represents the rs operand. The second number (‘16’ of 32x16) represents the rt operand. The M14K core only
checks the value of the rt operand to determine how many times the operation must pass through the multiplier. The
16x16 and 32x16 operations pass through the multiplier once. A 32x32 operation passes through the multiplier twice.
The MDU supports execution of one 16x16 or 32x16 multiply or multiply-accumulate operation every clock cycle;
32x32 multiply operations can be issued every other clock cycle. Appropriate interlocks are implemented to stall the
issuance of back-to-back 32x32 multiply operations. The multiply operand size is automatically determined by logic
built into the MDU.
MDU with Area-Efficient Option
With the area-efficient option, multiply and divide operations are implemented with a simple 1-bit-per-clock iterative
algorithm. Any attempt to issue a subsequent MDU instruction while a multiply/divide is still active causes an MDU
pipeline stall until the operation is completed.
Regardless of the multiplier array implementation, divide operations are implemented with a simple 1-bit-per-clock
iterative algorithm. An early-in detection checks the sign extension of the dividend (rs) operand. If rs is 8 bits wide,
23 iterations are skipped. For a 16-bit-wide rs, 15 iterations are skipped, and for a 24-bit-wide rs, 7 iterations are
skipped. Any attempt to issue a subsequent MDU instruction while a divide is still active causes an IU pipeline stall
until the divide operation has completed.
1.2.1.4 System Control Coprocessor (CP0)
In the MIPS architecture, CP0 is responsible for the virtual-to-physical address translation, the exception control system, the processor’s diagnostics capability, the operating modes (kernel, user, and debug), and whether interrupts are
enabled or disabled. Configuration information, such as presence of build-time options like microMIPS, CorExtend
Module or Coprocessor 2 interface, is also available by accessing the CP0 registers.
10MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.04
1.2 M14K™ Core Block Diagram
Coprocessor 0 also contains the logic for identifying and managing exceptions. Exceptions can be caused by a variety
of sources, including boundary cases in data, external events, or program errors.
Interrupt Handling
The M14K core includes support for eight hardware interrupt pins, two software interrupts, and a timer interrupt.
These interrupts can be used in any of three interrupt modes, as defined by Release 2 of the MIPS32 Architecture:
•Interrupt compatibility mode, which acts identically to that in an implementation of Release 1 of the Architecture.
•Vectored Interrupt (VI) mode, which adds the ability to prioritize and vector interrupts to a handler dedicated to
that interrupt, and to assign a GPR shadow set for use during interrupt processing. The presence of this mode is
denoted by the
VInt bit in the Config3 register. This mode is architecturally optional; but it is always present on
the M14K core, so the VInt bit will always read as a 1 for the M14K core.
•External Interrupt Controller (EIC) mode, which redefines the way in which interrupts are handled to provide full
support for an external interrupt controller handling prioritization and vectoring of interrupts. The presence of
this mode denoted by the
VEIC bit in the Config3 register. Again, this mode is architecturally optional. On the
M14K core, the VEIC bit is set externally by the static input, SI_EICPresent, to allow system logic to indicate the
presence of an external interrupt controller.
The reset state of the processor is interrupt compatibility mode, such that a processor supporting Release 2 of the
Architecture, the M14K core for example, is fully compatible with implementations of Release 1 of the Architecture.
VI or EIC interrupt modes can be combined with the optional shadow registers to specify which shadow set should be
used on entry to a particular vector. The shadow registers further improve interrupt latency by avoiding the need to
save context when invoking an interrupt handler.
In the M14K core, interrupt latency is reduced by:
•Speculative interrupt vector prefetching during the pipeline flush.
•Interrupt Automated Prologue (IAP) in hardware: Shadow Register Sets remove the need to save GPRs, and IAP
removes the need to save specific Control Registers when handling an interrupt.
•Interrupt Automated Epilogue (IAE) in hardware: Shadow Register Sets remove the need to restore GPRs, and
IAE removes the need to restore specific Control Registers when returning from an interrupt.
•Allow interrupt chaining. When servicing an interrupt and interrupt chaining is enabled, there is no need to return
from the current Interrupt Service Routine (ISR) if there is another valid interrupt pending to be serviced. The
control of the processor can jump directly from the current ISR to the next ISR without IAE and IAP.
GPR Shadow Registers
The MIPS32 Architecture optionally removes the need to save and restore GPRs on entry to high-priority interrupts
or exceptions, and to provide specified processor modes with the same capability. This is done by introducing multiple copies of the GPRs, called shadow sets, and allowing privileged software to associate a shadow set with entry to
kernel mode via an interrupt vector or exception. The normal GPRs are logically considered shadow set zero.
The number of GPR shadow sets is a build-time option. The M14K core allows 1 (the normal GPRs), 2, 4, 8, or 16
shadow sets. The highest number actually implemented is indicated by the SRSCtlHSS field. If this field is zero, only
the normal GPRs are implemented.
MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.0411
Introduction to the MIPS32® M14K™ Processor Core
Shadow sets are new copies of the GPRs that can be substituted for the normal GPRs on entry to kernel mode via an
interrupt or exception. When a shadow set is bound to a kernel-mode entry condition, references to GPRs operate
exactly as one would expect, but they are redirected to registers that are dedicated to that condition. Privileged software may need to reference all GPRs in the register file, even specific shadow registers that are not visible in the current mode, and the RDPGPR and WRPGPR instructions are used for this purpose. The CSS field of the SRSCtl
register provides the number of the current shadow register set, and the PSS field of the SRSCtl register provides the
number of the previous shadow register set that was current before the last exception or interrupt occurred.
If the processor is operating in VI interrupt mode, binding of a vectored interrupt to a shadow set is done by writing to
the SRSMap register. If the processor is operating in EIC interrupt mode, the binding of the interrupt to a specific
shadow set is provided by the external interrupt controller and is configured in an implementation-dependent way.
Binding of an exception or non-vectored interrupt to a shadow set is done by writing to the ESS field of the SRSCtl
register. When an exception or interrupt occurs, the value of SRSCtl
to the value taken from the appropriate source. On an ERET, the value of SRSCtl
to restore the shadow set of the mode to which control returns.
Refer to Chapter 5, “CP0 Registers of the M14K™ Core” on page 88 for more information on the CP0 registers.
Refer to Chapter 8, “EJTAG Debug Support in the M14K™ Core” on page 155 for more information on EJTAG
debug registers.
1.2.1.5 Memory Management Unit (MMU)
is copied to SRSCtl
CSS
, and SRSCtl
PSS
is copied back into SRSCtl
PSS
CSS
is set
CSS
Modes of Operation
The M14K core implements three modes of operation:
•User mode is most often used for applications programs.
•Kernel mode is typically used for handling exceptions and operating-system kernel functions, including CP0
management and I/O device accesses.
•Debug mode is used during system bring-up and software development. Refer to the EJTAG section for more
information on debug mode.
Figure 1.2 shows the virtual address map of the MIPS Architecture.
12MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.04
Figure 1.2 M14K™ Core Virtual Address Map
0xFFFFFFFF
Fix Mapped
0xFF400000
0xFF3FFFFF
0xFF200000
0xF1FFFFFF
0xE0000000
0xDFFFFFFF
0xC0000000
0xBFFFFFFF
0xA0000000
0x9FFFFFFF
0x80000000
0x7FFFFFFF
Memory/EJTAG
Fix Mapped
Kernel Virtual Address Space
Fix Mapped, 512 MB
Kernel Virtual Address Space
Unmapped, 512 MB
Uncached
Kernel Virtual Address Space
Unmapped, 512 MB
1
kseg3
kseg2
kseg1
kseg0
1.2 M14K™ Core Block Diagram
User Virtual Address Space
kuseg
Mapped, 2048 MB
0x00000000
1. This space is mapped to memory in user or kernel mode,
and by the EJTAG module in debug mode.
Memory Management Unit (MMU)
The M14K core contains a simple Fixed Mapping Translation (FMT) MMU that interfaces between the execution
unit and the SRAM controller.
•Fixed Mapping Translation (FMT)
A FMT is smaller and simpler than the full Translation Lookaside Buffer (TLB) style MMU found in other MIPS
cores. Like a TLB, the FMT performs virtual-to-physical address translation and provides attributes for the different segments. Those segments that are unmapped in a TLB implementation (kseg0 and kseg1) are translated
identically by the FMT.
Figure 1.3 shows how the FMT is implemented in the M14K core.
MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.0413
Introduction to the MIPS32® M14K™ Processor Core
Figure 1.3 Address Translation During SRAM Access with FMT Implementation
FMT
Physical
Address
Physical
Address
SRAM
interface
Inst
SRAM
Data
SRAM
Instruction
Address
Calculator
Data
Address
Calculator
Virtual
Address
Virtual
Address
1.2.1.6 SRAM Interface Controller
Instead of caches, the M14K core contains an interface to SRAM-style memories that can be tightly coupled to the
core. This permits deterministic response time with less area than is typically required for caches. The SRAM interface includes separate uni-directional 32-bit buses for address, read data, and write data.
Dual or Unified Interfaces
The SRAM interface includes a build-time option to select either dual or unified instruction and data interfaces.
The dual interface enables independent connection to instruction and data devices. It generally yields the highest performance, because the pipeline can generate simultaneous I and D requests, which are then serviced in parallel.
For simpler or cost-sensitive systems, it is also possible to combine the I and D interfaces into a common interface
that services both types of requests. If I and D requests occur simultaneously, priority is given to the D side.
Back-stalling
Typically, read and write transactions will complete in a single cycle. However, if multi-cycle latency is desired, the
interface can be stalled to allow connection to slower devices.
Redirection
When the dual I/D interface is present, a mechanism exists to divert D-side references to the I-side, if desired. The
mechanism can be explicitly invoked for any other D-side references, as well. When the DS_Redir signal is asserted,
a D-side request is diverted to the I-side interface in the following cycle, and the D-side will be stalled until the transaction is completed.
Transaction Abort
The core may request a transaction (fetch/load/store/sync) to be aborted. This is particularly useful in case of interrupts. Because the core does not know whether transactions are re-startable, it cannot arbitrarily interrupt a request
that has been initiated on the SRAM interface. However, cycles spent waiting for a multi-cycle transaction to complete can directly impact interrupt latency. In order to minimize this effect, the interface supports an abort mechanism. The core requests an abort whenever an interrupt is detected and a transaction is pending (abort of an
instruction fetch may also be requested in other cases). The external system logic can choose to acknowledge or to
ignore the abort request.
Connecting to Narrower Devices
The instruction and data read buses are always 32 bits in width. To facilitate connection to narrower memories, the
SRAM interface protocol includes input byte-enables that can be used by system logic to signal validity as partial
read data becomes available. The input byte-enables conditionally register the incoming read data bytes within the
14MIPS32® M14K™ Processor Core Family Software User’s Manual, Revision 02.04
Loading...
+ 272 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.