|
5. ARM Processor
4Àå±îÁö´Â Çб³´Ù´Ò¶§ Çѹø¾¿Àº µé¾î “RÀ½Á÷ÇÑ ³»¿ëÀ¸·Î ´Ù¼Ò Áö·çÇÑ ³»¿ëÀ̾ú´ø °°½À´Ï´Ù. ÀÌÁ¦ 5ÀåºÎÅÍ º»°ÝÀûÀ¸·Î ARM ¿¡ ´ëÇؼ °øºÎÇØ º¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.
ARM(¿µ±¹È¸»ç) »ç´Â architecture core ¹× system core ¸¦ License ÇØÁÖ´Â IP ȸ»ç ÀÔ´Ï´Ù.
Á÷Á¢ ¹ÝµµÃ¼¸¦ Á¦Á¶ÇÏ¿© ÆǸÅÇÏ´Â °ÍÀÌ ¾Æ´Ï¶ó ¼³°èÇÑ ÇÁ·Î¼¼¼¸¦ ¹ÝµµÃ¼ ȸ»ç¿¡ Hard Macrocell(¼öÁ¤ºÒ°¡) ¶Ç´Â Synthesizable core(ÀϺΠ¼öÁ¤ °¡´É) ·Î Á¦°ø ÇÕ´Ï´Ù.
¹ÝµµÃ¼ Á¦Á¶È¸»ç¿¡¼´Â ARM»ç·Î ºÎÅÍ Á¦°ø¹ÞÀº ARM core¿Í ÁÖº¯ ÀåÄ¡¸¦ Ãß°¡ÇÏ¿© SOC¸¦ ¸¸µé¾î »ç¿ëÀÚ¿¡°Ô ÆǸÅÇϰųª ÀÚü Á¦Ç°¿¡ »ç¿ë ÇÕ´Ï´Ù.
Âü°í·Î ¾Æ·¡ ³»¿ëµéÀº ÃÖ±Ù ARM»çÀÇ ¿¬Çõ ÀÔ´Ï´Ù. Cortex-M3(2004³â), M0(2009³â), M4(2010³â), µîÀ» ¹ßÇ¥ÇÑ ³âµµ µîÀ» ¾Ë¼ö°¡ Àֳ׿ä.
2012
2011
2010
- Giesecke & Devrient secure mobile payments announcement via ARM TrustZone and G&D's Mobicore technologies
- ARM launches Cortex-M4 processor for high performance digital signal control
- ARM together with key Partners form Linaro to speed rollout of Linux based devices
- Microsoft becomes ARM Architecture Licensee
- ARM & TSMC sign long-term agreement to achieve optimized Systems-on-Chip based on ARM processors, extending down to 20nm
- ARM extends performance range of processor offering with the Cortex-A15 MPCore processor
- ARM Mali becomes the most widely licensed embedded GPU architecture
- ARM Mali-T604 Graphics Processing Unit introduced providing industry-leading graphics performance with an energy-efficient profile
- ARM announces Corelink 400 series of AMBA 4 protocol-compliant system IP
2009
- ARM announces 2GHz capable Cortex-A9 dual core processor implementation
- ARM invests in Japanese software vendor eSOL to develop enhanced platforms for next-generation automotive electronics
- ARM launches its smallest, lowest power, most energy efficient processor, Cortex-M0
- ARM Ltd. receives Best Companies accreditation
- ARM extends its leadership in media processing by acquiring Logipard AB
2008
- ARM announces 10 billionth processor shipment
- ARM wins Britain's Top Employer Award 2008 from crf.com
- ARM announces Industry First silicon-on-Insulator Physical IP for IBM's 45nm SOI Foundry
- ARM Mali-200 GPU Worlds First to achieve Khronos Open GL ES 2.0 conformance at 1080p HDTV resolution
2007
- Five billionth ARM Powered processor shipped to the mobile device market
- ARM Cortex-M1 processor launched – the first ARM processor designed specifically for implementation on FPGAs
- AMBA Adaptive Verification IP launched
- RealView Profiler for Embedded Software Analysis introduced
- ARM unveils Cortex-A9 processors for scalable performance and low-power designs
- ARM Introduces SecurCore SC300 Processor For Smart Card Applications
- Warren East, CEO, wins Orange Business Leader of the Year Award
2006
- IEEE honors ARM with its 2006 Corporate Innovation Recognition award.
- ARM Cortex-A8 processor recognized as "Best In 2005" by four leading electronics industry publications
2005
- ARM listed by Electronic Business as one of the ten most significant companies in electronics over the past 30 years
- ARM acquired Keil Software
- ARM Cortex-A8 processor announced
- ARM launched DesignStart Program
2004
- ARM acquired Artisan Components Inc.
- The ARM Cortex family of processors, based on the ARMv7 architecture, is announced. The ARM Cortex-M3 is announced in conjunction, as the first of the new family of processors
- ARM Cortex-M3 processor announced, the first of a new Cortex family of processor cores
- NEON media acceleration technology announced
- ARM technology licensed to Aplix, Atheros, Broadcom, CSR, Kawasaki, NEC, Socle, Sony Ericsson, Thomson, Toshiba, Samsung and ZRRT
- ARM acquired Axys Design Automation
- MPCore multiprocessor launched, the first integrated multiprocessor
- OptimoDE technology launched, the groundbreaking embedded signal processing core
5.1 ARM ÇÁ·Î¼¼¼ÀÇ Á¾·ù
ARM Processor¿¡ ´ëÇؼ ³ª¸§´ë·Î Á¤¸®¸¦ Çغ» °ÍÀÔ´Ï´Ù. ÀÌ Ç¥¿Í ´Ù¸£°Ô ºÐ·ù¸¦ ÇÏ´Â »ç¶÷µéµµ ÀÖ½À´Ï´Ù. ÀÌ°ÍÀº Á¦ °³ÀÎÀûÀÎ ÆÇ´Ü¿¡ ÀÇÇÑ ºÐ·ù ÀÔ´Ï´Ù.
Cortex ÇÁ·Î¼¼¼ ÀÌÀüÀÇ ARM ProcessorsµéÀ» ÀüÅëÀûÀÎ ARMÀ¸·Î ºÐ·ù ÇÏ¿´°í Cortex-M, R ½Ã¸®Áî ±îÁö´Â ±âÁ¸ÀÇ uCOM½ÃÀåÀÇ ÇÁ·Î¼¼¼µéÀ» °Ü³ÉÇÑ Àú°¡ÀÌ¸é¼ Realtime ÇÁ·Î¼¼¼ ½ÃÀåÀ» °Ü³ÉÇÑ ÇÁ·Î¼¼¼ ÀÌ°í, A ÇÁ·ÎÆÄÀÏ ºÎÅÍ´Â °í¼º´ÉÀÇ ApplicationÀ» ±¸ÇöÇÏ´Â ÇÁ·Î¼¼¼·Î ºÐ·ù ÇÏ¿´½À´Ï´Ù.
5.1.1 ARM7 Processor
(1) ARM7TDMI Core
- RISC Architecture (ARM v4T)
- 3 stage pipelining
- Hard macrocell
- 32-bit ARM/16-bit Thumb Instructions
- Unified bus architecture( Æù³ëÀ̸¸ ¹ö½º ±¸Á¶)
- ARM720T = ARM7TDMI + MMU + Cache(8KB Unified) + WB + AMBA
- S3C44B0 µî
(2) ARM7TDMI Block Diagram
5.1.2 ARM9 Processor
(1) ARM9TDMI Core
- RISC Architecture (ARM v4T)
- 5 stage pipelining ->
Improved clock frequency
- Harvard Bus Architecture
- Simultaneous access to instruction and data memory
- Hard macrocell
- 32-bit ARM/16-bit Thumb Instructions
- ARM920T = ARM9TDMI + Dual Caches + MMUs + WB + AMBA + PA TAG RAM
- S3C2440, S3C2443 µî
¾ÕÀÇ ARM7°ú ´Þ¸® ¸í·É¾î ¹ö½º¿Í µ¥ÀÌÅÍ ¹ö½º°¡ ±¸ºÐÀÌ µÇ¾î Àִ°ÍÀ» ¾Ë¼ö ÀÖ½À´Ï´Ù. ¿©±â¼ ¾à°£ »ý¼ÒÇÑ ¿ë¾î°¡ º¸À̴µ¥¿ä, Write back PA TAG RAM ÀÌ ¹»±î¿ä ?
ÀÌ ¿ë¾î¸¦ ¼³¸íÇϱâ À§Çؼ´Â ¸ÕÀú ij½Ã ¸Þ¸ð¸®ÀÇ 2°¡Áö µ¿ÀÛ ¹æ½ÄÀ» ¾Ë¾Æ¾ß ÇÕ´Ï´Ù. Cache¸Þ¸ð¸®ÀÇ ³»¿ëÀ» Áָ޸𸮿¡ WriteÇÒ¶§, Write-through ¹æ½Ä°ú Write-back ¹æ½ÄÀÌ ÀÖ½À´Ï´Ù. Write-through¹æ½ÄÀº ij½Ã ¸Þ¸ð¸®ÀÇ ³»¿ëÀÌ ¾÷µ¥ÀÌÆ® µÉ¶§ ÁÖ ¸Þ¸ð¸®¿¡µµ µ¿½Ã¿¡ ¾÷µ¥ÀÌÆ®°¡ µÇ´Â ¹æ½ÄÀÌ°í Write-back ¹æ½ÄÀº ij½Ã¸Þ¸ð¸®ÀÇ ³»¿ëÀÌ ¾÷µ¥ÀÌÆ® µÇ¾îµµ ¹Ù·Î ÁÖ ¸Þ¸ð¸®¿¡ ¹Ý¿µÀÌ µÇ´Â °ÍÀÌ ¾Æ´Ï¶ó Write back PA TAG RAM ¿¡¼ Àá½Ã ÀúÀåÇØ µÎ¾ú´Ù°¡ ºí·Ï ´ÜÀ§·Î CPU°¡ ½¬°í ÀÖ´Â µ¿¾È¿¡ ÁÖ ¸Þ¸ð¸®¿¡ ¾÷µ¥ÀÌÆ® ÇÏ´Â ¹æ½Ä ÀÔ´Ï´Ù. Write Buffer´Â Write-throuh ¹æ½ÄÀÏ °æ¿ì¿¡ Data CacheÀÇ ³»¿ëÀ» ÁÖ ¸Þ¸ð¸®¿¡ Write Çϱâ Àü¿¡ Buffer ¿ªÇÒÀ» ÇØÁÖ°í, Write back PA TAG RAMÀº Write-back ¹æ½ÄÀ» °æ¿ì¿¡ Data CacheÀÇ ³»¿ëÀ» Àá½Ã º¸°üÇÏ°í ÀÖ´Ù°¡ ÁÖ ¸Þ¸ð¸®¿¡ Write¸¦ ÇØÁÖ´Â ¿ªÇÒÀ» ÇÕ´Ï´Ù.
5.1.3 ARM11 Processor
(1) ARM1176JZ(F)-S Core
- ARM v6 Architecture
- Improved Multimedia Performance
2x faster MPEG4 encode/decode
SIMD(Single Instruction, Multiple Data) Instructions : ´ÜÀÏ ¸í·ÉÀ¸·Î ´ÙÁß µ¥ÀÌÅ͸¦ ó¸®ÇÏ´Â °ÍÀ» ¸»ÇÕ´Ï´Ù.
- Improved Real-Time Performance
Fast Exception/Interrupt Handling
Vector Interrupt Controller -> Reduced Interrupt Latency
New Stack and Processor Mode Change Instructions
- Improved Memory Interface
Un-aligned Data Access
Mixed-Endian
8 stages pipeline
Higher clock frequency
9 stages pipeline for ARM1152T2(F)-S
Separate load-store and arithmetic pipelines
Branch prediction (static & dynamic)
Return Stack
- Other features
High Performance Integer Processor
Physically-tagged caches
Jazelle technology
VFP (Vector Floating Point)
Non Blocking
HUM (Hit Under Miss)
ARM TrustZone Technology
Thumb-2 Instruction
Intelligent Energy Manger (IEM) Technology
- S3C6400, S3C6410 ..
5.1.4 ARM Cortex Families
(1) A profile (ARMv7-A) : Application Profile
- For sophisticated, high-end applications running open and complex operating systems
- ARM, Thumb, Thumb-2 instruction sets
- S5PC100, S5PV210, OMAP3530 ..
(2)
R profile (ARMv7-R) :
Real-time Profile
- For real-time system
- ARM, Thumb, Thumb-2 instruction sets
(3) M profile (ARMv7-M) :
Microcontroller Profile
- For cost-sensitive and microcontroller applications
- Thumb-2 instruction set only
- STM32F ½Ã¸®Áî
°ø±³·Ó°Ôµµ »õ·Î ¹ßÇ¥µÈ Cortex Æйи®ÀÇ ProfileÀÇ Ã¹¹ø° À̸§ÀÌ A.R.M À¸·Î ȸ»ç À̸§°ú µ¿ÀÏ Çϳ׿ä. ¿ì¿¬ÀÇ ÀÏÄ¡ Àΰ¡¿ä? ^^
5.2 ARM Processor ¼±ÅÃ
- Embedded real-time Processor
Embedded real-time systems for storage, automotive body and powertrain,
industrial and networking applications
- Application Processor
Devices running open operating systems including Linux, Palm OS,
Symbian OS and Windows CE in wireless, consumer entertainment and
digital imaging applications
- Secure Processor
Smart cards, SIM cards and payment terminals
À§¿Í °°ÀÌ Àü¹®ÀûÀ¸·Î ºÐ·ù ÇÒ ¼öµµ ÀÖ°ÔÁö¸¸ °á±¹ Çö¾÷¿¡¼ÀÇ ÇÁ·Î¼¼¼ ¼±ÅÃÀÇ °¡Àå Å« ±âÁØÀº °¡°Ý´ëºñ ¼º´ÉÀÏ °ÍÀÔ´Ï´Ù. ½ÇÁ¦ ±¸ÇöÇÏ·Á°í ÇÏ´Â ÇÁ·ÎÁ§Æ®¸¦ ±¸Çö ÇÒ ¼ö ÀÖ´Â °¡Àå ³·Àº CostÀÇ ÇÁ·Î¼¼¼¸¦ ¼±Åà ÇÒ °ÍÀ̱⠶§¹® ÀÔ´Ï´Ù. ÇöÀå ¿¡¼´Â Money, Money Çصµ ½Ñ°Ô ÃÖ°íÁÒ. ¿©±â¼ ¶Ç ÇÑ°¡Áö S/W °³¹ßÀÚÀÇ ÀÔÀå¿¡¼ »ý°¢ÇØ º¸¸é °³¹ßÀÇ ³À̵µÀÏ °ÍÀÔ´Ï´Ù. ÀüÅëÀûÀÎ ARM¿¡ ÇØ´çÇÏ´Â ARM7, ARM9, ARM11 ÇÁ·Î¼¼¼µéÀº RAM, ROMÀ» CPU¿ÜºÎ¿¡ À§Ä¡ ½Ãŵ´Ï´Ù. ÀÌ·¯ÇÑ ÀÌÀ¯(CPU, Á¦Ç°¸¶´Ù ÁÖ¼Ò¿Í ÃʱâÈ ÄÚµåµîÀÌ Æ²·ÁÁü)¶§¹®¿¡ ÄÚµåÀÇ È£È¯¼º( »ç¿ëÇÏ´Â ¸Þ¸ð¸® ¹ðÅ©¿Í ¸Þ¸ð¸®ÀÇ ¿ë·®, Á¾·ù¿¡ µû¶ó¼ ¼Ò½º ·¹º§ÀÇ Äڵ尡 ´Þ¶óÁü)ÀÌ ¸Å¿ì ¶³¾îÁö°í ºÎÆ®·Î´õ µîÀ» Á÷Á¢ ÀÛ¼º ÇØ¾ß ÇÕ´Ï´Ù. ÀÌ¿¡ ¹ÝÇؼ Cortex-M, R ÇÁ·ÎÆÄÀÏÀÇ ÄÚ¾îµéÀº CPU³»ºÎ¿¡ RAM, ROMÀ» °¡Áö°í ÀÖ°í Address ¶ÇÇÑ °°Àº Äھ »ç¿ëÇÏ´Â CPUµéÀº ¸ðµÎ µ¿ÀÏ ÇÏ°Ô »ç¿ëµË´Ï´Ù. ±×·¡¼ ÄÄÆÄÀÏ·¯(°³¹ß IDE) ¼öÁØ¿¡¼ ºÎÆ®·Î´õ¸¦ Á¦°ø ÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ½ÇÁ¦·Î ´ëºÎºÐÀÇ »ó¿ë ÄÄÆÄÀÏ·¯ µéÀº °³¹ßÀÚ°¡ ºÎÆ®·Î´õ Äڵ带 ÀÛ¼ºÇÏÁö ¾Ê¾Æµµ ±âº»À¸·Î Á¦°øÇÏ°í ÀÖ½À´Ï´Ù.
6. ARM Architecture
6.1 ARM based system
À§ÀÇ ºí·°µµ´Â ARM Core¿¡ ´ëÇÑ ºí·°µµ´Â ¾Æ´Ï°í ºÓÀº»ö ºÎºÐÀÇ ARM Core¸¦ ÀÌ¿ëÇؼ ±¸ÇöÇÑ CPUÀÇ ÇÑ ¿¹ ÀÔ´Ï´Ù.
6.2 ARM Operating Modes
(1) 7°³ÀÇ Processor Mode°¡ Á¸Àç
User, FIQ, IRQ, Supervisor, Abort Mode, Undefined, System Mode
(2) Operating Mode º¯°æÀº Hardware ¹× Software·Î °¡´É ÇÕ´Ï´Ù.
ARM ÇÁ·Î¼¼¼¿¡ Àü¿øÀÌ Àΰ¡ µÇ¸é SVC ¸ðµå¿¡¼ ½ÃÀÛÀÌ µÇ°í ÀÎÅÍ·´Æ®, ÀͼÁ¼Ç µîÀÌ ¹ß»ýÇÏ¸é »óȲ¿¡ ¸ÂÃß¾î¼ H/W ÀûÀ¸·Î Operating Mode °¡ º¯°æÀÌ µÇ°Å³ª S/W ÀûÀ¸·Î´Â SWI ¸í·É¾î¿¡ ÀÇÇؼ SVC ¸ðµå·Î ÁøÀÔ ÇÒ ¼öµµ ÀÖ½À´Ï´Ù.
ARM Core¿¡´Â ¿Ö ÀÌ·¸°Ô ¿©·¯°¡Áö µ¿ÀÛ ¸ðµå°¡ Á¸ÀçÇÏ´Â °ÍÀϱî¿ä? ¾Æ¸¶µµ ¾ÆÅ°ÅØÃÄ Â÷¿ø¿¡¼ ¼ÒÇÁÆ®¿þ¾îÀÇ º¸¾È¹× µ¿ÀÛÀ» Áö¿ø Çϱâ À§ÇؼÀÏ °ÍÀÔ´Ï´Ù. °¡·É OS ¼³°è½Ã Ä¿³Î S/W ´Â ¸ðµç ±ÇÇÑÀ» °¡Áö°í ¼öÇà Çϵµ·Ï ÇÏ°í, User ¾îÇø®ÄÉÀ̼ÇÀº Á¦ÇÑµÈ ±ÇÇÑÀ» °¡Áö°í ¼öÇàÀ» Çϵµ·Ï ¼³°è ÇÑ´Ù¸é ¾îÇø®ÄÉÀÌ¼Ç ÇÁ·Î¼¼¼´Â ¸ðµç ±ÇÇÑÀÌ ¾ø´Â User Mode ¿¡¼ µ¿ÀÛ ½ÃÅ°°í ³ª¸ÓÁö Ä¿³Î¹× µð¹ÙÀ̽º µå¶óÀ̹öµéÀº ±ÇÇÑÀÌ ÀÖ´Â ³ª¸ÓÁö ¸ðµå(Supervisor, System Mode)¿¡¼ ½ÇÇà ½ÃÅ°µµ·Ï ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¹°·Ð ÀÌ·¯ÇÑ ±â´ÉÀº S/W ÀûÀ¸·Îµµ ±¸ÇöÀÌ ºÒ°¡´ÉÇÑ °ÍÀº ¾Æ´ÏÁö¸¸ ±¸ÇöÀ» À§Çؼ´Â ´õ ¸¹Àº ³ë·ÂÀÌ ÇÊ¿äÇÒ °ÍÀÔ´Ï´Ù.
Mode |
Description |
Supervisor(SVC) |
Entered on reset and when a Software Interrupt
instruction (SWI) is executed |
Privileged
modes |
FIQ |
when a fast(urgent) interrupt occurred |
IRQ |
when a normal interrupt occurred |
Abort(ABT) |
when a data fetch or instruction prefetch aborts |
Undef(UND) |
when an undefined instructions is executed |
System(SYS) |
Privileged mode using the same registers as User mode |
User(USER) |
Mode under which most Applications / OS tasks run |
Unprivileged
mode |
- CPSR Register¸¦ Privilege Mode ¿¡¼ S/W ·Î º¯°æ °¡´É, User Mode¿¡¼ º¯°æÇϸé Undefined Instruction Exception ÀÌ ¹ß»ý ÇÕ´Ï´Ù.
- ARM Core¿¡ Àü¿øÀÌ Àΰ¡µÇ¸é ÃÖÃÊ¿¡´Â Supervisor ¸ðµå·Î µ¿ÀÛÀ» ÇÕ´Ï´Ù. óÀ½¿¡ ±ÇÇÑÀÌ ¾ø´Â ¸ðµå·Î ½ÃÀÛÀ» Çϸé Privilege Mode·Î Àüȯ ÇÒ ¹æ¹ýÀÌ ¾ø°ÚÁÒ.
- °¢ ¸ðµå´Â º°°³ÀÇ Stack¿µ¿ª°ú Banked Register ¿µ¿ªÀ» °¡Áö°í ÀÖ½À´Ï´Ù.
À§¿¡¼ ¿©·¯°¡Áö ¸ðµå°¡ ¸¹ÀÌ ÀÖÁö¸¸ ¾ðÁ¦ ¾î¶² ¸ðµå¸¦ ¹Ýµå½Ã ½á¾ß¸¸ ÇÏ´Â ±ÔÄ¢ÀÌ ÀÖ´Â °ÍÀº ¾Æ´Ï°í, ÀÏ¹Ý ÀûÀÎ ±Ç°í »çÇ×ÀÏ »ÓÀÔ´Ï´Ù. ´ëºÎºÐ OS¸¦ ¿î¿µÇÏÁö ¾Ê´Â ´Ü¼øÇÑ Æß¿þ¾î ·¹º§ÀÇ ÄÚµåµéÀº Ãʱ⠺ÎÆýà ¼³Á¤µÈ Supervisor ¸¸ »ç¿ëÇÏ´Â °æ¿ìµµ ¸¹ÀÌ ÀÖ½À´Ï´Ù. À§ÀÇ Ç¥¸¦ º¸¸é mode´Â Å©°Ô Privileged
modes¿Í Unprivileged
mode ·Î ³ª´ ¼ö ÀÖ½À´Ï´Ù. 2°¡Áö mode ±¸ºÐÀÇ Â÷ÀÌ´Â
(1) Privileged Mode (Ư±Ç ¸ðµå)´Â IRQ³ª FIQµîÀÇ InterruptÀÇ »ç¿ë °¡´É À¯¹«¸¦ Á÷Á¢ ¼³Á¤ ÇÒ ¼ö ÀÖ½À´Ï´Ù.
(2) Privileged Mode´Â
ÀÚ±âµé³¢¸® ¼·Î Mode º¯°æÀÌ ÀÚÀ¯ÀÚÀç·Î °¡´É ÇÕ´Ï´Ù¸¸, Normal Mode´Â Àڱ⠽º½º·Î Privileged Mode·Î ModeÀÇ º¯°æÀÌ ºÒ°¡´É ÇÕ´Ï´Ù.
±×°ÍÀº ¿¹¸¦ µé¾î, SYS ↔ FIQ, IRQ ↔ SVC°ú °°ÀÌ Privileged Mode → Normal Mode (USR)Àº °¡´ÉÇÏÁö¸¸, USR → Privileged Mode·ÎÀÇ º¯°æÀº ºÒ°¡´É ÇÕ´Ï´Ù. ¾ÆÁÖ Áß¿äÇÑ »ç½ÇÀÔ´Ï´Ù. ±â¾ïÇØ ÁÖ¼¼¿ä.
°á±¹ Privileged Mode´Â ÀÚ±âµé ¸Ú´ë·Î Mode¿¡ °üÇÑ ÇÑ ÀÚÀ¯·Ó°Ô ¿Ô´Ù °¬´Ù ÇÒ ¼ö ÀÖÁö¸¸, USER Mode´Â °¡´ÉÇÏÁö ¾Ê½À´Ï´Ù.
FIQ, IRQ, Abort, Undef ¸ðµå´Â ÀÌÈÄÀÇ Àå¿¡¼ Á»´õ ÀÚ¼¼È÷ ¼³¸í Çϵµ·Ï ÇÏ°í System mode, User mode, Supervisor (SVC) mode ¿¡ ´ëÇؼ ¸ÕÀú ¼³¸í Çϵµ·Ï ÇÏ°Ú½À´Ï´Ù.
User Mode´Â Application ProgramÀ» Execution ÇÏ´Â ModeÀÌ°í, System Mode´Â Privileged Operating system task°¡ ½ÇÇàµÇ´Â modeÀÌ°í, Supervisor mode´Â º¸È£µÈ Operating system(Ä¿³Îµî) ¿¡¼ ÁÖ·Î »ç¿ëµÇ´Â mode ÀÔ´Ï´Ù.
6.3 ARM Registers
6.3.1 Normal Registers
¾Õ ½Ã°£¿¡ ·¹Áö½ºÅÍ´Â Àӽ÷Πµ¥ÀÌÅ͸¦ º¸°üÇÏ°í, ¿¬»ê¿¡ »ç¿ëµÇ°í, ÇÁ·Î±×·¥ Á¦¾î¿¡ »ç¿ëµÇ´Â Á¢±Ù¼Óµµ°¡ °¡Àåºü¸¥ Àӽà ±â¾ïÀåÄ¡ ¶ó°í ¼³¸íÀ» ÇÏ¿´½À´Ï´Ù.
ARM Core¸¦ Àß ÀÌÇØÇϱâ À§Çؼ´Â ARM Core¿¡ ³»ÀåµÇ¾î ÀÖ´Â ±âº» RegisterµéÀÌ ¾î¶»°Ô ±¸¼ºµÇ¾î ÀÖ°í, »ç¿ëµÇ´ÂÁö¸¦ Àß ¾Ë¾Æ¾ß ÇÕ´Ï´Ù. RegisterµéÀº Core°¡ »ç¿ëÇÒ ¼ö ÀÖ´Â ÀúÀå ¸Åü Áß¿¡¼ °¡Àå ºü¸¥ ¼Óµµ¸¦ ÀÚ¶ûÇϸç, ARMÀÇ µ¿ÀÛÀº ¸ðµÎ RegisterµéÀ» ¾î¶»°Ô »ç¿ëÇϴ³Ŀ¡ µû¶ó¼ µ¿ÀÛÀ» Á¦¾î ÇÒ ¼ö ÀÖ½À´Ï´Ù. °á±¹ ARM ÇÁ·Î¼¼¼¸¦ »ç¿ë ÇÑ´Ù´Â °ÍÀº ¾Æ·¡ RegisterµéÀ» °¡Áö°í ¿¬»êÀ» Çϸç ÁÖ ¸Þ¸ð¸®¿Í ¸Þ¸ð¸® ¸ÅÇÎµÈ ÁÖº¯ ÀåÄ¡µéÀ» Á¦¾îÇϱâ À§Çؼ Load, Store ÇÏ´Â °ÍÀÔ´Ï´Ù.
À§ÀÇ ·¹Áö½ºÅÍ ±×¸²À» º¸¸é ARM µ¿ÀÛ¸ðµåº°·Î ±¸ºÐÀÌ µÇ¾î ÀÖ°í, µ¿ÀÛ ¸ðµå¿¡ µû¶ó¼ ÆĶõ»ö ¹Ú½º·Î Çѹø ´õ ±¸ºÐÀÌ µÇ¾î Àִ°ÍÀ» º¼ ¼ö ÀÖ½À´Ï´Ù. ÆĶõ»ö ¹Ú½º·Î µÇ¾î ÀÖ´Â ·¹Áö½ºÅ͵éÀ» ¹ðÅ©µå ·¹Áö½ºÅͶó°í ÇÕ´Ï´Ù. ±×·¯´Ï±î Èù»ö¹Ú½ºÀÇ ·¹Áö½ºÅÍ´Â µ¿ÀÛ ¸ðµå¿¡ »ó°ü ¾øÀÌ °øÅëÀ¸·Î »ç¿ëµÇ¾îÁö°í ÆĶõ»ö ¹Ú½ºÀÇ ¹ðÅ©µåµÈ ·¹Áö½ºÅÍ´Â µ¿ÀÛ ¸ðµåº°·Î µ¶¸³ÀûÀ¸·Î »ç¿ë °¡´ÉÇÏ´Ù´Â °ÍÀÔ´Ï´Ù. ¸»·Î¸¸ Çؼ´Â Àß ÀÌÇØ°¡ µÇÁö ¾ÊÁö¿ä.
ÇÑ°¡Áö ¿¹¸¦ µé¾î¼ ¼³¸íÀ» Çϵµ·Ï ÇÏ°Ú½À´Ï´Ù. CPU¿¡ ÃÖÃÊ Àü¿øÀÌ Àΰ¡µÇ¾î SVC ¸ðµå·Î µ¿ÀÛÀ» ÇÏ´Ù°¡ FIQÀÎÅÍ·´Æ®°¡ ¹ß»ý ÇÏ¿´À» °æ¿ì ·¹Áö½ºÅÍ »óÅ´ ¾Æ·¡¿Í °°½À´Ï´Ù.
FIQ·Î ÀüȯÀÌ µÇ¸é R8 ~ R14±îÁö´Â FIQÀü¿ë ·¹Áö½ºÅÍ°¡ »ç¿ëÀÌ µË´Ï´Ù. À̸»Àº FIQ¸ðµå¿¡¼ R8 ~ R14´Â SVC¸ðµå¿¡¼ÀÇ R8 ~ R14¿Í´Â ´Ù¸¥ ·¹Áö½ºÅÍ ÀÔ´Ï´Ù. Áï SVC¸ðµå¿¡¼ FIQ°¡ ¹ß»ýÀÌ µÇ¾úÀ»¶§ ¹®¸Æ(Context) º¸Á¸À» À§Çؼ R8 ~ R14´Â ÀúÀåÀ» ÇÏÁö ¾Ê¾Æµµ FIQ¸ðµå¿¡¼ R8 ~ R14´Â ¸¶À½´ë·Î »ç¿ëÇصµ µË´Ï´Ù. CPSR·¹Áö½ºÅ͵µ FIQ, SVC ¸ðµå¿¡¼ °¢°¢ Á¸Àç ÇÕ´Ï´Ù.
¿©±â¼ ¹®¸Æ(Context)À̶ó´Â ¿ë¾î°¡ ³ª¿À´Âµ¥, ¹®¸ÆÀ̶ó´Â Àǹ̰¡ ¹«¾ùÀϱî¿ä?
S/W ÀÔÀå¿¡¼ »ý°¢ÇØ º¸¸é ÇÁ·Î±×·¥ÀÌ ¼ø¼´ë·Î ½ÇÇàÀÌ µÇ´Ù°¡ ¾î¶² ¼ø°£¿¡ ISRÀÌ ¹ß»ýÀ» ÇÏ¸é ¿ø·¡ÀÇ ÇÁ·Î±×·¥ ½ÇÇàÀ» Àá½Ã Áß´ÜÇÏ°í ISR ¼ºñ½º ·çƾÀ¸·Î À̵¿ÇÏ°Ô µË´Ï´Ù. À̶§ ISR¼ºñ½º ·çƾÀ¸·Î À̵¿À» Çϴ°ÍÀ» ¹®¸ÆÀÇ ÀüȯÀ̶ó°í Çϴµ¥¿ä ISR ¼ºñ½º ·çƾÀ¸·Î À̵¿ÇÏ°í ³ª¼ ISR¼ºñ½º¸¦ ¸¶Ä¡°í ¿ø·¡ÀÇ ÇÁ·Î±×·¥ÀÌ °è¼ÓÇؼ ½ÇÇàÀÌ µÇ¾î¾ß Çϴµ¥ ¸¸¾à ISR¼ºñ½º ·çƾ¿¡¼ ƯÁ¤ ·¹Áö½ºÅ͵é(R0 ~ R12)À» »ç¿ëÇÏ¿´´Ù¸é ±× °ªµéÀÌ º¯µ¿ÀÌ µÈ»óÅ¿¡¼ ¿ø·¡ÀÇ ÇÁ·Î±×·¥ÀÌ ½ÇÇàµÇ´ø À§Ä¡·Î µ¹¾Æ¿Í¼ °è¼Ó ½ÇÇàÀ» ÇÏ°Ô µÇ¸é ¿øÇÏÁö ¾Ê´ø °á°ú°¡ ³ª¿Ã ¼ö ÀÖ½À´Ï´Ù. ÀÌ·±ÇÑ ÀÌÀ¯ ¶§¹®¿¡ ¹®¸ÆÀÇ º¸Á¸À» À§Çؼ ISR ¼ºñ½º ·çƾÀ¸·Î À̵¿À» Çϱâ Àü¿¡ ISR¿¡¼ »ç¿ëµÉ ·¹Áö½ºÅ͵éÀ» ½ºÅÿ¡ Àӽ÷ΠÀúÀåÀ» ÇÏ°í ISR·çƾÀ» ºüÁ®³ª¿À±â Àü¿¡ ½ºÅÿ¡ ÀúÀåµÇ¾î ÀÖ´ø ·¹Áö½ºÅ͵éÀ» ´Ù½Ã º¹¿ø½ÃÄÑ ÁÝ´Ï´Ù.
ISR ¼ºñ½º ·çƾÀ¸·Î À̵¿ÇÏ´Â °ÍÀ» ¹®¸ÆÀÇ ÀüȯÀ̶ó ÇÏ°í
ISR ·çƾ¿¡¼ »ç¿ë ÇÒ ·¹Áö½ºÅ͵éÀ» Àӽ÷Π½ºÅÿ¡ ÀúÀåÇÏ¿´´Ù°¡ ISR·çƾÀÇ ¼öÇàÀ» ¸¶Ä¡°í º¹±ÍÇϱâÀü¿¡ ÀúÀåÇØ µÎ¾ú´ø ·¹Áö½ºÅ͵éÀ» ¿ø·¡ÀÇ °ªÀ¸·Î º¹¿øÇÏ´Â °ÍÀ» ¹®¸Æ º¸Á¸ À̶ó°í ÇÕ´Ï´Ù.
¾Æ ~~ ¼³¸íÀÌ ±æ¾î Áö°í¾ß ¸»¾Ò³×¿ä. À̰͵µ °£´ÜÇÏ°Ô ¿¹¸¦ µé¾î¼ ´Ù½Ã ¼³¸íÀ» Çϵµ·Ï ÇÏÁö¿ä.
À§ÀÇ ±×¸²¿¡¼ "MOV R1, #2" ¸í·É ÀÌÈÄ¿¡ Interrupt°¡ ¹ß»ýÇÏÁö ¾Ê¾Ò´Ù¸é R2¿¡¼ #3ÀÌ µé¾î°¡ ÀÖ¾î¾ß Çϳª ISR ¼ºñ½º ·çƾ¿¡¼ R0, R1À» #0À¸·Î º¯°æÇÏ¿© ISR ·çƾ º¹±Í ÈÄ R2¿¡´Â #0ÀÌ µé¾î°¡ ÀÖ½À´Ï´Ù. ÀÌ°ÍÀº ¿ø·¡ÀÇ ¿øÇÏ´ø ÇÁ·Î¼¼½º È帧ÀÌ ¾Æ´Õ´Ï´Ù.
À§ÀÇ ±×¸²¿¡¼´Â ½ºÅÃÀ» ÀÌ¿ëÇؼ ISR ¼ºñ½º ·çƾ¿¡¼ ¹®¸Æ ÀúÀå(PUSH)°ú º¹¿ø(POP)À» ÇÏ°í ÀÖ¾î
Interrupt°¡ ¹ß»ýÇÏ¿© ¹®¸ÆÀüȯ(Context Switch - ISR ¼ºñ½º ·çƾÀ¸·Î À̵¿)ÀÌ ÀÏ¾î³ ÈÄ¿¡µµ
º¹±Í ÇÏ¿´À»¶§ R2¿¡´Â Á¤»óÀûÀ¸·Î #3ÀÌ µé¾î°¡ ÀÖ½À´Ï´Ù.
À§ÀÇ ¿¹Á¦´Â FIQ ÀÎÅÍ·´Æ®°¡ ¹ß»ý ÇßÀ» °æ¿ìÀÌ ¿¹Á¦ ÀÔ´Ï´Ù. R10¿¡ ÀúÀåµÇ´Â °ªÀº ¸îÀϱî¿ä ?
Á¤´äÀº #3ÀÌ µé¾î°¡ ÀÖ°ÚÁÒ. ¿Ö³ÄÇϸé FIQ ¸ðµå¿¡¼ »ç¿ëµÇ´Â F8 ~ R14´Â ¹ðÅ©µå µÇ¾î ÀÖ¾î¼ Normal·çƾ¿¡¼ »ç¿ëµÇ´Â R8 ~ R12¿Í´Â º°°³ÀÇ ·¹Áö½ºÅÍ À̱⠶§¹®¿¡ FIQ ¸ðµå¿¡¼ R8 ~ R12 ´Â ¹®¸ÆÀúÀå°ú º¹¿øÀ» ÇÏÁö ¾Ê¾Æµµ µÇ´Â°Í ÀÔ´Ï´Ù. ÇÏÁö¸¸ FIQ ¸ðµå¿¡¼µµ R0 ~ R7 ¸¦ »ç¿ëÇÑ´Ù¸é ¹®¸Æ ÀúÀå°ú º¹¿øÀ» ÇØ¾ß °ÚÁö¿ä.
ÀÌÇØ°¡ °¡½Ã³ª¿ä. ARM À§ÀÇ 3°¡Áö °æ¿ì¿¡ ´ëÇؼ Á÷Á¢ Äڵ带 ÀÔ·ÂÇؼ Å×½ºÆ® Çغ¸µµ·Ï Çϼ¼¿ä. ¾î¼Àºí¸®¾î·Î Äڵ带 ÀÛ¼º ÇÒ¶§ ¾ÆÁÖ Áß¿äÇÑ ³»¿ë ÀÔ´Ï´Ù.
6.3.2 Special Registers
ARM ·¹Áö½ºÅ͵éÁß¿¡¼ R0 ~ R12 ±îÁö´Â ÀÏ¹Ý ¿¬»ê, Àӽà ÀúÀå Àå¼ÒµîÀ¸·Î »ç¿ëÀÌ µÇ°í R13 ~ R15±îÁö´Â Á¶±Ý Ưº°ÇÑ Àǹ̸¦ °¡Áö°í ÀÖ½À´Ï´Ù.
±×¸®°í CPSR(Current Program Status Register) À̶ó´Â »óÅ ·¹Áö½ºÅ͵µ ÀÖ½À´Ï´Ù.
(1) R13
- Stack Pointer(SP)
- ARM µ¿ÀÛ ¸ðµåº°·Î ½ºÅà Æ÷ÀÎÅ͸¦ °¡¸£Å°°í ÀÖ½À´Ï´Ù.
- R13(SP)´Â ARM µ¿ÀÛ ¸ðµåº°·Î ¹ðÅ©µå µÇ¾î ÀÖ´Â ·¹Áö½ºÅÍ ÀÔ´Ï´Ù.
(2) R14
- Link Register(LR)
- ÇÔ¼ö È£Ãâ½Ã ¸®Å쵃 ÁÖ¼Ò¸¦ °¡Áö°í ÀÖÀ½
- R14(LR)´Â ARM µ¿ÀÛ ¸ðµåº°·Î ¹ðÅ©µå µÇ¾î ÀÖ´Â ·¹Áö½ºÅÍ ÀÔ´Ï´Ù.
ÇÔ¼ö È£Ãâ½Ã º¹±ÍÇÒ ÁÖ¼Ò¸¦ ÀúÀåÇϱâ À§Çؼ ·¹Áö½ºÅÍ ±îÁö 1°³¸¦ ÇÒ´çÇߴµ¥ ¾î¶² ÀåÁ¡ÀÌ ÀÖÀ»±î¿ä ?
¿©·¯¹ø ºÐ±â(BL)ÇÏ´Â °æ¿ì°¡ ¾Æ´Ñ Çѹø¸¸ ºÐ±â(BL) ÇÏ´Â °æ¿ì¶ó¸é, ÇÔ¼ö ¿¡¼ ¿ø·¡ÀÇ ÁÖ¼Ò·Î º¹±ÍÇÒ¶§ ½ºÅÃÀ» »ç¿ëÇÏÁö ¾Ê°í R14 ·¹Áö½ºÅ͸¦ »ç¿ëÇÔÀ¸·Î½á, ±× ¼Óµµ¿¡¼ ÀÌÀÍÀ» ¾ò°Ô µÇ´Â °ÍÀÔ´Ï´Ù.
* ½ºÅà Á¢±Ù = ¸ÞÀÎ ¸Þ¸ð¸® Á¢±Ù = ´À¸²
·¹Áö½ºÅÍ´Â CPU°¡ Á¢±Ù ÇÒ ¼ö ÀÖ´Â °¡Àå ºü¸¥ °í¼ÓÀÇ ¸Þ¸ð¸® ÀúÀå °ø°£ À̶ó°í »ý°¢ÇÏ¸é µÇ°Ú½À´Ï´Ù.
(3) R15
- Program Counter(PC)
- PC¸¦ »ç¿ëÇÏ¿© ¸Þ¸ð¸®¿¡¼ ¸í·É¾î¸¦ Fetch
- R15(PC)´Â ÇÁ·Î¼¼¼ ¸ðµå¿¡ »ó°ü¾øÀÌ ÇϳªÀÇ R15¸¦ °¡Áö°í ÀÖÀ½( ARM µ¿ÀÛ¸ðµåº°·Î ¹ðÅ©µå µÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù.)
(4) CPSR
- Program Status Register (CPSR)
- CPSRÀº ARM µ¿ÀÛ ¸ðµåº°·Î ¹ðÅ©µå µÇ¾î ÀÖ´Â ·¹Áö½ºÅÍ ÀÔ´Ï´Ù.
-
ÇÁ·Î¼¼¼ ¸ðµå°¡ º¯°æÀÌ µÇ¸é Çϵå¿þ¾îÀûÀ¸·Î º¯°æµÇ±â ÀÌÀüÀÇ CPSR º¹»çº»ÀÌ SPSR( Saved Program Status Register - CPSRÀÇ ¹ðÅ©µå ·¹Áö½ºÅÍ) ¿¡ ÀúÀåÀÌ µË´Ï´Ù.
- User, System ¸ðµå¸¦ Á¦¿ÜÇÏ°í °¢ µ¿ÀÛ ¸ðµå¸¶´Ù Çϳª¾¿ Á¸Àç ÇÕ´Ï´Ù.
¾Æ·¡ ±×¸²ÀÌ Á» º¹ÀâÇØ º¸À̱â´Â ÇÏÁö¸¸ CPSRµµ 32bit ·¹Áö½ºÅÍÀÏ »ÓÀÔ´Ï´Ù. Áö±ÝºÎÅÍ Çϳª¾¿ ÆÄÇýÃÄ º¸µµ·Ï ÇÏÁö¿ä.
¾Õ¿¡ NZCVQ´Â Flag field¶ó°í Çؼ, ¹º°¡ ¿¬»êÇÑ ÈÄ¿¡ setµÇ´Â registerÀÔ´Ï´Ù. ÀÌ field´Â ¹æ±Ý ó¸®µÈ ALUÀÇ ¿¬»ê °á°úÀÇ »óŸ¦ ³ªÅ¸³À´Ï´Ù.
1) N : Negative - ¿¬»ê°á°ú°¡ ¸¶À̳ʽºÀÎ °æ¿ì¿¡ set µË´Ï´Ù.
2) Z : Zero - ¿¬»ê°á°ú°¡ 0ÀÎ °æ¿ì¿¡ set µÇ¿ä.
3) C : Carry - ¿¬»ê°á°ú¿¡ ÀÚ¸® ¿Ã¸²ÀÌ ¹ß»ýÇÑ °æ¿ì¿¡ set µË´Ï´Ù.
4) V : oVerflow : ¿¬»êÀÇ °á°ú°¡ overflow ³µÀ» °æ¿ì¿¡ setµÇ´Âµ¥, Over flow¶ó´Â°Ç ³ÑÄ¡´Â °æ¿ì´Ï±î ¿ø·¡ °¡Á®¾ß ÇÏ´Â Rangeº¸´Ù °á°ú °ªÀÌ Å« °æ¿ì°¡ ±× °æ¿ì¿¡ ÇØ´çµË´Ï´Ù.
ÀÌ°ÍÀÇ Çʿ伺Àº ARMÀÇ Ã¶ÇÐÀ̱⵵ Çѵ¥, ARM core´Â Opcode¸¦ Memory¿¡¼ °¡Á®¿ÀÀÚ ¸¶ÀÚ (Fetch) À̸¦ ¹«Á¶°Ç ½ÇÇàÇÏ´Â °ÍÀÌ ¾Æ´Ï¶ó Condition flagÀÎ NZCV¸¦ º¸°í ¹Ù·Î ¾Õ opcodeÀÇ ½ÇÇà°á°ú¸¦ º¸°í ½ÇÇàÇÒÁö ¸»Áö¸¦ °áÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
Default´Â AL "Always" , condition°ú °ü°è¾øÀÌ Ç×»ó ½ÇÇà ÇÏ´Â °ÍÀÔ´Ï´Ù. Control Field¿¡ ´ëÇؼ´Â ¿ì¼± ¿©±â±îÁö ¼³¸íÀ» ÇÏ°í, ARM Instruction¿¡¼ Á»´õ ÀÚ¼¼È÷ ¿¹¸¦ µé¾î¼ ¼³¸íÀ» Çϵµ·Ï ÇÏ°Ú½À´Ï´Ù.
Control FieldÀÇ 7¹ø ºñÆ®ÀÎ "I" À» 1·Î ¸¶½ºÅ·À» Çϸé ÀÎÅÍ·´Æ®°¡ ¹ß»ý ÇÏÁö ¾Ê½À´Ï´Ù. ÀÎÅÍ·´Æ®¸¦ ¹Þ¾Æ µéÀ̱â À§Çؼ´Â 0À¸·Î Clear ÇØ¾ß ÇÕ´Ï´Ù.
¸¶Âù°¡Áö·Î Control FieldÀÇ 6¹ø ºñÆ®ÀÎ "F" À» 1·Î ¸¶½ºÅ·À» Çϸé Fast ÀÎÅÍ·´Æ®°¡ ¹ßÇà ÇÏÁö ¾Ê½À´Ï´Ù. Fast ÀÎÅÍ·´Æ®¸¦ ¹Þ¾Æ µéÀ̱â À§Çؼ´Â 0À¸·Î Clear ÇØ¾ß ÇÕ´Ï´Ù. ¸¶Áö¸·À¸·Î 5¹ø ºñÆ®ÀÎ "T" ¸ðµå°¡ ÀÖ½À´Ï´Ù. ARM Core´Â Ãʱ⠺ÎÆýÿ¡´Â ¹«Á¶°Ç ARM ¸ðµå(5¹ø ºñÆ®ÀÇ "T" °¡ 0À¸·Î ¼³Á¤ µÊ)¿¡¼ ½ÃÀÛÀÌ µÇ°í °æ¿ì¿¡ µû¶ó¼ Thumb mode·Î ÀüȯÀ» ÇÒ ¼ö°¡ ÀÖ½À´Ï´Ù. Thumb mode¿¡ ´ëÇؼ´Â ÀÌÈÄÀÇ Àå¿¡¼ ´Ù½Ã ¼³¸íÀ» Çϵµ·Ï ÇÏ°Ú½À´Ï´Ù. ¾ÕÀý¿¡¼ ARM¿¡´Â 7°¡ÁöÀÇ µ¿ÀÛ ¸ðµå°¡ ÀÖ´Ù°í ÇÏ¿´´Âµ¥, ÀÌ µ¿ÀÛ ¸ðµåµé¿¡ µû¶ó¼ À§ÀÇ Ç¥¿Í ÀÌ CPSRÀÇ ÇÏÀ§ 5bit(Mode bits)ÀÇ °ªµéÀÌ ¼³Á¤ÀÌ µË´Ï´Ù.
6.4 ARM Exceptions
Exception À̶õ ¹«¾ùÀÏ ±î¿ä? »çÀüÀûÀÎ Àǹ̷δ "¿¹¿Ü" ¶ó°í µÇ¾î ÀÖ½À´Ï´Ù. ÇÏÁö¸¸ ¿ì¸®´Â Áö±Ý ARMÀ» °øºÎÇÏ°í Àֱ⠶§¹®¿¡ Á»´õ ARM ÀûÀΠǥÇöÀ» ÇÑ´Ù¸é,
¿ÜºÎ ¿äûÀ̳ª ÇÁ·Î±×·¥ ¿À·ù·Î ÀÎÇØ ÄÚµåÀÇ Á¤»óÀûÀÎ È帧À» ¹þ¾î³ª´Â µ¿ÀÛ À̶ó°í ¼³¸íÀ» ÇÏ°Ú½À´Ï´Ù. ÄÚµåÀÇ
Á¤»óÀûÀÎ È帧À» ¹þ¾î³´Ù´Â ÀÌ°¼±â´Â PC(R15)ÀÇ ÁÖ¼Ò°¡ ¹Ù²î°Ô µÇ´Â °ÍÀÔ´Ï´Ù. ¾Æ·¡ ±×¸²Àº Exception Áß¿¡¼ IRQ ¿¹¿Ü »óȲÀÌ ¹ß»ýÇßÀ» °æ¿ì¿¡ Exception ó¸® È帧ÀÇ ±âº»ÀûÀÎ ¿¹Á¦ ÀÔ´Ï´Ù.
PCÀÇ 0x1004¸¦ ½ÇÇàÇÏ°í ³ª¼ IRQ ¿¹¿Ü »óȲÀÌ ¹ßÇàÀ» ÇÏ°Ô µÇ¸é ÄÚµåÀÇ Á¤»óÀûÀÎ È帧À» Àá½Ã Áß´ÜÇÏ°í IRQ ¿¹¿Ü»óÇ×À» ó¸®ÇØ ÁÖ¾î¾ß ÇÕ´Ï´Ù.
¿©±â¼ IRQ¿¹¿Ü »óȲÀ» ó¸®ÇØ ÁÖ´Â ·çƾÀ» Exception HandlerÇÏ°í ÇÕ´Ï´Ù. Exception Handler ¿¡¼´Â 7°¡Áö ¿¹¿Ü »óȲ(¿©±â ¿¹¿¡¼´Â IRQ ¿¹¿Ü)¿¡ ¸Â´Â ÀûÀýÇÑ Ã³¸®¸¦ ÇÏ°í ExceptionÀÌ ¹ß»ýÇϱâ ÀÌÀüÀ¸·Î º¹±ÍÇÏ¸é µË´Ï´Ù. Exception Handler¿¡¼ ÇÑ°¡Áö ÁÖÀÇ ÇÒ »çÇ×Àº ExceptionÀÌ ¹ß»ýÇϱâ ÀÌÀüÀ¸·Î º¹±ÍÇϱâ Àü¿¡ ¹Ýµå½Ã ¹®¸ÆÀ» º¹¿øÇÏ°í º¹±Í ÇØ¾ß ÇÕ´Ï´Ù.
±×¸®°í
À§ÀÇ ±×¸²¿¡¼´Â ÆíÀÇ»ó IRQ ¿¹¿Ü 󸮸¦ À§Çؼ 0x3000¹øÁö·Î ÄÚµåÀÇ È帧ÀÌ º¯°æµÇ¾úÁö¸¸ ½ÇÁ¦·Î ARM¿¡¼´Â IRQ °¡ ¹ß»ýÇϸé ÄÚµåÀÇ È帧ÀÌ(PC) 0x00000018 ·Î H/W ÀûÀ¸·Î º¯°æÀÌ µÇ°í 0x00000018 ¿¡¼´Â ´Ù½Ã ½ÇÁ¦·Î ¿¹¿Ü »çÇ×À» ó¸®ÇÏ´Â Exception Handler ÇÔ¼ö·Î ºÐ±âÇÏ´Â ¹æ½ÄÀ¸·Î 󸮰¡ µË´Ï´Ù.
0x00000018 ¹øÁö¸¦ Exception Vector¶ó°í ÇÏ°í
ARM¿¡¼´Â 7°¡ÁöÀÇ ExceptonÀÌ Á¸ÀçÇϴµ¥ ÀÌ·¯ÇÑ ¿¹¿Ü »óȲÀÌ ¹ßÇàÀ» ÇÏ¸é °¢ ¿¹¿Ü »óȲ¿¡ µû¶ó¼ ¹Ì¸® ÇÒ´çµÈ ÁÖ¼Ò¿¡ ÀÖ´Â ARM ¸í·É¾î°¡ ¼öÇàÀÌ µË´Ï´Ù.
¾Æ·¡ Ç¥´Â ARM¿¡¼ÀÇ 7°¡ÁöÀÇ Excepton ¿¡ ´ëÇÏ¿© ÁÖ¼Ò¿Í °¢ Exception¿¡ ÇÒ´çµÈ Á¤ÇØÁø Vector ÁÖ¼Ò ÀÔ´Ï´Ù.
Exception Type |
Priority |
Mode |
Vector |
High Vector |
Reset |
1 |
Supervisor |
0x00000000 |
0xFFFF0000 |
Undefined Instruction |
6 |
Undefined |
0x00000004 |
0xFFFF0004 |
SWI |
6 |
Supervisor |
0x00000008 |
0xFFFF0008 |
Prefetch Abort |
5 |
Abort |
0x0000000C |
0xFFFF000C |
Data Abort |
2 |
Abort |
0x00000010 |
0xFFFF0010 |
Reserved |
|
|
0x00000014 |
0xFFFF0014 |
IRQ |
4 |
IRQ |
0x00000018 |
0xFFFF0018 |
FIQ |
3 |
FIQ |
0x0000001C |
0xFFFF001C |
ExceptionÀÇ Á¾·ù¿Í ¾Õ¿¡¼ ¹è¿ü´ø ARM µ¿ÀÛ ¸ðµå¿ÍÀÇ °ü°è¸¦ È¥µ¿Çؼ´Â ¾ÈµË´Ï´Ù. ¿¹¿Ü »óȲÀÌ ¹ß»ýÇÏ¸é ±×¿¡ µû¶ó¼ H/W ÀûÀ¸·Î ARM µ¿ÀÛ ¸ðµå°¡ º¯°æÀÌ µÇ´Â °ÍÀÔ´Ï´Ù. Priority´Â °°Àº ½Ã°£¿¡ ´Ù¼öÀÇ ¿¹¿Ü »óȲÀÌ ¹ßÇàÇÏ°Ô µÇ¸é ¿ì¼±¼øÀ§°¡ ³ôÀº ³ðÀÌ ¸ÕÀú ¹ß»ýÀ» ÇÏ°ÚÁö¿ä.
º¸Åë VectorÁÖ¼Ò´Â 0x00 ¹øÁö¿¡¼ 32bit(4Byte)´ÜÀ§·Î Áõ°¡ Çϴµ¥, High Vecotr·Î ¼³Á¤ÀÌ µÇ¸é ½ÃÀÛ ÁÖ¼Ò°¡ 0xFFFF0000°¡ µË´Ï´Ù. Windows CE¿¡¼´Â High Vector¸¦ »ç¿ëÇÑ´Ù°í ÇÕ´Ï´Ù.
(1) Reset
ARM Core¿¡ Àü¿øÀ» Àΰ¡ÇÏ´Â µî¿¡¼ ¹ß»ý
Reset ¹ß»ý½Ã CPSR, Register »óÅ |
R14_svc |
UNP |
SPSR_svc |
UNP |
CPSR[4:0] - ARM µ¿ÀÛ ¸ðµå |
Supervisor Mode |
CPSR[7:5] - ÀÎÅÍ·´Æ® »óÅÂ |
I=1, F=1, T=0 |
PC - Vector Address |
0x00000000 |
(2) Undefined Instruction
ARM Processor ¿¡¼ Á¤ÀǵÇÁö ¾ÊÀº ¸í·É¾î µîÀ» ½ÇÇà ÇÏ´Â °æ¿ì¿¡ ¹ß»ý
Undefined Instruction ¹ß»ý½Ã CPSR, Register »óÅ |
R14_und |
Address of the undefined instruction + 4 |
SPSR_und |
CPSR |
CPSR[4:0] - ARM µ¿ÀÛ ¸ðµå |
Undefined Mode |
CPSR[7:5] - ÀÎÅÍ·´Æ® »óÅÂ |
I=1, F=unchanged, T=0 |
PC - Vector Address |
0x00000004 |
Return |
MOVS PC, LR |
Return À̶ó°í µÇ¾î ÀÖ´Â Ç׸ñÀº Exception Handler ¼öÇàÀ» ¸¶Ä¡°í ¿ø·¡ÀÇ ÇÁ·Î±×·¥ È帧À¸·Î º¹±ÍÇÒ¶§, R14¿¡ H/WÀûÀ¸·Î µé¾î°¡´Â º¹±Í ÁÖ¼Ò¿¡ µû¶ó¼ ´Þ¶óÁö°Ô µË´Ï´Ù. °¢ Exception Á¾·ù¿¡ µû¶ó¼ R14¿¡ µé¾î°¡´Â º¹±Í ÁÖ¼Ò°¡ ´Þ¶ó Áö¹Ç·Î ÁÖÀÇ ÇØ¾ß ÇÕ´Ï´Ù.
(3) Software Interrupt
ºñ Ư±Ç¸ðµå¿¡¼ Ư±Ç ¸ðµå·Î ÁøÀÔÇϱâ À§Çؼ Software Interrupt ¸í·É¾î¸¦ ½ÇÇàÇÑ °æ¿ì ¹ß»ý
Software Interrupt ¹ß»ý½Ã CPSR, Register »óÅ |
R14_svc |
Address of the SWI instruction + 4 |
SPSR_svc |
CPSR |
CPSR[4:0] - ARM µ¿ÀÛ ¸ðµå |
Supervisor Mode |
CPSR[7:5] - ÀÎÅÍ·´Æ® »óÅÂ |
I=1, F=unchanged, T=0 |
PC - Vector Address |
0x00000008 |
Return |
MOVS PC, LR |
(4) Prefetch Abort
Illegal ÁÖ¼Ò¿¡¼ ¸í·É¾î¸¦ °¡Á®¿Í¼ ½ÇÇà ÇÏ·Á´Â °æ¿ì¿¡ ¹ß»ý
Prefetch Abort ¹ß»ý½Ã CPSR, Register »óÅ |
R14_abt |
Address of the aborted instruction + 4 |
SPSR_abt |
CPSR |
CPSR[4:0] - ARM µ¿ÀÛ ¸ðµå |
Abort Mode |
CPSR[7:5] - ÀÎÅÍ·´Æ® »óÅÂ |
I=1, F=unchanged, T=0 |
PC - Vector Address |
0x0000000C |
Return |
SUBS PC, LR, #4 |
(5) Data Abort
Illegal ÁÖ¼Ò¿¡ Data¸¦ ¾²°Å³ª Àб⠵¿ÀÛÀ» ½ÃµµÇÏ´Â °æ¿ì¿¡ ¹ß»ý
Data Abort ¹ß»ý½Ã CPSR, Register »óÅ |
R14_abt |
Address of the aborted instruction + 8 |
SPSR_abt |
CPSR |
CPSR[4:0] - ARM µ¿ÀÛ ¸ðµå |
Abort Mode |
CPSR[7:5] - ÀÎÅÍ·´Æ® »óÅÂ |
I=1, F=unchanged, T=0 |
PC - Vector Address |
0x00000010 |
Return |
SUBS PC, LR, #8 (re-executed)
SUBS PC, LR, #4 (not re-executed) |
(6) IRQ
ARM Processor ¿ÜºÎ¿¡¼ ÀÎÅÍ·´Æ®¸¦ ¿äûÇÑ °æ¿ì¿¡ ¹ß»ý
IRQ ¹ß»ý½Ã CPSR, Register »óÅ |
R14_irq |
Address of the next instruction to be executed + 4 |
SPSR_irq |
CPSR |
CPSR[4:0] - ARM µ¿ÀÛ ¸ðµå |
IRQ Mode |
CPSR[7:5] - ÀÎÅÍ·´Æ® »óÅÂ |
I=1, F=unchanged, T=0 |
PC - Vector Address |
0x00000018 |
Return |
SUBS PC, LR, #4 |
(7) FIQ
ARM Processor ¿ÞºÎ¿¡¼ Fast ÀÎÅÍ·´Æ®¸¦ ¿äûÇÑ °æ¿ì¿¡ ¹ß»ý
FIQ ¹ß»ý½Ã CPSR, Register »óÅ |
R14_fiq |
Address of the next instruction to be executed + 4 |
SPSR_fiq |
CPSR |
CPSR[4:0] - ARM µ¿ÀÛ ¸ðµå |
FIQ Mode |
CPSR[7:5] - ÀÎÅÍ·´Æ® »óÅÂ |
I=1, F=1, T=0 |
PC - Vector Address |
0x0000001C |
Return |
SUBS PC, LR, #4 |
Exception Handler¸¦ Á¾·áÇÏ°í ¿ø·¡ÀÇ ÇÁ·Î¼¼½º È帧À¸·Î º¹±ÍÇÏ´Â Return ¸í·É¾îÀÇ °øÅëÁ¡Àº SUBS, MOVS µîÀ¸·Î ³¡¿¡ "S" Á¢¹Ì»ç°¡ µû¶ó ºÙ½À´Ï´Ù.
"S" Á¢¹Ì»çÀÇ Àǹ̴ Destination ·¹Áö½ºÅÍ°¡ ¸¸¾à PC(R15) ¶ó¸é SPSRÀ» CPSR·Î º¹¿ø Ç϶ó´Â ÀǹÌÀÇ Á¢¹Ì»ç ÀÔ´Ï´Ù. ¹°·Ð ÀÌ·¯ÇÑ °úÁ¤Àº H/W ÀûÀ¸·Î ÀÌ·ç¾î Áý´Ï´Ù.
¾Æ·¡ ±×¸²Àº IRQ ¹ß»ý½Ã ó¸®ÇÏ´Â ÀýÂ÷ ÀÔ´Ï´Ù. À§¿¡¼ ¾ð±ÞÇß´ø ³»¿ëµé°ú ºñ±³ÇØ º¸½Ã±â ¹Ù¶ø´Ï´Ù.
ÇÁ·Î±×·¥ÀÇ Á¤»óÀûÀÎ È帧¿¡¼ 0x1004¹øÁö ¸í·É¾î ó¸®Áß¿¡ IRQ ¿¹¿Ü°¡ ¹ß»ýÇϸé 0x1004 ¹øÁöÀÇ ¸í·É¾î ¼öÇàÀÌ ¿Ï·á°¡ µÈ ÀÌÈÄ¿¡ IRQ ¿¹¿ÜÀÇ Exception VectorÀÎ 0x0018¹øÁö·Î PC°¡ À̵¿À» ÇÏ°í 0x0018¹øÁö¿¡¼ ½ÇÁ¦·Î IRQ ¿¹¿Üó¸® Çڵ鷯 ÇÔ¼ö°¡ ÀÖ´Â ¹øÁö·Î ´Ù½Ã À̵¿À» ÇÑ´ÙÀ½
¿¹¿Ü󸮸¦ ¿Ï·áÇÏ°í ´Ù½Ã
IRQ ¿¹¿Ü°¡ ¹ß»ýÇÑ ´ÙÀ½ ¹øÁöÀÇ ¸í·É¾î°¡ ÀÖ´Â °÷À¸·Î "SUBS PC, LR, #4" ¿¡ ÀÇÇؼ º¹±ÍÇؼ IRQ ¿¹¿Ü°¡ ¹ß»ýÇÏÁö ¾ÊÀº°Íó·³ °è¼ÓÇؼ Normal ·çƾÀÌ ½ÇÇàÀÌ µË´Ï´Ù.
À§¿¡¼ ÇÑ°¡Áö ¼³¸íÀ» ºü¶ß¸° °ÍÀÌ Àִµ¥, IRQ ¿¹¿Ü°¡ ÀϾ¸é H/W ÀûÀ¸·Î´Â ´ÙÀ½°ú °°Àº ÀÏÀÌ ¹ß»ýÀ» ÇÕ´Ï´Ù.
(1) CPSR ¹é¾÷ : SPSR_irq = CPSR_svc
(2) ARM ¸ðµå·Î Àüȯ( ¿¹¿Ü»óȲ¿¡¼´Â Ç×»ó ARM ¸ðµå·Î ¼öÇàÀÌ µÊ) : CPSR.T = 0
(3)
CPSR MODE ¸¦ IRQ ¸ðµå·Î º¯°æ : CPSR[4:0] = 0b10010
(4) IRQ ¸ðµå ¸¶½ºÅ·(ÀÎÅÍ·´Æ®°¡ Disable µÊ) : CPSR.I = 1
(5) R14_irq = PC + #8
(6) PC = 0x18( IRQ Vector address)
(5)¹ø Ç׸ñ¿¡¼ LR(R14)¿¡ PC + #8ÀÌ µé¾î°¡´Â ÀÌÀ¯´Â ƯÁ¤ ¹øÁöÀÇ ¸í·É¾î°¡ ¼öÇàµÉ¶§ IRQ°¡ ¹ß»ýÀ» Çϸé
Execution - Fetch - Decode ÀÇ Pipe line ¿¡¼ º¸¸é Execution ´Ü°è¿¡¼ ½ÇÁ¦ PC´Â ÇöÀç ½ÇÇàÁßÀÎ ¸í·É¾îÀÇ Fetch(+4), Decode(+8) ´Ü°è°¡ ½ÇÇàÀÌ µÇ°í Àֱ⶧¹®¿¡ LR¿¡´Â PC + #8 ¹øÁöÀÇ °ªÀÌ µé¾î °¡°Ô µË´Ï´Ù. ÇÏÁö¸¸ IAR, KEIL, ADS µîÀÇ ÄÄÆÄÀÏ·¯ µî¿¡¼´Â IRQ¹ß»ý½Ã LR·¹Áö½ºÅÍ °ªÀ» Á¶»çÇغ¸¸é LRÀÇ °ªÀÌ PC + #8 °¡ ¾Æ´Ï°í LR = PC ÀÇ °ª°ú µ¿ÀÏÇÏ´Ù°í Ç¥½Ã µË´Ï´Ù. ÀÌ°ÍÀº ÄÄÆÄÀÏ·¯ »ç¿ëÀÚÀÇ È¥µ¿À» ÇÇÇϱâ À§Çؼ ÀÌ·¸°Ô Ç¥½Ã¸¦ ÇÏ°í ÀÖ´Â°Í °°½À´Ï´Ù.
6.5 Exception °ú InterruptÀÇ Â÷ÀÌ
Exception°ú
Interrupt´Â ¹«¾ùÀÌ ´Ù¸¦±î¿ä. °æ¿ì¿¡ µû¶ó¼´Â ºñ½ÁÇÑ ÀÇ¹Ì Àϼöµµ ÀÖ½À´Ï´Ù. ÇÏÁö¸¸ ¸î°¡Áö ´Ù¸¥Á¡ÀÌ ÀÖ½À´Ï´Ù.
(1) Exception
- ƯÁ¤ ¸í·É¾î ½ÇÇà¿¡ ÀÇÇÑ ¿À·ù½Ã ¹ß»ý
- Ŭ·Ï¿¡ µ¿±â ÀûÀ¸·Î ¹ß»ýµÊ : ExceptionÀº ÁÖ·Î Core³»ºÎ¿¡¼ ¹ß»ýÇϱ⠶§¹®¿¡ CoreÀÇ Å¬·°¿¡ µ¿±âÀûÀ¸·Î ¹ß»ýÀ» ÇÕ´Ï´Ù.
- ¸Þ¸ð¸® Á¢±Ù ¿À·ù, µð¹ö±ë Áß´ÜÁ¡, divide by zero... µî
- ³Ð°Ô »ý°¢Çϸé ExceptionÀº IRQ¸¦ Æ÷ÇÔÇÑ´Ù°í »ý°¢Çصµ µË´Ï´Ù.
(2)
Interrupt
- Processor ÀÇ ¸í·É¾î ½ÇÇà°ú °ü°è¾øÀÌ Processor ¿ÜºÎ¿¡¼ ÁÖ·Î ¹ß»ý --> Ŭ·Ï¿¡ ºñµ¿±â ÀûÀ¸·Î ¹ß»ý ÇÒ¼öµµ ÀÖÀ½
6.6 ARM¿¡¼ÀÇ Interrupt system
ARM Cortex½Ã¸®Áî ÀÌÀüÀÇ ÀüÅëÀûÀÎ ARM Core¿¡´Â ÀÎÅÍ·´Æ®·Î ¹Þ¾Æ µå¸± ¼ö ÀÖ´Â ¹æ½ÄÀº
IRQ, FIQ 2°¡Áö ¹Û¿¡ ¾ø½À´Ï´Ù.
À§ÀÇ ±×¸²Àº ARM9 CoreÀÇ ÀÎÅÍ·´Æ® ºí·°µµ ÀÔ´Ï´Ù. Interrupt Controller ¿Í Physical Interrupts(UART, I2C µî) ¼Ò½º´Â ARM Core ³»ºÎÀÇ ºí·°ÀÌ ¾Æ´Õ´Ï´Ù. Interrupt Controller ¿Í Physical Interrupts ºÎºÐÀº ARM Core¸¦ ÀÌ¿ëÇؼ ¼³°èÇÑ S3C2440µîÀÇ CPU ºí·° ÀÔ´Ï´Ù. ´Ù½ÃÇѹø ¸»¾¸µå¸®Áö¸¸ ARM Core¿¡´Â IRQ³ª FIQ³Ä¸¸À» ¹Þ¾Æ µéÀÏ ¼ö ÀÖ½À´Ï´Ù. Interrupt Controller´Â CPU Vendor¿¡ ÀÇÇؼ ´Ù¸£°Ô µðÀÚÀÎ µÉ¼öµµ ÀÖ½À´Ï´Ù.
|