ARM Cortex-M0 Designstart Processor and V6-M Architecture

ARM Cortex-M0 Designstart Processor and V6-M Architecture

ARM Cortex-M0 DesignStart Processor and v6-M Architecture Joe Bungo ARM University Program Manager – Americas/Europe R&D Division 1 2 Agenda ° Introduction to ARM Ltd Cortex-M0 DesignStart Processor ARM v6-M Programmers Model ARM v6-M Exception Handling ARM v6-M Instruction Set Overview Pipeline M0_DS EDK Example System 3 ARM Ltd ARM founded in November 1990 ° Advanced RISC Machines Company headquarters in Cambridge, UK ° Processor design centers in Cambridge, Austin, and Sophia Antipolis ° Sales, support, and engineering offices all over the world Best known for its range of RISC processor cores designs ° Other products – fabric IP, software tools, models, cell libraries - ° to help partners develop and ship ARM-based SoCs ARM does not manufacture silicon More information about ARM and our offices on our web site: www.arm.com 4 ARM Offices Worldwide 5 ARM’s Activities Connected Community Development Tools Software IP Processors memory System Level IP: Data Engines SoCSoC Fabric 3D Graphics Physical IP 6 ARM Connected Community – 800+ 7 Huge Range of Applications IR Fire Detector Exercise Utility Intelligent Machines Energy Efficient Appliances Intelligent toys Meters Vending Tele-parking Equipment Adopting 32-bit ARM Microcontrollers 8 Huge Opportunity For ARM Technology 30+ 100+ billion billion cores accumulated cores to date after next 9 yrs 1998 2013 2020 9 ARM Cortex Advanced Processors ° ARM Cortex™-A family: ° Applications processors for feature- rd Cortex-A57 rich OS and 3 party applications ...2.5GHz Cortex-A53 ° ARM Cortex-R family: Cortex-A15 ° Embedded processors for real-time Cortex-A9 Cortex-A8 signal processing, control applications Cortex-A7 Cortex-A5 ° ARM Cortex-M family: Cortex-R7 Cortex-R5 ° Microcontroller-oriented processors Cortex-R4 for MCU, ASSP, and SoC applications Cortex-M4 Cortex-M3 Cortex-M1 Cortex-M0 SC300 SC000 Cortex-M0+ <12k gates... 10 Relative Performance* 2500 2000 ) 1500 1000 Max Frequency Frequency Max (Mhz 500 0 Cortex- Cortex- Cortex-A9 ARM7 ARM926 ARM1026 ARM1136 ARM1176 Cortex-A8 M0 M3 Dual-core Max Freq (MHz) 50 150 184 470 540 610 750 1100 2000 Min Power (mW/MHz) 0.012 0.06 0.35 0.235 0.36 0.335 0.568 0.43 0.5 *Represents attainable speeds in 130, 90, 65, or 45nm processes 11 Agenda Introduction to ARM Ltd ° Cortex-M0 DesignStart Processor ARM v6-M Programmers Model ARM v6-M Exception Handling ARM v6-M Instruction Set Overview Pipeline M0_DS EDK Example System 12 Cortex family Cortex-A8 Cortex-R4 Cortex-M3 ° Architecture v7A ° Architecture v7R ° Architecture v7M ° MMU ° MPU (optional) ° MPU (optional) ° AXI ° AXI ° AHB Lite & APB ° VFP & NEON support ° Dual Issue 13 Cortex-M0 DesignStart Processor 14 Cortex-M0 DesignStart Differences ARM Cortex-M0 processor Full product “M0_DS” features options implementation Verilog core VVV Flattened and Obfuscated AMBA AHB-lite interface VVV VVV ARMv6-M instruction set architecture VVV VVV NVIC Interrupt controller VVV VVV Interrupt line configurations 1 to 32 16 only Debug (SWD, JTAG) option VVV Up to 4 breakpoints, 2 watchpoints VVV Low power optimisations (ACG) VVV Multiple power domain support with WIC VVV Fast multiplier (1 cycle) option VVV System timer VVV VVV Area (gates) 12k – 25k 16K 15 Agenda Introduction to ARM Ltd Cortex-M0 DesignStart Processor ° ARM v6-M Programmers Model ARM v6-M Exception Handling ARM v6-M Instruction Set Overview Pipeline Basic System Design 16 v6-M Data Types ° ARM v6-M is a 32-bit architecture. ° When used in relation to the ARM: ° Byte means 8 bits ° Halfword means 16 bits (two bytes) ° Word means 32 bits (four bytes) ° Doubleword means 64 bits (eight bytes) 17 Cortex-M0 Programmers Model ° The Cortex-M0 is designed to be programmed fully in C ° No need to write assembly code ° Full Thumb technology, and subset of Thumb2 ° 16-bit and 32-bit instructions ° Set of processor core and memory-mapped registers are provided ° Forwards compatible with other M-profile processors ° In-order execution of instructions ° All instructions are treated as restartable ° Including LDM/STM 18 Cortex-M Differences ° Fully programmable in C ° Stack-based exception model ° Only two processor modes ° Thread Mode for User tasks ° Handler Mode for OS tasks and exceptions ° Vector table contains addresses 19 Cortex-M0 Memory Map Device 511MB Core Memory Mapped Register Space, 0xE010 0000 Private Peripheral Bus i.e. NVIC (XN) 0xE000 0000 External 1MBDevice 1GB External Peripherals (XN) 0xA000 0000 External RAM 1GB External Memory 0x6000 0000 External Peripherals (XN) Peripheral 500MB 0x4000 0000 SRAM 500MB Data Memory (code can also be placed here) 0x2000 0000 Executable region for program code and data Code 500MB (vector table is fixed at address 0x0000 0000) 0x0000 0000 XN – execute never 20 Cortex-M0 Register Set Main ° All registers are 32 bits wide (Thread Mode) r0 r1 ° 13 general purpose registers r2 r3 ° Registers r0 – r7 (Low registers) r4 ° Registers r8 – r12 (High registers) r5 r6 r7 ° 3 registers with special meaning/usage r8 r9 ° Stack Pointer (SP) – r13 r10 ° Link Register (LR) – r14 r11 Process r12 (Handler Mode) ° Program Counter (PC) – r15 sp sp lr r15 (pc) ° Special-purpose registers xPSR ° xPSR shows a composite of the content of ° APSR, IPSR, EPSR 21 Register Usage Register Arguments into function r0 Result(s) from function The compiler has a set of rules known as a r1 Procedure Call Standard that determine how to otherwise corruptible r2 pass parameters to a function (see AAPCS ) (Additional parameters r3 passed on stack) CPSR flags may be corrupted by function call r4 r5 Assembler code which links with compiled r6 code must follow the AAPCS at external Register variables r7 interfaces Must be preserved r8 r9 The AAPCS is part of the ABI for the ARM r10 Architecture r11 Scratch register r12 (corruptible) Stack Pointer r13/sp Link Register r14/lr - r14 can be used as a temporary once value stacked Program Counter r15/pc 22 The PSR Registers ° APSR - Application Program Status Register 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 N Z C V ° Contains the Negative, Zero, Carry and OVerflow flags from the ALU ° IPSR – Interrupt Program Status Register 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Exception Number ° EPSR – Execution Program Status Register 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 T ° Thumb code is executed 23 The PSR Composite Registers ° xPSR ° Composite register of APSR, IPSR and EPSR 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Exception N Z C V T Number ° IEPSR ° Composite register of IPSR and EPSR 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Exception T Number 24 Processor Mode Usage ° Processor mode may change when exceptions occur ° Thread Mode is entered on Reset ° Handler Mode is entered on all other exceptions ° Both modes have full access to all system resources ° No concept of privilege. Mechanism exists but has no meaning to M0 ARM Cortex-M0 Processor Application Code Thread Reset SVC Mode PendSV Exception Faults Return SysTick Exception Code Interrupts Handler Faults Mode 25 Agenda Introduction to ARM Ltd Cortex-M0 DesignStart Processor ARM v6-M Programmers Model ° ARM v6-M Exception Handling ARM v6-M Instruction Set Overview Pipeline M0_DS EDK Example System 26 Supported Exceptions ° Seven exception types are supported Using Thread Mode Reset Processor reset input is asserted Using Handler Mode HardFault Any type of fault occurred e.g. Bus fault or undefined instruction NMI Non-Maskable Interrupt occurred IRQs IRQ Interrupts occurred PendSV Software generated interrupt SVCall Execution of a SVC instruction SysTick Internal system timer caused interrupt 27 Exception Properties ° Each exception has associated properties Exception number – Identification for the exception Vector address – Exception entry point in memory Priority level – Determines the order in which multiple pending exceptions are handled 28 Vector Table ° Vector table contains the following information ° Handler vector addresses ° Initial value of the Main Stack Pointer (MSP) 0xBF Interrupt #31 Handler Vector - … 0x40 Interrupt #0 Handler Vector 0x3C SysTick Handler Vector 0x38 PendSV Handler Vector - reserved 0x2C SVCall Handler Vector - reserved 0x0C HardFault Handler Vector 0x08 NMI Handler Vector 0x04 Reset Handler Vector 0x00 Initial value of MSP 29 Exception Numbers & Vector Addresses Name Exception Number Vector Address Interrupts #0 - #31 (N interrupts) 16 to 16 + N 0x40 – 0xBF SysTick (SysTick Extension) 15 0x3C PendSV 14 0x38 SVCall 11 0x2C HardFault 3 0x0C Non Maskable Interrupt (NMI) 2 0x08 Reset 1 0x04 ° Exception number is used to calculate the vector address ° Exception number defines the word offset from 0x0 ° Exception numbers which are not shown are reserved 30 Exception Entry Overview ° The Exception Entry sequence is as follows ° Perform Stack Push (R0-R3, R12, R14, PC (return address), and xPSR) ° Select Handler Mode ° Update registers ° Set LR to EXC_RETURN (architectural value) ° Generated automatically when exception accepted ° Special value that indicates exception return vs. subroutine return ° Also indicates mode to return to ° Set IPSR<5:0> to the Exception Number ° Set EPSR.T bit ° Set PC to the vector address 31 Vector Table Usage ° In the case of an exception, the core ° Reads the vector handler address for the exception from the vector table ° Branches to the handler Handler Handler Vector points to the Handler code Handler Vector 32 Exception Return ° Exception returns can be accomplished using the following instructions ° POP which includes loading the PC ° BX with any register ° Usually LR is used ° Exception return is performed in the following steps ° LR value (EXC_RETURN) is loaded into the PC to signal an exception return ° Since no special instruction for exception return needed, handlers can be written as normal C functions ° Change mode & stack ° Dependent on EXC_RETURN ° Stack Pop of AAPCS registers is performed ° Includes load of return address into the PC 33 Reset Behavior Main 5 4 Reset Handler 3 0x04 Reset Handler Vector 1 0x00 Initial value of MSP r13 (MSP) 2 1.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    64 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us