the anatomy of the arm cortex-m0+ processor€¦ · the anatomy of the arm cortex-m0+ processor...

23
1 The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist

Upload: trinhtram

Post on 04-May-2018

323 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

1

The Anatomy of the ARM

Cortex-M0+ Processor

Joseph Yiu

Embedded Technology Specialist

Page 2: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

2

What is the Cortex-M0+ Processor?

2009 – ARM® Cortex™-M0 processor released

Low gate count

High performance

Easy to use

Debug features

2012 – Cortex-M0+ processor released

Same instruction set

Supports all existing features of Cortex-M0

New features

Higher energy efficiency

Ready for future applications

Page 3: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

3

What’s new?

Even better power efficiency

Clean sheet design – 2 stage pipeline

Better performance at the same frequency

Unprivileged execution level

8 region Memory Protection Unit (MPU)

Faster I/O accesses

Vector table relocation

Low cost trace solution available

Various silicon integration features

(e.g.16-bit flash support)

Page 4: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

4

Why a New Design?

Embedded products need even longer battery life

Need to have lower active power

But not compromise on performance

Low power control applications

Need to have faster I/O capability

But not higher operating frequency

Smarter designs

Need more sophisticated features

But not bigger silicon

Energy is the Key

Page 5: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

5

Overview of the Cortex-M0+ Processor

Processor

ARMv6-M architecture

Easy to use, C friendly

Cortex-M series compatibility

Nested Vectored Interrupt

Controller (NVIC)

Flexible interrupt handling

WIC support

Memory Protection Unit (MPU)

Debug from just 2 pins

Page 6: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

6

Compact Instruction Set

Only 56 Instructions

100% compatible with existing

Cortex-M0 processor

Mostly 16-bit instructions

All instructions operate on the

32-bit registers

Option for single cycle 32x32

multiply

Maximum reuse of

existing tools

and

ecosystem

Upward compatibility

to the ARM

Cortex-M3/Cortex-M4

Page 7: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

7

Interrupt Handling

Nested Vectored Interrupt

Controller (NVIC)

Interrupt prioritization

Interrupt masking

Nested interrupt handling

Ease of use

Interrupt handlers in C

Processor hardware

handles stacking

No hidden software

overhead

CMSIS-Core functions for

NVIC control

Cortex-M0+

NVIC

Up to 32

IRQs

NMI

SysTick

Core

System

exceptions

0x00

0x40

7 6

0x80

0xC0

Higher priority

HardFault

NMI

IRQs

-1 -2

0 ARMv6-M

Priority level register

Page 8: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

8

Low Power Processor Design

Minimizing power at every opportunity

Small silicon area (from 12K gates)

Various low power techniques (clock gating, power gating, SRPG, etc)

2-stage pipeline processor for maximum energy efficiency

Reduce ratio between flip-flops and combinatorial logic

Lower average CPI (Cycles Per Instruction)

Clock

Instruction

#N

Instruction #N+1

Fetch Execute

Pre-decode Main decode

Decode

Fetch Execute Decode

Page 9: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

9

Sleep Modes

Architecture defined sleep modes

Normal sleep

Deep sleep

Deep sleep with SRPG support (using WIC) – nW power profile with

instant wakeup (processor power down with state retention)

Can be extended with MCU specific power control registers

Pow

er

consum

ption

Deep Sleep (WIC+SRPG)

Sleep

Active

Power Off

Deep Sleep

(WIC)

Not To

scale

Leakage

+

dynamic

Leakage

+ some

dynamic

Leakage

only

State

Retention

only

Power

Off

Page 10: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

10

Low Power Features

Wakeup Interrupt Controller

(WIC)

Detect interrupt while the

processor is powered down

Enables SRPG deep sleep

operation with instant wakeup

Sleep-on-exit

Enables the processor to

sleep automatically when all

interrupt services are

complete

Ideal for interrupt driven

application

Sleep Mode

SLEEPONEXIT bit set

ISR Active Mode

Sleep Mode

WFI or WFE

ISR exit

Page 11: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

11

Minimizing Flash Accesses

Program memory access (e.g. Flash) generally on alternate

cycles

Typical execution of contiguous code shown here

A 32-bit fetch gives two 16-bit instructions

Page 12: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

12

Smaller Branch Shadow

In pipelined processors, subsequent instructions are fetched

while executing current instructions (“prefetching”)

Branch shadow means energy wasted if branch is taken

Length of branch shadow depends on the alignment of branch

instructions

By moving to a two stage pipeline, the branch shadow is

reduced

ADD CMP BGE label

(branch)

Branch

shadow

Maximum branch shadow

is 2 instructions (1 word)

and minimum is 0

instruction

Branch Taken

label

Fetches as 16-bit

transfer if branch target

is unaligned

Program flow

Page 13: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

13

Cortex-M0+ : The Ultimate in Low Power

The most energy efficient 32-bit processor ever designed

Bringing down processor consumption as low as 9µA/MHz*

Up to 30% lower power than Cortex-M0

*TSMC90LP, 1.2V,

min. configuration

180ULL (7-track, typical 1.8v, 25C)

90LP (7-track, typical 1.2v, 25C)

40G (9-track, typical 0.9v, 25C)

Area Power (Dhrystone loop)

Area

Power (Dhrystone loop)

Area Power (Dhrystone loop)

Minimum Config* 0.13mm2 52µW/MHz 0.04mm2 11µW/MHz 0.01mm2 3µW/MHz

Enabling our partners to develop smaller,

smarter and energy friendly solutions for :

Pervasive embedded intelligence

The upcoming “Internet of Things”

Ultimately more electronics and a reduced

energy footprint

Page 14: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

14

Small and Powerful

Benchmarks

1.77 CoreMark/MHz

0.93 DMIPS/MHz

Lightweight DSP capable

Good fit for entry-level real-time control

Function Block size 50MHz Runtime

FIR Q15 32 (32 taps) 0.59 ms

FIR Fast Q15 32 (32 taps) 0.45 ms

Biquad Cascade Q15 32 (4 stages) 0.30 ms

Biquad Cascade Fast Q15 32 (4 stages) 0.20 ms

CFFT Radix4 Q15 64 0.24 ms

Page 15: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

15

High-Code Density

Smaller flash size needed,

leads to:

Optimized cost

Lower power consumption

Smaller chip packages in low

pin count devices (sensors,

mobile equipments, medical

applications, etc)

4.896

6.446

11.022

5.418

0

2

4

6

8

10

12

Cortex-M0+ PIC24 PIC18 RL78

CoreMark Code in kB

CSP16 (2x2mm) QFN20 (3x3mm)

Page 16: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

16

Single Cycle I/O Interface

32-bit simple bus protocol

Supports 32-/16-/8-bit

transfers

Best suited for accessing

GPIO

Peripheral registers

Memory mapped –

programmed just like normal

peripherals

Address range(s) defined by

silicon designers

Optional

Address

belongs to I / O interface

GPIO

Peripherals

( Fast Accesses )

I / O Interface

Address

outside I / O

interface

AHB

Peripherals

ROM

RAM

Address

decoder

Page 17: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

17

Faster I/O Accesses

Advantages for applications:

Faster GPIO operations, save precious cycles

Better energy efficiency in I/O intensive applications

Faster response in FSM replacement applications

Example : Controlling an LCD module with GPIO

“B” “A” “C” Data

Da

ta

Strobe

Strobe

Cortex-M0+

Clock cycles per loop

MSP430 - 12 cycles

78K - 10 cycles

8051* - 15 cycles

Cortex-M0+ - 9 cycles

Character output loop – 1 letter/iteration

* Optimized assembly code

Page 18: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

18

Memory Protection Unit (MPU)

Prevents application task

from corrupting OS and

other tasks’ data

Improves system reliability

Up to 8 configurable

regions

Address

Size

Memory attributes

Access permissions

Memory

Data for

Task C

Data for

Task A

Data for

OS kernel

Data for

Task B

I/O #2

I/O #1

I/O #0

OS kernel

(Privileged)

MPU

Task B

(unprivileged)

MPU

configuration

Page 19: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

19

Vector Table Relocation

Vector Table Offset

Register (VTOR)

Easier system level

design (no need to use

memory remapping)

Flexible vector table

configuration

Relocate vector table to

other locations in flash /

SRAM

Boot loader

Exception vector

reconfiguration at runtime

0x00000000

0xFFFFFFFF

Flash

SRAM

Vector table

Memory

System Control

Space (e.g. NVIC)

Peripherals

Page 20: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

20

Easier Silicon Integration

Highly configurable

Verilog parameters to include

features you want e.g.

Number of IRQ

Debug features

I/O interface ...

New features

Start-up delay control

(CPUWAIT)

16-bit flash support

Cortex-M System Design Kit

(CMSDK) support available

soon

Application

Processor

(e.g. Cortex-A9)

Power

Management

Subsystem

Cortex-M0+

SRAM

Control

logic

Interconnect

Memory System

control

CPUWAIT

Power

control

Page 21: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

21

Cortex-M System Design Kit (CMSDK)

Fast track your design process with CMSDK

Easy to use design kit with example system designs

Designer can simply plug-in their processor and go!

Essential AMBA® interconnects and peripherals

Software support - Keil™ examples and CMSIS drivers

Optimised for low area, low power, low latency

Page 22: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

22

Summary – Cortex-M0+

Maximizing energy efficiency

Faster I/O accesses

Low-cost, powerful debug and trace

Maintaining 100% compatibility to

enable an immediate ecosystem

Processor

SRAM

MTB

controller

RAM interface

AHB interface

Program

execution info

Application

Data +

Trace Data

MicrocontrollerDebug

connector

“B” “A” “C” Data

Strobe

Data

Stro

be

Cortex-M0+

Page 23: The Anatomy of the ARM Cortex-M0+ Processor€¦ · The Anatomy of the ARM Cortex-M0+ Processor Joseph Yiu Embedded Technology Specialist . 2 What is the Cortex-M0+ Processor?

23

Thank you