The ARM Programmer’s Model

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

Computer Organization and Architecture
Computertechniek Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology 1.
Computer System Overview
Computer Organization and Architecture
Computer Organization and Architecture
CSCI 4717/5717 Computer Architecture
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Introduction To The ARM Microprocessor
Computer System Overview
1 Computer System Overview OS-1 Course AA
1 CSIT431 Introduction to Operating Systems Welcome to CSIT431 Introduction to Operating Systems In this course we learn about the design and structure.
Computer System Overview
CS/EE 3710 National Semiconductor CR16 Compact RISC Processor Baseline ISA and Beyond…
Computer System Organization S H Srinivasan
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
ARM programmer’s model and assembler Embedded Systems Programming.
Topics covered: ARM Instruction Set Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
ARM 7 Datapath. Has “BIGEND” input bit, which defines whether the memory is big or little endian Modes: ARM7 supports six modes of operation: (1) User.
COMP3221 lec28-exception-II.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 28: Exceptions & Interrupts - II
COMP3221 lec27-exception-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 27: Exceptions & Interrupts - I
Midterm Wednesday 11/19 Overview: 25% First Midterm material - Number/character representation and conversion, number arithmetic - DeMorgan’s Law, Combinational.
Prardiva Mangilipally
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
CH12 CPU Structure and Function
Embedded System Design Center Sai Kumar Devulapalli ARM7TDMI Microprocessor Thumb Instruction Set.
What are Exception and Interrupts? MIPS terminology Exception: any unexpected change in the internal control flow – Invoking an operating system service.
Exception and Interrupt Handling
Introduction to Embedded Systems
Computer Systems Overview. Page 2 W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware resources of one.
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
Operating Systems and Networks AE4B33OSS Introduction.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 1 Computer System Overview.
Microprocessor. Interrupts The processor has 5 interrupts. CALL instruction (3 byte instruction). The processor calls the subroutine, address of which.
AT91 Interrupt Handling. 2 Stops the execution of main software Redirects the program flow, based on an event, to execute a different software subroutine.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Chapter 6: Computer Components Dr Mohamed Menacer Taibah University
Lecture 1: Review of Computer Organization
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
Processor Organization
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
1 Computer Architecture. 2 Basic Elements Processor Main Memory –volatile –referred to as real memory or primary memory I/O modules –secondary memory.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
1 TM 1 Embedded Systems Lab./Honam University r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 (sp) r14 (lr) r15 (pc) cpsr r13 (sp) r14 (lr) spsr r13 (sp)
Introduction to ARM processor. Intro.. ARM founded in November 1990 Advanced RISC Machines Company headquarters in Cambridge, UK Processor design centers.
ARM7 TDMI INTRODUCTION.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Intel Xscale® Assembly Language and C. The Intel Xscale® Programmer’s Model (1) (We will not be using the Thumb instruction set.) Memory Formats –We will.
Computer Systems Overview. Lecture 1/Page 2AE4B33OSS W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware.
1 Computer System Overview Chapter 1. 2 Operating System Exploits the hardware resources of one or more processors Provides a set of services to system.
Chapter 4: Introduction to Assembly Language Programming
Basic Processor Structure/design
Timer and Interrupts.
May 2006 Saeid Nooshabadi ELEC2041 Microprocessors and Interfacing Lectures 27: Exceptions & Interrupts - I
Computer Architecture
ARM Introduction.
Computer System Overview
CPU Structure and Function
Chapter 11 Processor Structure and function
May, 2004 Modified from notes by Saeid Nooshabadi
Copyright © 2013 Elsevier Inc. All rights reserved.
Presentation transcript:

The ARM Programmer’s Model Jacob Huerta, Ryan Crell, and Veronica Hohe 1/30/2015

Outline ARM Registers Von Neumann Cycle Sequence CPSR Memory Standard ARM vs. Thumb ARM Instructions ARM Instructions Supervisor Mode/Kernel Mode Exceptions 1/30/2015

ARM Registers 1/30/2015

ARM Registers Instruction set = operations to change system state State = data items in processor’s visible registers/systems memory Multiple invisible registers in a processor 1/30/2015

ARM Registers User-level programming 15 general purpose registers PC CPSR System-level programming/exceptions Remaining registers 1/30/2015

Von Neumann Cycle Sequence 1/30/2015

Von Neumann Cycle Sequence 1/30/2015

CPSR 1/30/2015

ARM CPSR Control Bits Protected from user-level programs Mode T IF Control the processor mode Bits 0-4 (must be a valid mode) T Control the instruction set State bit IF Enables control interrupt Bit 6 is FIQ disable and Bit 7 is IRQ disable 1/30/2015

ARM CPSR Flag Bits Condition Code Flags NZCV N (“Negative flag”) 0/1 = value is positive/negative Z (“Zero flag”) 0/1 = result is non-zero/zero C (“Carry flag”) 0/1 = “extends” for shift/”borrows” for subtraction V (“Overflow flag”) 0/1 = no overflow/overflow caused by last arithmetic operation 1/30/2015

ARM CPSR Unused Bits Unused bits Reserved State preserved when changing the flag or control bits Should not be altered by programs Should not rely on them when checking the PSR status Might read as 1’s or 0’s in future processors 1/30/2015

ARM Memory Organization 1/30/2015

ARM Memory Organization View memory as linear array of bytes numbered from 0 to 232-1 Store data items in Byte (8 bits) Half-word (16 bits) Word (32 bits) Align words on 4 bytes Organize in little-endian style 1/30/2015

ARM Instructions 1/30/2015

ARM vs. THUMB Instructions 32-bit instruction set 3-data address instructions 16 general purpose registers 16-bit instruction set 2-data address instructions 8 general purpose registers “Less regular” instructions Higher code density High performance 1/30/2015

ARM vs. THUMB Instructions Not a “complete” architecture Supports ARM architecture The T bit in CPSR toggles the interpretation 1/30/2015

ARM vs. THUMB Instructions 1/30/2015

ARM Instructions Load-store architecture Processes only values stored in registers and instructions Performs operations on these values Stores results in register Affects memory using only load and store instructions Inability to perform memory-to-memory operations Instructions Data processing: between registers (add, sub, etc.) Data transfer: between registers and memory (load, store) Control flow: execution of instructions (branches, link, supervisor calls) 1/30/2015

Supervisor Mode/Kernel Mode 1/30/2015

Supervisor Mode/Kernel Mode User with supervisor privileges can use system calls to affect Kernel code Device drivers Privileged code User program with IO access permissions Unprivileged code User programs 1/30/2015

Exceptions 1/30/2015

Exceptions Normal execution is paused to handle events like Systems calls Interrupts generated by external sources Undefined instructions Traps 1/30/2015

Exception Handling Save current state is Copy PC into register rl4_exc Copy CPSR into register SPSR_exc Register r13_exc = pointer to memory stack to store user registers Set processor operating mode to exception mode 1/30/2015

Exception Handling Set PC to value between 0x00 and 0x1C depending on exception type Restore user registers from memory stack Restore (adjusted) PC and CPSR 1/30/2015

Input/Output (I/O) System 1/30/2015

Input/Output (I/O) System I/O peripheral Device mapped to memory Device registers treated as memory locations by system Given interrupt support (make interrupt requests) Normal interrupt (IRQ) = most requests Fast interrupt (FIQ) = time-sensitive/critical requests Direct Memory Access (DMA) External to ARM processor Handles high-bandwidth I/O traffic 1/30/2015

References (2001). “The Thumb Instruction Set.” Web. 2001. January 28, 2015. http://paulkilloran.com/arm/Lecture_7.pdf (2014). “About processor exceptions.” ARM. Web. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471g/BABGCFHB.html. (2014). “Exception handling process.” ARM. Web. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471g/BABGCFHB.html. (2014). “Load/store architecture.” Wikipedia. Web. August 4, 2014. http://en.wikipedia.org/wiki/Load/store_architecture. (2014). “Protection ring.” Wikipedia. Web. December 30, 2014. http://en.wikipedia.org/wiki/Protection_ring. (2014). “Reserved bits.” ARM. Web. August 4, 2014. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0229c/ch02s07s03.html (2014). “Trap (computing).” Wikipedia. Web. April 30, 2014. http://en.wikipedia.org/wiki/Trap_(computing). Furber, S. (2000). ARM system-on-chip architecture. Harlow, England: Addison-Wesley. (2014). Gibson, J. (2011). ARM assembly language: An Introduction (2nd ed.). Lexington, KY: The Author. 1/30/2015

Questions? 1/30/2015