ECE 424 Embedded Systems Design Lecture 8 & 9 & 10: Embedded Processor Architecture Chapter 5 Ning Weng.

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

Computer Architecture
COMP375 Computer Architecture and Organization Senior Review.
Practical Malware Analysis
Memory Management: Overlays and Virtual Memory
Computer Organization and Assembly Languages Yung-Yu Chuang
Computer Organization and Architecture
IA-32 Processor Architecture
OS2-1 Chapter 2 Computer System Structures. OS2-2 Outlines Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
CE6105 Linux 作業系統 Linux Operating System 許 富 皓. Chapter 2 Memory Addressing.
Computer System Overview
Introduction to ARM Architecture, Programmer’s Model and Assembler Embedded Systems Programming.
Computer System Overview
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
PhD/Master course, Uppsala  Understanding the interaction between your program and computer  Structuring the code  Optimizing the code  Debugging.
1 OS & Computer Architecture Modern OS Functionality (brief review) Architecture Basics Hardware Support for OS Features.
Chapter 2: Computer-System Structures
Chapter 2 The OS, the Computer, and User Programs Copyright © 2008.
CH12 CPU Structure and Function
1 Instant replay  The semester was split into roughly four parts. —The 1st quarter covered instruction set architectures—the connection between software.
ECE 526 – Network Processing Systems Design Network Processor Architecture and Scalability Chapter 13,14: D. E. Comer.
The Intel Architecture and Windows Internals
Lecture#14. Last Lecture Summary Memory Address, size What memory stores OS, Application programs, Data, Instructions Types of Memory Non Volatile and.
Computer Systems Overview. Page 2 W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware resources of one.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 8: Main Memory.
Edited By Miss Sarwat Iqbal (FUUAST) Last updated:21/1/13
Introduction of Intel Processors
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Operating Systems and Networks AE4B33OSS Introduction.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 1 Computer System Overview.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
Fall 2012 Chapter 2: x86 Processor Architecture. Irvine, Kip R. Assembly Language for x86 Processors 6/e, Chapter Overview General Concepts IA-32.
1 Memory Management 4.1 Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement algorithms.
Lecture 9: Memory Hierarchy Virtual Memory Kai Bu
CS 6560 Operating System Design Lecture 8: Memory Management.
1 Linux Operating System 許 富 皓. 2 Memory Addressing.
Chapter 8 CPU and Memory: Design, Implementation, and Enhancement The Architecture of Computer Hardware and Systems Software: An Information Technology.
Ch. 2 Data Manipulation 4 The central processing unit. 4 The stored-program concept. 4 Program execution. 4 Other architectures. 4 Arithmetic/logic instructions.
ECE 424 Embedded Systems Design Lecture 5: Platform Architecture Ning Weng.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The.
Next Generation ISA Itanium / IA-64. Operating Environments IA-32 Protected Mode/Real Mode/Virtual Mode - if supported by the OS IA-64 Instruction Set.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 5:
Different Microprocessors Tamanna Haque Nipa Lecturer Dept. of Computer Science Stamford University Bangladesh.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Introduction to Intel IA-32 and IA-64 Instruction Set Architectures.
Computer Systems Overview. Lecture 1/Page 2AE4B33OSS W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware.
Introduction to Operating Systems Concepts
Chapter Overview General Concepts IA-32 Processor Architecture
Memory COMPUTER ARCHITECTURE
x86 Processor Architecture
William Stallings Computer Organization and Architecture 8th Edition
Chapter 8: Main Memory.
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Chapter 8 Central Processing Unit
Virtual Memory Overcoming main memory size limitation
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
COMP755 Advanced Operating Systems
Presentation transcript:

ECE 424 Embedded Systems Design Lecture 8 & 9 & 10: Embedded Processor Architecture Chapter 5 Ning Weng

Introduction Concepts with processor within SOC ─ Focus on 32 bit ─ Large data set, high performance and complex applications Basic execution environment Application binary interface Instruction classes Interrupts Memory mapping and protection Memory hierarchy Ning WengECE 4242

Basic Execution Environment ARM and PowerPC ─ Generalized Registers Intel ─ Segment Registers Ning WengECE 4243

Basic Execution environment Instruction Pointer ─ Program counter maintained by the CPU ─ ARM vs. Intel ARM allows direct modification Intel uses Extended Instruction Pointer (EIP) Flags ─ Status Flags –ADD, SUB, and MUL ─ Additional bit flags –Information for the programmer and OS. Ning WengECE 4244

Basic Execution environment Stack Pointer ─ Program stacks are created in system memory Store local variables, allocate storage, pass function arguments Base Pointer ─ Allows a program to manage the function calling hierarchy on the stack. ─ Memory Dump ─ Also known as frame pointer Ning WengECE 4245

Execution Environment Ning WengECE 4246

Privilege Levels Different levels are provided for security and resource access control ─ Highest privilege (0) for OS and lowest privilege (3) for user programs ─ Helps manage system resources ─ Level 0 Linux – Kernel Mode Windows – Ring 0 Ning WengECE 4247

Processor Specifics Intel specific CPUID instruction ─ Instructions to display the feature set of a processor ─ Helps in performance tuning ─ Example Linux command /cat/proc/cpuinfo utilizes CPUID instruction RDTSC ─ Returns the maximum number of ticks at maximum processor frequency ─ Very accurate Ning WengECE 4248

Application Binary Interface Describes the low-level interface between an application and the operating system ─ Useful for debugging Ning WengECE 4249

Processor Instruction Classes Immediate Operands ─ MOV EAX, 00 Register Operands ─ Source/Destination can be almost any register (RISC) Memory Operands ─ MOV [EBX], EAX Data Transfer Instructions ─ MOVNTI Ning WengECE 42410

Processor Instruction Classes Arithmetic Instructions ─ ALU Binary Operations Decimal Operations Logical Operations ─ AND, OR, XOR, NOT Shift Rotate Operations Bit/Byte Operations Tables on page Ning WengECE 42411

Branch and Control Flow Instructions Needed to control the flow of a program’s execution ─ Examples Jmp, LOOP, CALL, RET Ning WengECE 42412

SIMD Instructions Single Instruction Multiple Data ─ Intel SSE ─ Used to optimize: Speech recognition algorithms Video display and capture routines 3D graphics Encryption algorithms ─ In theory, the speed up is 75% over SISD instructions Ning WengECE 42413

Exception/Interrupt Sources Ning WengECE 42414

Vector Table Structure PowerPC and ARM ─ Look up vector table using software Intel ─ Processor itself identifies fault without software Segment Selector ─ Selects segment from descriptor table Segment Offset ─ Produces the linear address Privilege Level ─ Set to zero Ning WengECE 42415

Interrupt Descriptor Dereferencing Ning WengECE 42416

Masking Interrupts Exception frame ─ Format of saved interrupt/exception data Masking Interrupts ─ Pros Disable during parallel pointer operations ─ Cons Can be processed by other hardware threads Degrades system performance Ning WengECE 42417

Stack Frames Ning WengECE 42418

Components of Interrupt Latency Ning WengECE 42419

Memory Mapping and Protection Memory Protection Unit (MPU) ─ Defines valid parts of the system memory map and access control ─ Regulates cacheable memory regions Memory Management Unit (MMU) ─ Protection and fine-grained address translation between linear/virtual and physical address ─ A building block of a virtual memory system ─ Allows OS to overcommit memory on applications by moving data from and to disks via scheme paging ─ Paging increasing memory efficiency by moving infrequently- used part of programming working memory from RAM to disk. ─ The unit of transfer is a fixed-sized called page ─ Page fault: thousand of cycles, not used for embedded systems Ning WengECE 42420

Address Translation Ning WengECE 42421

Memory Hierarchy CPU Stalls ─ Often caused on read operations ─ Write buffering to avoid write stalls Logic Gate Memory ─ Buffering Static RAM (SRAM) ─ Access time: 1-2 CPU Core Clocks Dynamic RAM (DRAM) ─ 100 ns Mass Storage ─ Very Slow, 1000s cycles Ning WengECE 42422

Cache Hierarchy Temporal locality ─ If a memory location was accessed then it is likely to be accessed again soon Spatial locality ─ A program is likely to access a memory address close to the current access Hierarchy ─ CPU -> L1 -> L2 L2 is slower as it is larger, and farther away Cache allocation ─ Evicts data based on a missed memory read Ning WengECE 42423

Six-Way Set Associative 24K Ning WengECE 42424

Cache Coherency Ensures that content from peripherals is correct ─ Responsibility of drivers Snoop Cycles ─ Processor snoops during memory transactions Cache Flushing Simplifies software development and debugging Multicore Processors use MESI to share cache data Ning WengECE 42425

MESI (Modified, Exclusive, Shared, Invaled) ─ Stands for the different states of cache MESI is widely popular in muliprocessor designs such as: ─ Intel architectures, ARM11 and ARM Cortex-A9 MPCores Ning WengECE 42426

System Bus Bus Addresses ─ PCIe offers direct memory access to the system memory Create addresses that relate to a physical system address Device drivers convert virtual addresses to physical addresses ─ Intel PCIe bus is 1:1 with the physical addresses ─ SoC’s however require a translation System Bus Interface ─ Front Side Bus (FSB) Connects CPU and Memory Controller Hub Ning WengECE 42427

Ning WengECE 42428

Summary Concepts with processor within SOC Basic execution environment Application binary interface Instruction classes Interrupts Memory mapping and protection Memory hierarchy Ning WengECE 42429