mc notes
mc notes
o Second, ARM10 uses branch prediction, which reduces the effect of a pipeline
flush by predicting possible branches and loading the new branch address prior to
the execution ofthe instruction.
o Third, an instruction in the execute stage will complete even though an interrupt
has been raised. Other instructions in the pipeline will be abandoned, and the
processor will start filling the pipeline.
30
MICROCONTROLLERS AND EMBEDDED SYSTEMS
Each vector table entry contains a form of branch instruction pointing to the start of a
specific routine:
o Reset vector is the location of the first instruction executed by the processor when
power is applied. This instruction branches to the initialization code.
o Undefined instruction vector is used when the processor cannot decode an
instruction.
o Software interrupt vector is called when you execute a SWI instruction. The SWI
instruction is frequently used as the mechanism to invoke an operating system
routine.
o Prefetch abort vector occurs when the processor attempts to fetch an instruction
from an address without the correct access permissions. The actual abort occurs in
the decode stage.
o Data abort vector is similar to a prefetch abort, but is raised when an instruction
attemptsto access data memory without the correct access permissions.
o Interrupt request vector is used by external hardware to interrupt the normal
execution flow of the processor. It can only be raised if IRQs are not masked in
the cpsr.
o Fast interrupt request vector is similar to the interrupt request, but is reserved for
hardware requiring faster response times. It can only be raised if FIQs are not
masked in the cpsr.
CORE EXTENSIONS:
Core extensions are the standard hardware components placed next to the ARM core.
They improve performance, manage resources, and provide extra functionality and are
designedto provide flexibility in handling particular applications.
Each ARM family has different extensions available. There are three hardware extensions:
cache andtightly coupled memory, memory management, and the coprocessor interface.
31
ARM has two forms of cache. The first is found attached to the Von Neumann–style
cores. It combines both data and instruction into a single unified cache, as shown in the
following Figure.
The second form, attached to the Harvard-style cores, has separate caches for data and
instruction, as shown in the following Figure.
This is achieved using a form of memory called tightly coupled memory (TCM). TCM is
32
fast SRAM located close to the core and guarantees the clock cycles required to fetch
instructions or data.
TCMs appear as memory in the address map and can be accessed as fast memory.
By combining both technologies, ARM processors can have both improved performance and
predictable real-time response. The following Figure shows an example core with a combination
of caches and TCMs.
33
MICROCONTROLLERS AND EMBEDDED SYSTEMS
Non protected memory is fixed and provides very little flexibility. It is normally used for
small, simple embedded systems that require no protection from rogue applications.
MPUs employ a simple system that uses a limited number of memory regions. These
regions are controlled with a set of special coprocessor registers, and each region is
defined with specific access permissions. This type of memory management is used for
systems that require memory protection but don’t have a complex memory map.
MMUs are the most comprehensive memory management hardware available on the
ARM. The MMU uses a set of translation tables to provide fine-grained control over
memory. These tables are stored in main memory and provide a virtual-to-physical
address map as well as access permissions. MMUs are designed for more sophisticated
platform operating systems that support multitasking.
Coprocessors:
Coprocessors can be attached to the ARM processor. A coprocessor extends the
processing features of a core by extending the instruction set or by providing
configuration registers. More than one coprocessor can be added to the ARM core via the
coprocessor interface.
The coprocessor can be accessed through a group of dedicated ARM instructions that
provide a load-store type interface.
o For example, coprocessor 15: The ARM processor uses coprocessor 15 registers
to control the cache, TCMs, and memory management.
The coprocessor can also extend the instruction set by providing a specialized group of
new instructions.
o For example, there are a set of specialized instructions that can be added to the
standard ARM instruction set to process vector floating-point (VFP) operations.
These new instructions are processed in the decode stage of the ARM pipeline.
o If the decode stage sees a coprocessor instruction, then it offers it to the relevant
coprocessor.
o If the coprocessor is not present or doesn’t recognize the instruction, then the
ARM takes an undefined instruction exception, which allows you to emulate the
behavior of the coprocessor in software.
34