0% found this document useful (0 votes)
13 views

Embedded System Notes

Uploaded by

Duggirala Manoj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Embedded System Notes

Uploaded by

Duggirala Manoj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

ARM (Advanced RISC Machine) is a family of Reduced Instruction Set Computing (RISC) architectures

for computer processors, originally developed by ARM Holdings (now part of NVIDIA). ARM
architecture is widely used in a variety of computing devices, ranging from smartphones and tablets
to embedded systems and servers. Here are some key features and aspects of ARM architecture:

1. RISC Architecture: ARM follows the RISC design philosophy, which emphasizes a simple and
efficient instruction set. RISC architectures typically have a smaller number of instructions,
each taking a single clock cycle to execute.

2. Processor Modes: ARM processors support different operating modes, including User mode,
Supervisor mode (for the operating system kernel), and System mode. This flexibility allows
the processor to execute instructions with different privileges.

3. Instruction Sets: ARM instruction sets are typically divided into different versions, such as
ARMv6, ARMv7, and ARMv8. The instruction set evolves with each version, introducing new
features, enhancements, and support for additional technologies.

4. Thumb and Thumb-2 Instruction Sets: ARM processors support a compressed instruction set
called Thumb. Thumb instructions are 16 bits long, as opposed to the regular 32-bit ARM
instructions. Thumb instructions are used to reduce code size, which is crucial in memory-
constrained environments. Thumb-2 extends this idea by providing a mix of 16-bit and 32-bit
instructions for better performance.

5. ARMv8-A Architecture: ARMv8-A is the latest version of the ARM architecture designed for
64-bit processing. It introduces the A64 instruction set, enabling support for 64-bit memory
addressing and processing. ARMv8-A is used in a variety of devices, including smartphones,
tablets, servers, and other computing systems.

6. ARM Cortex Processors: ARM Cortex processors are a family of processor cores designed
using the ARM architecture. They come in various configurations and are used in a wide
range of applications. Cortex-M cores are often used in microcontrollers, Cortex-R cores are
used in real-time systems, and Cortex-A cores are used in more performance-oriented
applications, including smartphones and servers.

7. Energy Efficiency: ARM architecture is known for its energy efficiency, making it particularly
suitable for battery-powered devices like smartphones and tablets. The emphasis on
efficiency also makes ARM processors popular for use in embedded systems and Internet of
Things (IoT) devices.

8. Wide Industry Adoption: ARM architecture is used by many semiconductor companies,


which license ARM's intellectual property to design and manufacture their own ARM-based
processors. This licensing model has contributed to the widespread adoption of ARM
architecture in various devices across the computing landscape.

Fetch Unit:

Instruction Fetch: Fetches instructions from memory using the



Program Counter (PC).
2. Decode Unit:
 Instruction Decode: Decodes the fetched instructions to
determine the operation to be performed and the operands
involved.
3. Register File:
 Holds the processor's general-purpose registers, which are
used for data manipulation.
4. Execution Units:
 ALU (Arithmetic Logic Unit): Performs arithmetic and logic
operations.
 Multiplier/Divider: Handles multiplication and division
operations.
 SIMD (Single Instruction, Multiple Data): Supports parallel
processing of multiple data elements.
5. Memory Unit:
 Data Cache: Caches frequently used data from memory for
faster access.
 Data Memory: Interfaces with the main memory for load and
store operations.
6. Write Back:
 Write Back to Register File: The result of an executed
instruction is written back to the register file.
7. Control Unit:
 Control Signals: Generates control signals to coordinate the
operation of various units in the processor.
8. Pipeline:
 Stages: Represents the pipeline stages through which
instructions progress (e.g., Fetch, Decode, Execute, Memory
Access, Write Back).
9. Bus Interface:
 Instruction Bus: Connects the processor to the instruction
memory.
 Data Bus: Connects the processor to the data memory and
peripherals.
10.Peripherals:
 Interrupt Controller: Manages interrupts from external
devices.
 Timer/Counter: Handles timing and counting operations.
I/O Interfaces: Connects the processor to input/output
devices.
11.Advanced Features:
 Out-of-Order Execution: Allows the processor to execute
instructions not dependent on the results of previous
instructions.
 Speculative Execution: Predictively executes instructions to
improve performance.

. The pipeline in a computer processor is a crucial component that enables


the efficient execution of instructions. The pipeline is a series of stages
through which instructions pass, with each stage handling a specific aspect
of instruction execution. The goal is to overlap the execution of multiple
instructions to improve overall throughput and performance. Below is a
simplified description of the pipeline stages in an ARM processor:

Instruction Fetch (IF): In this stage, the processor fetches the next
instruction from memory. The program counter (PC) is used to determine
the address of the instruction to be fetched.

Instruction Decode (ID): The fetched instruction is decoded to determine


the operation to be performed and the operands involved. This stage may
also involve the allocation of resources and reservation stations for
subsequent execution.

Execute (EX): The actual computation or operation specified by the


instruction takes place in this stage. For example, arithmetic and logic
operations are performed, or memory is accessed.

Memory Access (MEM): If the instruction involves a memory operation (e.g.,


load or store), it is carried out in this stage. Data is read from or written to
memory.
Write Back (WB): The result of the executed instruction is written back to
the register file or other relevant storage locations. This stage completes
the instruction execution cycle.

ARM processors often use a three-stage pipeline (Fetch, Decode, Execute)


for simpler implementations or a more complex pipeline with additional
stages for better performance. The specific pipeline stages and their
implementation can vary between different ARM processor models and
versions.

It's worth noting that pipeline design involves trade-offs between


complexity, performance, and power consumption. While a deeper pipeline
can lead to higher clock frequencies and better performance, it may also
introduce pipeline hazards, such as data hazards and control hazards, which
need to be carefully managed to avoid performance penalties.

Additionally, modern ARM processors may implement advanced features


like out-of-order execution and speculative execution to further enhance
performance by allowing the processor to execute instructions that are not
dependent on the results of previous instructions. These features contribute
to the overall efficiency and speed of ARM-based systems.
ARM processors typically have a set of registers that play various roles in the
execution of instructions and management of the processor state. Here's an
overview of some common types of registers found in ARM architecture:
1. Program Counter (PC):
 Holds the address of the current instruction being executed.
2. Link Register (LR):
 Used to store the return address when a subroutine (function) is
called. After the subroutine finishes execution, the PC is loaded
with the value from the LR to return to the original execution point.
3. Status Register (CPSR/SPSR):
 CPSR (Current Program Status Register) holds the current
execution status, including condition flags (zero, negative, carry,
overflow) and processor mode.
 SPSR (Saved Program Status Register) holds the status register of
the previous mode when an exception occurs (e.g., during an
interrupt).
4. General-Purpose Registers (R0-R15):
 R0 to R12 are general-purpose registers used for data
manipulation.
 R13 is the Stack Pointer (SP), pointing to the top of the current
stack.
 R14 is the Link Register (LR), used to store return addresses.
 R15 is the Program Counter (PC), indicating the address of the
current instruction.
5. Banked Registers:
 Some registers have different states based on the processor mode.
For example, R13 and R14 have different banked versions for each
processor mode.
6. Floating-Point Registers (F0-F31):
 Used for floating-point operations. ARM architecture supports both
single-precision (32-bit) and double-precision (64-bit) floating-
point registers.
7. Vector Registers (V0-V31):
 Introduced in ARMv8-A architecture for Advanced SIMD (Single
Instruction, Multiple Data) instructions, often used for parallel
processing and multimedia applications.
8. NEON Registers:
 Used for SIMD operations, similar to vector registers. NEON
technology provides advanced SIMD capabilities for multimedia
and signal processing.
9. System Control Registers:
 Includes various registers for system control and configuration,
such as the Control Register (CR).
10.Debug Registers:
 Used for debugging and tracing the execution of programs.
11.Coprocesor Registers:
 Registers associated with coprocessors, such as the Floating-Point
Coprocessor (CP10/CP11) in ARMv7-A architecture.
Registers play a crucial role in the instruction execution process, storing data,
addresses, and status information. The specific registers and their functionalities
may vary between different ARM architectures and processor models. If you are
working with a particular ARM processor, it's advisable to refer to the
processor's technical reference manual for detailed information on registers and
their usage.

Operation modes in ARM cortex M3:


The ARM Cortex-M3 is a microcontroller architecture designed for embedded
systems, and it features a simplified set of operation modes compared to the
more complex modes found in other ARM architectures. In the Cortex-M3, the
primary operation modes are:
1. Thread Mode (THUMB): This is the main operational mode where the
processor executes regular application code. In Thread Mode, the
processor operates as a single-threaded processor.
2. Handler Mode (ARM): Also known as Exception Mode, Handler Mode
is entered when an exception occurs. There are various types of
exceptions, such as interrupts and faults, and each has its associated
handler routine. When an exception occurs, the processor switches to
Handler Mode and starts executing the corresponding exception handler.
 Exception Types:
 IRQ (Interrupt Request): External interrupts.
 Faults: Indicate errors or exceptional conditions, such as bus
faults, usage faults, and others.
 SysTick: A timer exception used for real-time operating
system (RTOS) scheduling and timekeeping.
In addition to these two primary modes, the Cortex-M3 architecture introduces
the concept of "Privilege Levels," which helps in managing the access and
permissions of the software executing on the processor. There are two privilege
levels:
1. Privileged Access Level (PAL): The default level when the processor is
in Thread Mode. In this level, most instructions are accessible, and the
software has full control over the system.
2. Unprivileged Access Level (UAL): When an exception occurs, the
processor can switch to this level, reducing the privileges available to the
executing code. This provides a level of isolation and security, especially
in a multi-application or multi-threaded environment.
Big Endian and Little Endian IN ARM :

ARM processors can operate in both big-endian and little-endian modes, and the
endianness can be configured based on the specific requirements of the system.
Endianness refers to the order in which bytes are stored in memory.
1. Big-Endian (BE): In big-endian mode, the most significant byte (MSB) is
stored at the lowest memory address, and the least significant byte (LSB)
is stored at the highest memory address. This is often represented as "BE"
or "BE32" (big-endian 32-bit).
2. Little-Endian (LE): In little-endian mode, the least significant byte (LSB)
is stored at the lowest memory address, and the most significant byte
(MSB) is stored at the highest memory address. This is often represented
as "LE" or "LE32" (little-endian 32-bit).
The endianness of an ARM processor is configurable, and the choice of
endianness is made during the design of the system or the implementation of the
processor. Some ARM-based systems are designed to operate exclusively in
big-endian mode, while others use little-endian mode. Some ARM processors
even support both modes, allowing the endianness to be selected by software or
system configuration.
To configure the endianness on ARM processors, you typically set a control bit
or use specific instructions provided by the processor. For example, in ARM
Cortex processors, the Configuration Control Register (CCR) may include a bit
that controls the endianness. Setting this bit to 0 may configure the processor in
little-endian mode, while setting it to 1 may configure it in big-endian mode.
Cache Mechanism:

ARM processors often incorporate cache memory as part of their memory hierarchy to improve
performance by reducing the time it takes to access frequently used data. Caches store copies of
frequently accessed data and instructions, allowing the processor to retrieve them more quickly than
fetching from the main memory. The cache mechanism in ARM architectures can vary depending on
the specific ARM core and the implementation by the chip manufacturer, but here are some common
features:

Level 1 (L1) Caches:

Data Cache (D-cache): Stores frequently accessed data.

Instruction Cache (I-cache): Stores frequently executed instructions.

Level 2 (L2) Cache:


Some ARM processors may have an additional level of cache (L2) that is shared between multiple
cores or clusters.

Cache Lines:

The cache is organized into cache lines, which are blocks of contiguous memory. When a piece of
data is loaded into the cache, it brings an entire cache line.

Cache Associativity:

Determines how the cache lines are mapped to the cache sets. Common associativity levels include
direct-mapped, set-associative, and fully-associative.

Write Policies:

Write-Through: Data is written to both the cache and the main memory simultaneously.

Write-Back: Data is written to the cache first and then later to the main memory when the cache line
is replaced.

Cache Coherency:

In multi-core or multi-processor systems, cache coherency mechanisms ensure that all processors
see a consistent view of memory. This involves maintaining consistency between the caches and the
main memory.

Cache Replacement Policies:

Determines which cache line to evict when a new line needs to be loaded. Common policies include
Least Recently Used (LRU), First-In-First-Out (FIFO), and random replacement.

Prefetching:

Some ARM processors implement prefetching mechanisms to predict and fetch data into the cache
before it is actually needed, reducing memory access latency.

Cache Locking:

Allows certain cache lines to be "locked" in the cache, preventing them from being replaced. This can
be useful in real-time systems or for critical code sections.

Cache Maintenance Instructions:

ARM architectures provide specific instructions for cache maintenance, such as flushing the cache,
invalidating cache lines, or cleaning and invalidating a specific cache entry.

Memory Management Unit IN ARM

The Memory Management Unit (MMU) is a crucial component in modern computer architectures,
including those based on ARM processors. The MMU plays a significant role in managing the
virtual memory system, providing features such as address translation, memory protection, and
memory access control. Here are key aspects of the Memory Management Unit in ARM
architectures:

1. Virtual Memory:
 The MMU enables the use of virtual memory, allowing programs to execute as if
they have access to a large, contiguous block of memory, even if the physical
memory is fragmented or limited.

2. Address Translation:

 The MMU translates virtual addresses used by programs into physical addresses in
the actual memory. This translation is typically done using a combination of page
tables and page table entries.

3. Page Tables:

 ARM processors typically use a two-level or three-level page table structure for
address translation. The page tables store information about the mapping between
virtual and physical addresses.

4. Translation Lookaside Buffer (TLB):

 The TLB is a cache that stores recently used virtual-to-physical address translations,
speeding up the address translation process. The TLB helps avoid accessing the
page tables for every memory access.

5. Memory Protection:

 The MMU provides mechanisms for memory protection, allowing the operating
system to control access rights to different regions of memory. This includes read-
only, read-write, and execute permissions.

6. Caching Control:

 The MMU allows the operating system to control the caching behaviour for
different memory regions. This includes specifying whether a region should be
cached or not, and if cached, the type of caching (write-through or write-back).

7. Domain Access Control:

 Some ARM architectures include a feature known as domains, allowing the MMU
to group pages and control access to those groups. This is useful for enforcing
access control policies.

8. Address Space Layout Randomization (ASLR):

 The MMU can support security features like ASLR, which randomizes the location
of executable code and data in the virtual address space, making it harder for
attackers to predict memory locations.

9. Memory Fault Handling:

 The MMU generates faults for memory-related errors, such as page faults, access
violations, and other exceptional conditions. The operating system can handle
these faults to ensure the integrity and security of the system

You might also like