CORTEX-M0 Structure Discussion 1

Slides:



Advertisements
Similar presentations
ARM versions ARM architecture has been extended over several versions.
Advertisements

Embedded Systems Programming
Overheads for Computers as Components 2nd ed.
Microprocessors.
1 ARM Movement Instructions u MOV Rd, ; updates N, Z, C Rd = u MVN Rd, ; Rd = 0xF..F EOR.
© 2000 Morgan Kaufman Overheads for Computers as Components ARM instruction set zARM versions. zARM assembly language. zARM programming model. zARM memory.
Chapter 2 Instruction Sets 金仲達教授 清華大學資訊工程學系 (Slides are taken from the textbook slides)
Embedded System Design Center ARM7TDMI Microprocessor Data Processing Instructions Sai Kumar Devulapalli.
ARM Microprocessor “MIPS for the Masses”.
Processor System Architecture
Topics covered: ARM Instruction Set Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
ARM Instructions I Prof. Taeweon Suh Computer Science Education Korea University.
Embedded System Design Center Sai Kumar Devulapalli ARM7TDMI Microprocessor Thumb Instruction Set.
CORTEX-M0 Structure Discussion 2 – Core Peripherals
1 ARM University Program Copyright © ARM Ltd 2013 Cortex-M4 CPU Core.
Lecture 4. ARM Instructions #1 Prof. Taeweon Suh Computer Science Education Korea University ECM586 Special Topics in Embedded Systems.
Lecture 4. ARM Instructions Prof. Taeweon Suh Computer Science & Engineering Korea University COMP427 Embedded Systems.
1 ARM University Program Copyright © ARM Ltd 2013 Cortex-M0+ CPU Core.
ARM Cortex-M0 August 23, 2012 Paul Nickelsberg Orchid Technologies Engineering and Consulting, Inc. CORTEX-M0 Structure Discussion.
ECS642U Embedded Systems ARM CPU and Assembly Code William Marsh.
ARM7TDMI Processor. 2 The ARM7TDMI processor is a member of the Advanced RISC machine family of general purpose 32-bit microprocessor What does mean ARM7TDMI.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
1 Chapter 4 ARM Assembly Language Smruti Ranjan Sarangi Computer Organisation and Architecture PowerPoint Slides PROPRIETARY MATERIAL. © 2014 The McGraw-Hill.
Lecture 2: Advanced Instructions, Control, and Branching EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer.
Unit-2 Instruction Sets, CPUs
AT91 C-startup. 2 For reasons of modularity and portability most application code for an embedded application is written in C The application entry point.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Instruction Set Architectures Early trend was to add more and more instructions to new CPUs to do elaborate operations –VAX architecture had an instruction.
Ch 5. ARM Instruction Set  Data Type: ARM processors supports six data types  8-bit signed and unsigned bytes  16-bit signed and unsigned half-words.
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.
Lecture 6: Decision and Control CS 2011 Spring 2016, Dr. Rozier.
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.
Smruti Ranjan Sarangi, IIT Delhi Chapter 4 ARM Assembly Language
Interrupt and Exception Programming
Microprocessor Systems Design I
Part of the Assembler Language Programmers Toolbox
ECE 3430 – Intro to Microcomputer Systems
Timer and Interrupts.
Introduction to the ARM Instruction Set
ARM Registers Register – internal CPU hardware device that stores binary data; can be accessed much more rapidly than a location in RAM ARM has.
ECE 3430 – Intro to Microcomputer Systems
Assembly Language Assembly Language
ARM Cortex-M3 RTLAB 박 유 진.
The Cortex-M3/m4 Embedded Systems: Cortex-M3/M4 Instruction Sets
Programming Peripheral Devices
Interrupts In 8085 and 8086.
Introduction of microprocessor
Interrupt and Exception Programming
Interrupt and Exception Programming
Chapter 10 The Stack.
Number Representations and Basic Processor Architecture
Interrupt and Exception Programming
Chapter 8 Central Processing Unit
Interrupt and Exception Programming
The ARM Instruction Set
Branching instructions
ARM Introduction.
Overheads for Computers as Components 2nd ed.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Computer System Overview
Computer Architecture
Multiply Instructions
CS501 Advanced Computer Architecture
Introduction to Assembly Chapter 2
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
An Introduction to the ARM CORTEX M0+ Instructions
Arithmetic and Logic Chapter 3
Presentation transcript:

CORTEX-M0 Structure Discussion 1 ARM Cortex-M0 CORTEX-M0 Structure Discussion 1 August 21, 2012 Paul Nickelsberg Orchid Technologies Engineering and Consulting, Inc. www.orchid-tech.com

Cortex-M0 Structure Discussion 1 Topics Today CORTEX-M0 Instruction Set CORTEX-M0 Memory Map CORTEX-M0 Register Set CORTEX-M0 Execution Modes

ARM Cortex-M0 Instruction Map

Memory Access Instructions Mnemonic Instruction Description ADR Load PC Relative Address LDM Load Multiple Registers LDR Load Register (Numerous Types) POP Pop Registers from Stack PUSH Push Registers onto Stack STM Store Multiple Registers STR Store Register Cool Features: Multiple Registers may be accessed with a single instruction ADR allows easy relative addressing math

Data Processing Instructions Mnemonic Instruction Description ADCS Add with Carry ADD Add ANDS Logical AND ASRS Arithmetic Shift Right BICS Bit Clear CMN Compare Negative CMP Compare EORS Exclusive OR LSLS Logical Shift Left LSRS Logical Shift Right MOV Move

Data Processing Instructions Mnemonic Instruction Description MULS Multiply MVNS Move NOT ORRS Logical OR REV Reverse Byte Ordering in Word REV16 Reverse Byte Order in Short REVSH Reverse Byte Order in Short Sign Ext RORS Rotate Right RSBS Reverse Subtract SBCS Subtract with Carry SUBS Subtract SUBW

Data Processing Instructions Mnemonic Instruction Description SXTB Sign Extend SXTH UXTB Zero Extend UXTH TST Test Cool Features: 64-Bit Operations can be done w/two instructions Many options for Flag Updates Flexible comparisons

Branch Instructions Mnemonic Instruction Description B(cc) Branch Conditional BL Branch with Link BLX Branch Indirect with Link BX Branch Indirect Cool Features: Link features are like Z80 CALL/RET Instruction, LR Bit Set for proper POP{pc}

Special Instructions Mnemonic Instruction Description BKPT Breakpoint CPSID Disable Interrupts CPSIE Enable Interrupts DMB Data Memory Barrier DSB Data Synchronization Barrier ISB Instruction Synchronization Barrier MRS Move special register to register MSR Move register to special register NOP No Operation SEV Send Event

Special Instructions Mnemonic Instruction Description SVC Supervisor Call WFE Wait for Event WFI Wait for Interrupt Cool Features: Barrier Instructions SEV/SVC Instructions WFE/WFI Instructions

Notable Missing Instructions Mnemonic Instruction Description MLA Multiply with Accumulate SDIV Signed Divide SMLAL Signed Multiply w/Accumulate – 64-Bit Result SMULL Signed Multiply – 64-Bit Result Cortex-M0 is missing the Cortex-M3 instructions shown above. (Note: Cortex-M3 contains additional missing instructions not listed above)

Cortex-M0 Memory Map Memory Region Usage Memory Region Size Memory Region Start Memory Region Stop Device Access 511 Mbyte 0xE0100000 0xFFFFFFFF Private Peripheral 1 Mbyte 0xE0000000 0xE00FFFFF External Device 1 Gbyte 0xA0000000 0xDFFFFFFF External Memory 0x60000000 0x9FFFFFFF Internal Peripheral 512 Mbyte 0x40000000 0x5FFFFFFF Internal SRAM 0x20000000 0x3FFFFFFF Internal Code Execute 0x00000000 0x1FFFFFFF

Cortex-M0 Memory Types Memory Access Types Description NORMAL CPU can re-order memory transactions for efficiency. CPU can perform speculative reads DEVICE CPU preserves transaction order relative to other transactions to DEVICE or STRONGLY-ORDERED memory STRONGLY-ORDERED CPU preserves transaction order relative to all other transactions Execute Never (XN) CPU is prevented from instruction execution, attempted instruction fetch causes HARDFAULT

Cortex-M0 Memory Attributes Memory Region Usage Memory Attribute XN Memory Region Start Memory Region Stop Device Access Device 0xE0100000 0xFFFFFFFF Private Peripheral Strongly Ordered 0xE0000000 0xE00FFFFF External Device 0xA0000000 0xDFFFFFFF External Memory Normal -- 0x60000000 0x9FFFFFFF Internal Peripheral 0x40000000 0x5FFFFFFF Internal SRAM 0x20000000 0x3FFFFFFF Internal Code Execute 0x00000000 0x1FFFFFFF

Cortex-M0 Core Registers R13 - Stack Pointer R14 - Link Register R15 - Program Counter Low Registers General Purpose Registers High Registers Stack Registers PSR – Program Status Register PRIMASK – Int Mask Register CONTROL – Control Register PSP MSP

Cortex-M0 Registers Typical General Purpose Registers 13 General Purpose 32-Bit Regs Stack Pointer – (There are two!) Link Register Program Counter

Cortex-M0 Registers Stack Registers PSP – Process Stack Pointer MSP – Main Stack Pointer Selected by Bit 1 of CONTROL Register Unusual Feature in the 8-bit world

Cortex-M0 Registers Special Registers PSP – Program Status Register PRIMASK – Interrupt Mask Register CONTROL – Control Register PSP is a combination of sub-fields including flags, exception status, and T bit.

Cortex-M0 Execution Modes RESET Thread Mode Handler Mode Tail Chaining Late Arriving Exception Exception Return

Cortex-M0 Execution Modes Exception Types Exception Priority Reset Highest Priority -3 Non Maskable Interrupt (NMI) Priority -2 Hard Fault Priority -1 SVCall Configurable Priority PendSV SysTick Interrupt (IRQ)

Cortex-M0 Execution Modes RESET Thread Mode Handler Mode Exception Priority Check Push Stack Frame Vector Fetch Tail Chaining Late Arriving Exception Return Pop Stack Frame PSP/MSP Select

Meaning and Implications 32-Bit CORTEX-M0 Processing Capability Instruction Set Multiple Move Features Multiply Features Large Flat Memory Map Memory Map Protected Areas Large 32-Bit Symmetric Registers Prioritized Interrupt Servicing Preemptive, Efficient Interrupt Structures 8-Bit Architecture Processor Architecture – 8-Bit World to 32-Bit World