This document is intended only to assist the reader in the use of the product. ARM shall not be liable for any loss or damage arising from the use of any information in this document, or any error or omission in such information, or any incorrect use of the product.
Feedback ARM welcomes feedback on this product and its documentation. Feedback on this product If you have any comments or suggestions about this product, contact your supplier and give: • The product name. • The product revision or version. •...
Cortex-R4F processor implements the VFPv3-D16 architecture. This includes the VFPv3 instruction set. The ARMv7-R architecture provides 32-bit ARM and 16-bit and 32-bit Thumb instruction sets, including a range of Single Instruction, Multiple-Data (SIMD) Digital Signal Processing (DSP) instructions that operate on 16-bit or 8-bit data values in 32-bit registers.
It decodes and executes instructions, operating on data held in the registers in accordance with the ARM Architecture. Instructions are fed to the DPU from the PFU through a buffer. The DPU performs instructions that require data to be transferred to or from the memory system by interfacing to the LSU.
VIC port The core has a dedicated port that enables an external interrupt controller, such as the ARM PrimeCell Vectored Interrupt Controller (VIC), to supply a vector address along with an Interrupt Request (IRQ) signal.
AMBA 3 APB Protocol Specification and the CoreSight Architecture Specification. 1.4.1 APB Debug interface AMBA APBv3 is used for debugging purposes. CoreSight is the ARM architecture for multi-processor trace and debug. CoreSight defines what debug and trace components are required and how they are connected.
DCCMOUT2[7:0] enable the comparison logic inside the processor to communicate with the rest of the system. ARM provides example comparison logic, but you can change this during implementation. If you are implementing a processor with dual-redundant cores, contact ARM for more information.
• the processes to sign off the configured RTL and final macrocell. The ARM product deliverables include reference scripts and information about using them to implement your design. Reference methodology documentation from your EDA tools vendor complements the CSG. The CSG is a confidential book that is only available to licensees.
1.11.2 Architectural information The ARM Architecture includes a number of registers that identify the version of the architecture and some of the architectural features that a processor implements. Chapter 4 System Control Coprocessor describes the values that the processor implements for the fields in these registers.
Reference Manual. This chapter describes some of the main features of the architecture but, for a complete description, see the ARM Architecture Reference Manual. This chapter also makes reference to older versions of the ARM architecture that the processor does not implement. These references are included to contrast the behavior of the Cortex-R4 processor with other processors you might have used that implement an older version of the architecture.
2.2.1 Switching state The instruction set state of the processor can be switched between ARM state and Thumb state: • Using the that does not set flags, with the PC as the destination register. Switching state is described in the ARM Architecture Reference Manual.
Operating modes In each state there are seven modes of operation: • User (USR) mode is the usual mode for the execution of ARM or Thumb programs. It is used for executing most application programs. • Fast interrupt (FIQ) mode is entered on taking a fast interrupt.
2.6.1 The register set In the processor the same register set is used in both the ARM and Thumb states. Sixteen general registers and one or two status registers are accessible at any time. In Privileged modes, alternative mode-specific banked registers become available. Figure 2-3 on page 2-9 shows the registers that are available in each mode.
In ARM state, most instructions can execute conditionally on the state of the N, Z, C, and V bits. The exceptions are: •...
Page 57
In Thumb state, the processor can only execute the Branch instruction conditionally. Other instructions can be made conditional by placing them in the If-Then (IT) block. For more information about conditional execution in Thumb state, see the ARM Architecture Reference Manual.
For more information on the operation of the IT execution state bits, see the ARM Architecture Reference Manual. 2.7.4 The J bit The J bit in the CPSR returns 0 when read. You cannot use an 2.7.5 The DNM bits Software must not modify the Do Not Modify (DNM) bits.
Page 59
2.7.7 The E bit ARM and Thumb instructions are provided to set and clear the E bit. The E bit controls load/store endianness. See the ARM Architecture Reference Manual for information on where the E bit is used.
Page 63
For more information about the IT instruction and Undefined instruction, and an example of the exception handler code, see the ARM Architecture Reference Manual.
Forces the PC to fetch the next instruction from the reset vector address. Reverts to ARM state or Thumb state depending on the state of the TEINIT pin, and resumes execution. After reset, all register values except the PC and CPSR are indeterminate.
Page 65
LOW until the processor acknowledges the interrupt request from the software handler. Irrespective of whether exception entry is from ARM state or Thumb state, an FIQ handler returns from the interrupt by executing: SUBS PC, R14_fiq, #4 If Non-Maskable Fast Interrupts (NMFIs) are not enabled, you can mask FIQ exceptions by setting the CPSR.F bit to b1.
ARM for use in Cortex-R4 designs. You can use the VIC port to connect a PL192 VIC to the processor. See the ARM PrimeCell Vectored Interrupt Controller (PL192) Technical Reference Manual for more information about the PL192 VIC.
Page 70
SPSR are correct for the instruction following the SVC. This means that the SVC handler does not have to perform any special action to accommodate the IT instruction. For more information on the IT instruction, see the ARM Architecture Reference Manual.
When an instruction is encountered which is UNDEFINED, or is for the VFP when the VFP is not enabled, the processor takes the Undefined instruction exception. Software can use this mechanism to extend the ARM instruction set by emulating UNDEFINED coprocessor instructions. UNDEFINED exceptions also occur when a the value in Rm is zero, and the DZ bit in the System Control Register is set.
The Current Program Status Register (CPSR) is given a known value on reset. This is described in the ARM Architecture Reference Manual. The reset values for the CP15 registers are described along with the registers in Chapter 4 System Control Coprocessor.
Page 78
The processor does not initialize the TCM RAMs. It is not essential to initialize all the memory attached to the TCM interface but ARM recommends that you do. In addition, you might want to preload instructions or data into the TCM for the main application to use. This section describes various ways that you can perform data preloading.
Figure 3-1 shows the application of power-on reset. ARM recommends that you assert the reset signals for at least four CLKIN cycles to ensure correct reset behavior.
It can generate interrupts when the number of events reaches a given value. For more information on the programmer’s model of the performance counters see the ARM Architecture Reference Manual.
CRn, Opcode_1, CRm, Opcode_2. For more information on using the system control coprocessor and the general method of how to access CP15 registers, see the ARM Architecture Reference Manual. 4.2.1 Register allocation...
The ATCM and BTCM fields in the TCM Type Register occupy the same space as the ITCM and DTCM fields as defined by the ARM Architecture. These fields, and the corresponding TCM interfaces, can be considered equivalent to those defined in the Architecture.
, and T bit in PSRs • , and PC loads have BX behavior. • Data-processing instructions in the ARM instruction set with the PC as the destination and the S bit clear have BX-like behavior. Indicates support for immediate instructions. , the processor supports: •...
1 = MPU enabled. If no MPU is implemented, the MPU has zero regions, this bit is SBZ. To use the System Control Register ARM recommends that you use a read-modify-write technique. To access the System Control Register, read or write CP15 with: MRC p15, 0, <Rd>, c1, c0, 0 ;...
MCR p15, 0, <Rd>, c1, c0, 1 ; Write Auxiliary Control Register ARM recommends that any instruction that changes bits [31:28] or [7] is followed by an instruction to ensure that the changes have taken effect before any dependent instructions are executed.
MCR p15, 0, <Rd>, c15, c0, 0 ; Write Secondary Auxiliary Control Register ARM recommends that any instruction that changes bits [20:16] is followed by an instruction to ensure that the changes have taken effect before any dependent instructions are executed.
This processor does not contain an address-based branch predictor array. Invalidate and clean operations The terms that describe the invalidate, clean, and prefetch operations are defined in the ARM Architecture Reference Manual. You can perform invalidate and clean operations on: •...
To access the Data Synchronization Barrier operation, write CP15 with: MCR p15, 0, <Rd>, c7, c10, 4 ; Data Synchronization Barrier operation For more information about memory barriers, see the ARM Architecture Reference Manual. Data Memory Barrier operation The purpose of the Data Memory Barrier operation is to ensure that all outstanding explicit memory transactions complete before any following explicit memory transactions begin.
The PFU fetches instructions from the memory system under the control of the DPU, and the internal coprocessors CP14 and CP15. In ARM state the memory system can supply up to two instructions per cycle. In Thumb state the memory system can supply up to four instructions per cycle.
When the return stack detects a taken return instruction, the PFU issues an instruction fetch from the location at the top of the return stack, and pops the return stack. The instructions that the PFU recognizes as procedure returns are, in both the ARM and Thumb instruction sets: •...
If this unit generates an interrupt, the processor asserts the pin nPMUIRQ. You can route this pin to an external interrupt controller for prioritization and masking. This is the only mechanism that signals this interrupt to the processor. ARM expects that the Performance Monitor interrupt request signal, nPMUIRQ, connects to a system interrupt controller. 6.3.12...
About the MPU The MPU works with the L1 memory system to control accesses to and from L1 and external memory. For a full architectural description of the MPU, see the ARM Architecture Reference Manual. The MPU enables you to partition memory into regions and set individual protection attributes for each region.
To ensure correct operation, only a memory region that has permission for data read access can execute instructions. For more information, see the ARM Architecture Reference Manual. For information about how to program access permissions, see Table 4-34 on page 4-52.
Memory types The ARM Architecture defines a set of memory types with characteristics that are suited to particular devices. There are three mutually exclusive memory type attributes: • Strongly Ordered • Device • Normal. MPU memory regions can each be assigned a memory type attribute. Table 7-2 shows a summary of the memory types.
• the Outer attributes are indicated on the and A*CACHEM signals. For the encodings, see Table 9-2 on page 9-5. For more information on region attributes, see the ARM Architecture Reference Manual. ARM DDI 0363E ID013010 Table 7-3 TEX[2:0], C, and B encodings (continued) Description Reserved.
The L1 memory system includes a monitor for exclusive accesses. Exclusive load and store instructions can be used, for example, provide inter-process or inter-processor synchronization and semaphores. See the ARM Architecture Reference Manual for more details. The monitor can handle some exclusive monitoring internally to the processor.
The processor contains features that enable it to recover from some hard errors. If you are implementing the processor and require these features, contact ARM to discuss the features and your requirements.
Page 205
Note When a prefetch abort has occurred, ARM recommends that you do not use the link register value for determining the aborting address, because 32-bit Thumb instructions do not have to be word aligned and can cause an abort on either halfword.
See Cache error detection and correction on page 8-20 for more information. For more information on the general rules about memory attributes and behavior, see the ARM Architecture Reference Manual.
The processor includes features that enable it to detect some address decoder faults. If you are implementing the processor and require these features, contact ARM to discuss the features and your requirements.
By adding an external exclusive monitor, you can also use these instructions in the L2 memory system to construct semaphores and ensure synchronization between different processors. See the ARM Architecture Reference Manual for more information about how these instructions work.
RAMs, is powered down. In dormant mode, the processor state, apart from the cache and TCM state, is stored to memory before entry into this mode, and restored after exit. For more information on how to implement and use dormant mode in your design, contact ARM. 10.2.4...
The state of the processor is preserved in the same manner as all ARM exceptions. The monitor target communicates with the debugger to access processor and coprocessor state, and to access memory contents and peripherals. Monitor debug-mode requires a debug monitor program to interface between the debug hardware and the software debugger.
You can access the processor debug register map using the APB slave port. This is the only way to get full access to the processor debug capability. ARM recommends that if your system requires the processor to access its own debug registers, you choose a system interconnect structure that enables the processor to access the APB slave port by executing load and stores to an appropriate area of physical memory.
You can place additional restrictions on memory transactions that are permitted to access the APB port. However, ARM does not recommend this. Locks permission You can lock the APB slave port so that access to some debug registers is restricted. ARM Architecture v7 defines two locks: Software lock...
Function [31:1] Address This is the address of the watchpointed instruction. When a watchpoint occurs in ARM state, the WFAR contains the address of the instruction causing it plus an offset of occurs in Thumb state, the offset is plus Reserved RAZ.
The ITR is a write-only register. Reads from the ITR return an Unpredictable value. The Instruction Transfer Register, bits [31:0] contain the ARM instruction for the processor to execute while in debug state. The reset value of this register is Unpredictable.
Should Be Zero. Otherwise the behavior is Unpredictable. • To watch for a write to any byte in an 8-byte aligned object of size 8 bytes, ARM recommends that a debugger sets WCR[28:24] to b00111, and WCR[12:5] to b11111111.
4KB block, therefore this field is always Identifies the designer of the processor. This field consists of a 4-bit continuation code and a 7-bit identity code. Because the processor is designed by ARM, the continuation code is and the identity code is .
• The PC is frozen on entry to debug state. That is, it does not increment on the execution of ARM instructions. However, the processor still updates the PC as a response to instructions that explicitly modify the PC. •...
Page 315
The following restrictions apply to instructions executed through the ITR while in debug state: • with the exception of branch instructions and instructions that modify the CPSR, the processor executes any ARM instruction in the same manner as if it was not in debug state • the branch instructions •...
This section provides some examples of using the processor debug functionality, both from the point of view of a software engineer writing code to run on an ARM processor and of a developer creating debug tools for the processor. In the former case, examples are given in ARM assembly language.
Page 324
• The mechanism for forcing the processor to execute ARM instructions, when the processor is in debug state. For more information, see Executing instructions in debug state on page 11-46.
Page 326
Programming simple breakpoints and the byte address select When programming a simple breakpoint, you must set the byte address select bits in the control register appropriately. For a breakpoint in ARM state, this is simple. For Thumb state, you must calculate the value based on the address.
Page 331
// set the T bit to Thumb state state->pc := state->pc - 4; elseif (state->cpsr & (1<<24)) // Set the J bit to Jazelle state. Note: ARM Cortex-R4 does not support // Jazelle state but ARMv7 debug does. state->pc := state->pc - IMPLEMENTATION DEFINED value;...
Page 332
To read a single register, the debugger can use the sequence that Example 11-13 shows. This sequence depends on two other sequences, Executing an ARM instruction through the ITR on page 11-54 and Target to host data transfer (host end) on page 11-56.
Page 338
Accessing coprocessor registers The sequence for accessing coprocessor registers is the same for the PC and CPSR. That is, you must first execute an instruction to transfer the register to an ARM register, then read the value back through the DTR.
Manual for information on the VFPv3 instruction set. 12.1.1 FPU functionality The FPU is an implementation of the ARM Vector Floating Point v3 architecture, with 16 double-precision registers (VFPv3-D16). It provides floating-point computation functionality that is compliant with the ANSI/IEEE Std 754-1985, IEEE Standard for Binary Floating-Point Arithmetic, referred to as the IEEE 754 standard.
12.2 General-purpose registers The FPU implements a VFP register bank. This bank is distinct from the ARM register bank. You can reference the VFP register bank using two explicitly aliased views. Figure 12-1 shows the two views of the register bank and the way the word and doubleword registers overlap.
Part number [7:4] Variant [3:0] Revision a. For details of the Common VFP subarchitecture see the ARM Architecture Reference Manual. ARM DDI 0363E ID013010 Note This is a change in VFPv3 compared to VFPv2. User code must issue a system call to determine the features that are supported.
Signaling NaN (SNaN). A one indicates a Quiet NaN (QNaN). Two NaN values are treated as different NaNs if they differ in any bit. Table 12-8 shows the default NaN values in both single-precision and double-precision. Processing of input NaNs for ARM floating-point functionality and libraries is defined as follows: •...
IEEE 754 standard to generate Underflow exceptions. In flush-to-zero mode, results that are tiny before rounding, as described in the IEEE 754 standard, are flushed to a zero, and the UFC flag, FPSCR[3], is set. See the ARM Architecture Reference Manual for information on flush-to-zero mode.
This section describes the behavior and use of the Integration Test Registers that are in the processor. It also describes the Integration Mode Control Register that controls the use of the Integration Test Registers. For more information about the ITCTRL see the ARM Architecture Reference Manual.
• ARM strongly recommends that the processor is halted while in debug state, because toggling input and output pins might have an unwanted effect on the operation of the processor. You must not set the ITCTRL Register until the processor has halted.
Writing to the ITCTRL register controls whether the processor is in its default functional mode, or in integration mode, where the inputs and outputs of the device can be directly controlled for the purpose of integration testing or topology detection. For more information see the ARM Architecture Reference Manual.
Page 369
There is a data dependency between two instructions in the pipeline, resulting in the Iss stage being stalled until the processor resolves the dependency. 14.1.5 Assembler language syntax The syntax used throughout this chapter is unified assembler and the timings apply to ARM and Thumb instructions. ARM DDI 0363E ID013010...
The first instruction must not use the PC as a destination register. • Both instructions must belong to the same instruction set, ARM or Thumb. • There must be no data dependency between the two instructions. That is, the second instruction must not have any source registers that are destination registers of the first instruction.
Abort, and an internal or External Abort. See also Data Abort, External Abort and Prefetch Abort. An abort model is the defined behavior of an ARM processor in response to a Data Abort exception. Abort model Different abort models behave differently with regard to load and store instructions that specify base register write-back.
Page 443
Harvard architecture, instruction set architecture, ARMv6 architecture. A word that specifies an operation for an ARM processor to perform. ARM instructions must ARM instruction be word-aligned.
Page 447
The ARM architecture supports byte-invariant systems in ARMv6 and later versions. When byte-invariant support is selected, unaligned halfword and word memory accesses are also supported.
Page 448
See Write-back. Copy back In the context of an ARM Integrator, a core module is an add-on development board that Core module contains an ARM processor and local memory. Core modules can run standalone, or can be stacked onto Integrator motherboards.
Page 449
A hardware macrocell that, when connected to a processor core, outputs instruction and data trace information on a trace port. The ETM provides processor driven trace through a trace port compliant to the ATB protocol. The JTAG-based hardware provided by debuggable ARM processors to aid debugging in EmbeddedICE-RT real-time.
Page 452
These are combined as a single macrocell, that can be fabricated on an integrated circuit. Reads are defined as memory operations that have the semantics of a load. That is, the ARM Read instructions...
Page 454
Unaligned size is said to be unaligned. For example, a word stored at an address that is not divisible by four. Indicates an instruction that generates an Undefined instruction trap. See the ARM Architecture Undefined Reference Manual for more information on ARM exceptions.
Page 455
See also Byte-invariant. Writes are defined as operations that have the semantics of a store. That is, the ARM instructions Write STRH...
Need help?
Do you have a question about the Cortex r1p3 and is the answer not in the manual?
Questions and answers