39
ARM 프로세서 입문 내용 배경과 역사 주요 특징 ARM 계열들 개발 도구

ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

ARM 프로세서 입문

내용     

     배경과 역사

     주요 특징

     ARM 계열들

     개발 도구

Page 2: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

역사, 파생 계열과 도구들

제작

EMBEDDED SYSTEMS ACADEMY

Page 3: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

내용

Part 1 배경과 역사 RISC / CISC Acorn / Advanced

RISC Machine

Part 2 주요 특징 Registers Interrupts Memory Thumb 3-단계 명령 파이프

라인 5-단계 명령 파이프

라인

Part 3 ARM 계열들 ARM7 ARM9 StrongARM ARM10

Part 4 개발 도구 Compilers, Debuggers In-Circuit Emulators

Page 4: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

ARM 자료 – Part 1

배경 자료와 역사

ARM과 관련된 특징들은 무엇이며 그것들은 모두 어떻게 시작되었는가?

Page 5: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

RISC 대 CISC

ARM: 32-bit RISC (Reduced Instruction Set Computer) 구조

RISC 구조 제한된 수의 명령어

모든 명령어들은 고정 길이 빠른 실행 가능 (single cycle per instruction) Load-Store architecture:

대부분의 명령어들은 input 또는 output이 범용 레지스터들 중의 하나임

Page 6: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

RISC 성능과 결점

RISC 구조는 쉽게 최고의 성능으로 최적화 가능 고정 길이의 명령 세트는 더욱 빠른 실행 가능 효율적인 파이프라인 가능 빠른 클럭 속도를 가능, 축소 명령 세트로 인해

칩 다이 크기 작아짐

“현실적” 결점 프로그램 코드 크기가 큼

ARM은 Thumb 모드로 해답을 제공

Page 7: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

ARM 역사와 고유 핵심 기능

ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited 사

에서 80년대 중반에 개발 원래 ARM은 Acorn RISC Machine 을 의미 이후 Advanced RISC Machine 으로 변경

설계 특징 Load-store 구조 32-bit, 고정된 길이 명령

많은 single cycle 실행 다중 사이클들이 요구되지만, 메모리 액세스가 최소화

15 범용 레지스터들 명령 파이프라인

원래는, 3-stage pipeline 5-stage pipeline 은 새로운 몇몇 파생 계열들에서 이용 가능

Page 8: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

오늘날의 ARM – www.arm.com

모든 주요 칩 제조업체들은 한 개 또는 여러 개의 ARM 코어에 대한 라이센스들을 가짐 라이센스 소유자 :

Analog Devices, Atmel, Cirrus, Fujitsu, IBM, Infineon, Intel, Mitsubishi, Motorola, National Semiconductor, NEC, Philips, Sharp, ST Microelectronics, Texas Instruments, Toshiba

임베디드 시스템에서 사용하는 가장 인기있는 ARM 코어는 ARM7TDMI TDMI

Thumb Debug support Multiplier (64-bit result) In-Circuit Emulator interface

코드 크기를 감소

Page 9: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

ARM 자료 – Part 2

ARM 구조의 주요 기능들

ARM의 가장 중요한 기술적 요소들은 무엇인가?

Page 10: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

레지스터

프로세서 레지스터 PSR – Program Status Register SP – Stack Pointer PC – Program Counter LR – Link Register

PC의 복사본 포함, 리턴 어드레스들을 결정하는데 사용

레지스터 뱅크의 이용여부는 현재의 프로세서 모드(user, supervisor, 그 외)에 달려 있음 사용자 모드에서는 최대 13개 범용 레지스터 높은 우선순위 인터럽트(FIQ)에서 범용 레지스터를 가

진 다른 뱅크가 이용 가능 PSR, SP 그리고 LR의 한 세트가 각각의 프로세서 모

드에 이용될 수 있슴

Page 11: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

레지스터

User32 Fiq32 Supervisor32 Abort32 IRQ32 Undefined32 R0 R0 R0 R0 R0 R0 R1 R1 R1 R1 R1 R1 R2 R2 R2 R2 R2 R2 R3 R3 R3 R3 R3 R3 R4 R4 R4 R4 R4 R4 R5 R5 R5 R5 R5 R5 R6 R6 R6 R6 R6 R6 R7 R7 R7 R7 R7 R7 R8 R8_fiq R8 R8 R8 R8 R9 R9_fiq R9 R9 R9 R9 R10 R10_fiq R10 R10 R10 R10 R11 R11_fiq R11 R11 R11 R11 R12 R12_fiq R12 R12 R12 R12 R13 R13_fiq R13_svc R13_abt R13_irq R13_und R14 R14_fiq R14_svc R14_abt R14_irq R14_und R15(PC) R15(PC) R15(PC) R15(PC) R15(PC) R15(PC) CPSR CPSR CPSR CPSR CPSR CPSR SPSR_fiq SPSR_svc SPSR_abt SPSR_irq SPSR_und

- R13 : Stack Pointer

- R14 : Link Register

- R15 : Program Counter

Page 12: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

인터럽트: FIQ와 IRQ

ARM 코어는 많은 인터럽트 소스들을 지원하고 구별하는 인터럽트 컨트롤러를 포함하지 않음 많은 주변 장치/인터럽트 소스들을 보유한 디바이스들

은 memory-mapped 인터럽트 컨트롤러가 필요

하드웨어 인터럽트 : FIQ와 IRQ 두 레벨들은 그들 자신의 SP 와 LR 레지스터들 그리고

원래 PSR의 복사본을 접근 FIQ – High priority (fast) hardware interrupt

모든 다른 인터럽트들을 Disables 5개 범용 레지스터들을 포함하는 한 개의 새로운 뱅크 제공

IRQ – Regular hardware interrupt

Page 13: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

소프트웨어 인터럽트 (SWI)

SWI 프로세서를 supervisor 모드로 변경 최대 256 소프트웨어 인터럽트들이 “Thumb” 파생

계열에 의해 지원 됨 Supervisor의 SP 와 LP 레지스터들의 복사본 그리고

원래 PSR을 액세스

SWI의 우선순위 < IRQ, FIQ의 우선 순위 IRQ와 FIQ는 SWI 를 인터럽트할 수 있음

소프트웨어 인터럽트에서 패러매터 전달 범용 레지스터를 통해

스택을 통해

Page 14: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

인터럽트 성능 예 : ARM7TDMI at 40Mhz

FIQ의 최악의 경우 인터럽트 대기 시간 27 프로세서 사이클 약 0.7 microseconds (700 nanoseconds)

FIQ 와 IRQ의 최상의 경우 인터럽트 대기 시간 4 프로세서 사이클 약 0.1 microseconds (100 nanoseconds)

IRQ의 최악의 경우는 보다 높은 우선순위 FIQ의 가능한 가장 긴 실행에 의존

Page 15: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

메모리 구성

ARM7에 이르는 ARM 파생 계열 code AND data 를 위한 공유된, 단일 메모리

공간 선형 32-bit 주소 영역 (4 GByte)

ARM9와 상위의 ARM 파생 계열 Harvard 모델 code AND data를 위한 개별적인 메모리 포트

들 code AND data 에 대한 동시적 액세스 제공

Page 16: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

코드 크기 줄이기 : Thumb

32-bit 명령 크기는 좋은 코드 밀도를 제공할 수 없슴

“Thumb instruction set” 16-bit 명령어 집합 실행시 32비트 명령어로 맵핑

Thumb을 지원하는 ARM 파생 계열들은 32-bit original 과 16-bit compressed 명령 세트들을 모두 실행 함 CPSR (Current Program Status Register)에서의 Bit

5 “T” 는 실행 모드를 결정 “T” 가 설정되면, 프로세서는 “Thumb” 실행 모드가 됨

Page 17: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

코드 크기 줄이기 : Thumb

Small code size ( up to 40 % compression) Simplified design

Page 18: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

3-단계 명령 파이프라인

ARM7까지 ARM 프로세서들은 3-단계 명령 파이프라인 가짐

3-단계 명령 파이프라인 Fetch

코드를 포함하는 메모리로부터 명령어를 인출합니다

Decode 명령어를 해독하고 데이터 경로를 준비합니다 다음 사이

클에 관한 신호를 제어합니다

Execute 명령어가 지정된 데이터 경로에서 실행되며 결과가 수신지로

와서 기록됩니다

Page 19: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

단일 사이클 명령 실행

하나의 명령을 완전히 처리하기 위해서는 3 사이클이 소요 됨

그러나 파이프라인이 채워진 후에 평균적으로 한 사이클 당 하나의 명령 실행

Pipeline

TimeDecode

Instruction 1

ExecuteInstruction 1

FetchInstruction 2

DecodeInstruction 2

FetchInstruction 3

FetchInstruction 1

Page 20: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

다중-사이클 명령의 실행

만약 명령을 실행하기 위해 다중 메모리 액세스들이 이루어져야 하는 경우라면, 파이프라인이 한 사이클로 인해 정지/지연 됨 예를 들면 메모리(레지스터가 아닌)에 저장된 피연산자에 대한 액세스를 요구하는 임의의 명령

주의: 분기 명령어들이 파이프라인을 비우고(flush) 다시 채우게(refill) 됩니다 분기 명령어 실행시, 파이프라인의 현재 인출

과 해독 동작들은 중단되며 분기 장소로부터의 새로운 인출이 시작 됨

Page 21: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

5-단계 명령 파이프라인

고성능 ARM 파생 계열들은 5-단계 파이프라인을 사용하여 3-단계 파이프라인의 메모리 액세스 병목을 보정

5-단계 파이프라인 Fetch: 메모리로부터의 다음 명령 인출 Decode: 명령 해독과 레지스터 피연산자 읽기 Execute: 명령 실행 Data: 필요한 경우, 데이터 메모리 액세스 Write-back: 수신지 메모리 장소에 명령 결과

를 기록

Page 22: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

Part 2의 요약 - ARM 구조

프로세서 레지스터들이 bank 됨 각각의 프로세서 모드(user, FIQ, IRQ, supervisor, 등

)는 자신의 고유한 프로세서 레지스터의 뱅크를 가짐 범용 레지스터(GPR)들이 공유되며, 오직 “FIQ”만이 5 전용 GPR의 뱅크에 접근

ARM7TDMI 보다 작은 코드 크기를 허용하도록 “Thumb” 명령 세

트(16-bit “compressed”)를 사용 “van Neuman” 선형 주소 영역, 4Gbyte 를 사용 3-단계 명령 파이프라인을 사용

Fetch, Decode, Execute 파이프라인은 (데이터)메모리 액세스들로 정지/지연 됨 파이프라인은 각각의 분기와 함께 비워(flush)짐

Page 23: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

ARM 자료 – Part 3

ARM 계열

ARM 계열에는 어떠한 것들이 있으며

중요한 차이점들은 무엇인가?

Page 24: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

ARM 계열: ARM7

ARM6을 대체

3-단계 명령 파이프라인

저전압 지원 (몇몇 계열들 1V 미만)

선형 32-bit 주소 영역(4 GByte)을 갖는 Van Neumann 메모리 설계 8-bit 와 16-bit 데이터 유형들 지원

32-bit 데이터 버스

Little- 과 big- endian 지원

Page 25: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

ARM 계열: ARM9

ARM8을 대체

대략 ARM7 성능의 두 배

두 개의 32-bit 선형 주소 영역을 갖는 Harvard 메모리 설계, 코드용 한 개와 데이터용 한 개 code AND data 가 병렬로 액세스 될 수 있기 때문에, 전체적인 메모리 액세스를 향상

이중-대역폭 메모리 액세스 사이클 마다 두 개의 메모리 액세스를 수행

5-단계 명령 파이프라인

축소된 CPI (Clocks Per Instruction) 명령과 데이터를 위한 별개의 메모리 포트들

Page 26: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

StrongARM (SA-110과 SA-1100/1110 )

StrongARM Harvard architecture

Separate instruction and data port

5 Stage pipeline same as ARM9 First developed by DEC, now Intel 향상된 multiplier Set- associative data and instruction cache MMU – Memory Management Unit Thumb 지원 안 함 인터럽트 컨트롤러를 포함하는 많은 on-chip 주변 장

치들

Page 27: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

ARM10

대략 ARM9 성능의 두 배

ARM9 와 같은 메모리 설계, 그러나 Cache: code AND data를 위한 각각의

32kByte 64-bit 데이터 메모리 액세스 지원

특히 최적화된 6-단계 명령 파이프라인

분기-예측 작동체계 포함

Page 28: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

ARM 자료 – Part 4

개발 도구

Page 29: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

ARM 개발 도구

디버그 인터페이스가 코어 안에 통합 인-서킷 디버그 기능 저렴한 가격에 고급 ICE (In-Circuit Emulator)

가능

Page 31: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

추천 In-Circuit Emulator

ARM Multi-ICE

Nohau EMUL-ARM-PC

Page 32: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

Operating System Support

ARM Software Development ARM software development tookit

armcc, armasm, armlink

ARMulator Cycle accurate simulator MMU, coprocessor Profiler

Boot-up code On reset , processor starts at address 0x0

ARM procedure call standard Can inter-work assembly routine with C/C++ program

Page 33: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

Jazelle – ARM Extension for Java

InstructionInstructionFetchFetch

RegisterRegisterWriteWrite

Sum/Accumulate Sum/Accumulate & Saturation & Saturation

Memory Access Memory Access

ComputeComputePartial Products Partial Products

Shift + ALU Shift + ALU

Thumb DecodeThumb Decode

ARM DecodeARM Decode

RegisterRegisterDecodeDecode

RegisterRegisterDecodeDecode

RegisterRegisterReadRead

RegisterRegisterReadRead

Jazelle logic turned ONJazelle logic turned ON

FETCHFETCH DECODEDECODE EXECUTEEXECUTE MEMORYMEMORY WRITEBACKWRITEBACK

Java DecodeJava DecodeStackStack

ManagementManagement

Java DecodeJava DecodeRegisterRegister

ReadRead

ALUALUControlControlSignalsSignals

BytecodeBytecodeInstructionInstructionStreamStream

InstructionInstructionFetchFetch

RegisterRegisterWriteWrite

RegisterRegisterWriteWrite

Sum/Accumulate Sum/Accumulate & Saturation & Saturation

Memory Access Memory Access

Sum/Accumulate Sum/Accumulate & Saturation & Saturation

Memory Access Memory Access

ComputeComputePartial Products Partial Products

Shift + ALU Shift + ALU

ComputeComputePartial Products Partial Products

Shift + ALU Shift + ALU

Thumb DecodeThumb Decode

ARM DecodeARM Decode

RegisterRegisterDecodeDecode

RegisterRegisterDecodeDecode

RegisterRegisterReadRead

RegisterRegisterReadRead

Jazelle logic turned ONJazelle logic turned ON

FETCHFETCH DECODEDECODE EXECUTEEXECUTE MEMORYMEMORY WRITEBACKWRITEBACK

Java DecodeJava DecodeStackStack

ManagementManagement

Java DecodeJava DecodeRegisterRegister

ReadRead

ALUALUControlControlSignalsSignals

BytecodeBytecodeInstructionInstructionStreamStream

ARM extension Jazelle™ : ARM’s Java extension (symbol as a ‘J’) Instruction extension (Java state), not a

coprocessor Implemented in the ARM Pipeline as a FSMImplemented in the ARM Pipeline as a FSM Dynamic re-mapping of Stack to RegistersDynamic re-mapping of Stack to Registers

Page 34: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

Jazelle – ARM Extension for Java

Java State ARM/THUMB mode + Java mode

New ARM Instruction

Add J bit to CPSR

Page 35: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

Jazelle – ARM Extension for Java

Register Re-use and Stack Optimization

Page 36: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

Jazelle – ARM Extension for Java

Hardware/Software Balance for Optimum Cost & Performance Majority of Java byte code (140) are executed

directly by hardware 12k gates are required

The remainder (94) are emulated by ARM instructions.

Page 37: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

Jazelle – ARM Extension for Java

Interrupt Behavior and Real-time performance

Page 38: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

Jazelle – ARM Extension for Java

Performance

Page 39: ARM 프로세서 입문cfs3.tistory.com/upload_control/download.blog?f...ARM 역사와 고유 핵심 기능 ARM 프로세서 영국, 캠브리지에 있는 Acorn Computers Limited

Jazelle – ARM Extension for Java

Java Run-time Environments