ARM Architecture


 
* Update history

- 2012.7.5 : Ãʱâ Release
- 2012.9.26 : ÀϺΠºí·° ´ÙÀ̾î±×·¥µé À̹ÌÁö ±³Ã¼ ¹× Pipeline ºÎºÐ º¸Ãæ ¼³¸í Ãß°¡



 
1. ÀÓº£µð½º ½Ã½ºÅÛ ¼Ò°³
   1.1 Embedded System À̶õ
   1.2 Embedded System ±¸¼º
   1.3 Operating System
2. Processor
   2.1 CPU
   2.2 RISC and CISC
   2.3 General Register
   2.4 SFR(Special Function Register)
   2.5 ALU (Arithmetic Logic Unit)
   2.6 Control Unit
   2.7 Bus
   2.8 Processor ±âº» µ¿ÀÛ
   2.9 Pipeline
3. ÇÁ·Î¼¼¼­ ¼º´É
   3.1 CPU ¼º´É Áõ°¡ ±â¹ýµé
   3.2 CPU Clock Áõ°¡ÀÇ ÇÑ°èÁ¡
   3.3 Multi Core Processor
4. Embedded Software
   4.1 Machine & Language
   4.2 ÄÄÆÄÀÏ·¯
   4.3 ¾î¼Àºí·¯
   4.4 Linker


 




1. ÀÓº£µð½º ½Ã½ºÅÛ ¼Ò°³
1.1 Embedded System À̶õ

ARMÇÁ·Î¼¼¼­´Â ¿¹Àü¿¡´Â ÁÖ·Î °æ·®È­µÈ ÀÓº£µðµå ½Ã½ºÅÛ¿¡¼­ »ç¿ëµÇ¾ú´Âµ¥, ÃÖ±Ù¿¡´Â ¾öû³­ ¼º´ÉÀ¸·Î ¹«ÀåÇÏ¿© ¸¶ÀÌÅ©·Î¼ÒÇÁÆ®»ç ¿¡¼­µµ ARMÀ» Áö¿øÇÏ´Â µî Á»´õ º¹ÀâÇÑ »ç¿ëÀÚ UI°¡ ÇÊ¿äÇÑ ºÐ¾ß(ÁÖ·Î ½º¸¶Æ® ±â±â)¿¡ ±îÁö ±× ¾²ÀÓ¼¼°¡ È®´ë µÇ¾ú½À´Ï´Ù.

Embedded SystemÀÇ Æ¯Â¡À» ¸î°¡Áö·Î ¿ä¾àÇÏ¸é ´ÙÀ½°ú °°½À´Ï´Ù.

- ÀåÄ¡¿¡ ³»ÀåµÈ Process¿¡ ÀÇÇØ Æ¯Á¤ÇÑ ¸ñÀûÀÇ ±â´ÉÀ» ¼öÇàÇÏ´Â Çϵå¿þ¾î¿Í ¼ÒÇÁÆ®¿þ¾î°¡ Á¶ÇÕµÈ °æ·®È­µÈ ½Ã½ºÅÛ
- ÀÔÃâ·Â ÀåÄ¡¸¦ ³»ÀåÇÏ°í ÀÖ´Ù.
- Processor µ¿ÀÛÀº ÁÖ·Î S/W¿¡ ÀÇÁöÇØ µ¿ÀÛ ÇÑ´Ù.
- ÀÚµ¿Â÷, ³×Æ®¿öÅ© Àåºñ, Mobile ´Ü¸»±â, Á¤º¸°¡Àü µî¿¡ ÀÀ¿ëµÇ°í ÀÖ´Ù.
- ÀúÀü·Â, ¾ÈÁ¤¼º, Àú·ÅÇÔ

1.2 Embedded System ±¸¼º

ÀÓº£µðµå ½Ã½ºÅÛÀº Å©°Ô Hardware¿Í Software·Î ±¸¼ºµÇ¾î Áý´Ï´Ù.

(1) Hardware
- CPU(Processor)
- Memory ÀåÄ¡ : ROM(NOR), RAM(SDRAM, SRAM), Storage(NAND, SD) ...
- I/O ÀåÄ¡ : Network, LCD, GPIO ...

¸Þ¸ð¸® Áß¿¡¼­ NOR, SDRAMµîÀº Random access°¡ °¡´ÉÇϳª NAND ¸Þ¸ð¸®ÀÌ °æ¿ì´Â Randam access°¡ ºÒ°¡´É ÇÏ°í CPUÀÔÀå¿¡¼­ Address¸¦ °¡Áö°í Á¢±ÙÀ» ÇÒ ¼ö °¡ ¾ø´Ù. ±×·¡¼­ NANDÀÇ °æ¿ì¿¡´Â ¸Þ¸ð¸®¶ó°í Çϱ⠺¸´Ù´Â ÀúÀåÀåÄ¡¿¡ °¡±õ½À´Ï´Ù. Address¸¦ °¡Áö°í Random access°¡ °¡´É ÇÏ´Ù¸é XIP(Execute In Place) °¡ °¡´ÉÇÏ¿© ºÎÆÃÀ» À§ÇÑ ¸Þ¸ð¸®·Î¼­ »ç¿ëÀÌ °¡´ÉÇÕ´Ï´Ù. ÃÖ±Ù¿¡´Â NAND¸Þ¸ð¸®¸¸ À־ ºÎÆÃÀÌ °¡´ÉÇÑ µð¹ÙÀ̽ºµé(S3C6410, S5PV210 µî)ÀÌ ÀÖÀ¸³ª ÀÌ°ÍÀº NAND¸Þ¸ð¸®¿¡¼­ Á÷Á¢ ½ÇÇàµÇ´Â °ÍÀÌ ¾Æ´Ï¶ó CPU ·¹º§¿¡¼­ NAND ¸Þ¸ð¸®ÀÇ 0¹ø ºí·°ÀÇ ³»¿ëÀ» CPUÀÇ Internal SRAM¿¡ ·Îµå ½ÃÄѼ­ NAND¸Þ¸ð¸®¿¡¼­ ºÎÆÃÀÌ °¡´ÉÇÑ°Íó·³ º¸¿©Áö´Â ÀÔ´Ï´Ù. ±×·¡¼­ CPUÀÇ OM(Operation Mode)µîÀÇ Æ÷Æ®¸¦ Àß º¸¸é NAND ¸Þ¸ð¸®ÀÇ µ¿ÀÛ Cycle, Size µîÀ» H/W ÀûÀ¸·Î Á¤ÇØ ÁÖ´Â ºÎºÐÀÌ ÀÖ½À´Ï´Ù.

(2) Software
- System Software : Firmware(OS °³³äÀÌ ¾øÀ½), Device Driver(OS °üÁ¡)
- RTOS, Embedded OS
- Middleware : Network Stack Protocol, File System ...
- Applications

¼ÒÇÁÆ®¿þ¾î ±¸¼º

À§ÀÇ ±×¸²¿¡¼­ System Software´Â Device DriverȤÀº HAL(Hardware Abstraction Layer, Çϵå¿þ¾î Ãß»óÈ­ °èÃþ)À̶ó°íµµ ºÎ¸¨´Ï´Ù.

1.3 Operating System
(1) RTOS (Real-Time OS)
- ÁÖ¾îÁø ÀÓÀÇÀÇ ÀÛ¾÷¿¡ ´ëÇØ Á¤ÇØÁø ½Ã°£ ³»¿¡ ¼öÇàÇÒ ¼ö ÀÖµµ·Ï Çϴ ȯ°æÀ» Á¦°ø
- °³¹ß½Ã¿¡ ÁÖ·Î ¿î¿µÃ¼Á¦¿Í TaskµéÀÌ °°ÀÌ ºôµå µË´Ï´Ù.
- VxWorks, uC/OS, FreeRTOS, pSOS(»ï¼º), Nucleus

RTOS¿¡ ´ëÇؼ­´Â ¿©·¯°¡Áö Á¤ÀÇ°¡ ¸¹ÀÌ ÀÖÁö¸¸ ¿¹¸¦ µé¾îº¸¸é Á» °¨ÀÌ ¿Ã°Í °°½À´Ï´Ù. ÀϹÝÀûÀ¸·Î ¿ì¸®°¡ »ç¿ëÇÏ´Â PCÀÇ °æ¿ì¿¡ ¿ì¸®°¡ Excel µîÀ» ½ÇÇà ½ÃÄ×À» °æ¿ì Á¶±Ý ´Ê°Ô ½ÇÇàÀÌ µÈ´Ù°í Çؼ­ Å« ÀÏÀÌ ¹ß»ý ÇÏÁö´Â ¾Ê½À´Ï´Ù. ½ÇÇàÀÌ µÉ¶§±îÁö Á¶±Ý ±â´Ù¸®¸é µÇ°ÚÁÒ. ÇÏÁö¸¸ ¹«ÀÎÀÚµ¿Â÷¸¦ ¿îÇàÇÏ´Â ½Ã½ºÅ۵¼­ Àü¹æ¿¡ Àå¾Ö¹°ÀÌ ³ªÅ¸³µÀ» °æ¿ì ¹Ýµå½Ã ºÎµúÈ÷±âÀü¿¡ ¸ØÃç¼­°Å³ª ÇÇÇØ°¡¾ß µÇ°ÚÁö¿ä. ¾î¶² »óȲ(ºÎµúÈ÷´Â »óȲ)¿¡ ´ëÇؼ­ Á¤ÇØÁø ½Ã°£(ºÎµúÈ÷±â Àü)±îÁö´Â ¹Ýµå½Ã ÀÀ´äÀ» ÁÖ¾î¾ß ÇÏ´Â ½Ã½ºÅÛ¿¡¼­ RTOSµîÀÌ ÇÊ¿äÇÏ°Ô µË´Ï´Ù.

(2) Embedded OS
- ¿©·¯ º¹ÀâÇÑ ÀÛ¾÷µéÀ» µ¿½Ã¿¡ È¿À²ÀûÀ¸·Î ¼öÇàÇϱâ À§ÇÑ È¯°æ Á¦°ø
- ÀÌ¹Ì µ¿ÀÛ Áß¿¡ ÀÖ´Â ¿î¿µÃ¼Á¦ »ó¿¡¼­ »õ·Î¿î ÇÁ·Î¼¼½º¸¦ ÀÌ½Ä ÇÒ ¼ö ÀÖ´Ù. --> RTOS¿¡ ºñÇؼ­ Application °³¹ßÀ» Æí¸®ÇÏ°Ô ÇÒ¼ö ÀÖ½À´Ï´Ù.
- Windows CE, Linux, Android, iOS

Embedded OS´Â ÃÖ±Ù¿¡ ½º¸¶Æ®Æù, ³×ºñ°ÔÀÌ¼Ç µî¿¡ ¸¹ÀÌ ÀÌ¿ëµÇ°í ÀÖ½À´Ï´Ù.

2. Processor
2.1 CPU
(1) CPU (Central Processing Unit)
CPUÀÇ ±¸¼ºÀº Processor Core + System Bus + Peripherals (H/W IP) + Memory ·Î ÀÌ·ç¾î Áý´Ï´Ù. ÀÌ·¸°Ô CPU¾È¿¡ ÁÖº¯ÀåÄ¡(Peripherals), MemoryµîÀ» ¸ðµÎ ´ã°í ÀÖ´Â ½Ã½ºÅÛÀ» SOC (System-On-Chip) ¶ó°í ÇÑ´Ù. ¾Æ·¡ ±×¸²Àº SOCÀÇ ÇÑ ¿¹ÀÌ´Ù. ¿ì¸®°¡ ¾ÕÀ¸·Î °øºÎÇÏ·Á°í ÇÏ´Â ARMµµ ¹Ù·Î Processor Core ÁßÀÇ ÇÑ Á¾·ù ÀÔ´Ï´Ù. Data ¹ö½º¿Í Instruction ¹ö½º°¡ µû·Î ÀÖ´Â °ÍÀ¸·Î º¸¾Æ¼­ ÇÏ¹Ùµå ¾ÆÅ°ÅØÃÄ ±¸Á¶ ÀÔ´Ï´Ù.

¼ÒÇÁÆ®¿þ¾î ±¸¼º

(2) Processor Core
- ¸Þ¸ð¸® ÀåÄ¡·Î ºÎÅÍ ÇÁ·Î±×·¥ÀÇ ±¸¼º ¿ä¼ÒÀÎ ¸í·É¾îµéÀ» fetch, decoding, execution ÇÏ´Â µ¿ÀÛÀ» ÇÕ´Ï´Ù.
- ·¹Áö½ºÅÍ(Register), ¿¬»êÀåÄ¡(ALU), Á¦¾îÀåÄ¡(Control Unit), ¹ö½º(Bus), Cache memory(Optional), MMU(Optional) µîÀ¸·Î ±¸¼º µË´Ï´Ù.
- Processor CoreÀÇ Á¾·ù¿¡´Â ARM, MIPS, IntelÀÇ Sandy Bridge µîµµ Processor CoreÀÇ ÇÑ Á¾·ù ÀÔ´Ï´Ù.

2.2 RISC and CISC

(1) RISC (Reduced Instruction Set Computer)
RISCÀÇ ´ëÇ¥ ÁÖÀÚ´Â ARM, MIPS, SunSPARC, IBM PowerPC µîÀÌ ÀÖ½À´Ï´Ù. ARM»çÀÇ ´ÙÀ½ ¹öÁ¯¿¡¼­´Â 64ºñÆ®¸¦ Áö¿øÇÑ´Ù°í ÇÕ´Ï´Ù.

- Same Length for all instruction, big code sizes
´Ü¼øÇÑ ADD¸í·ÉÀ̳ª º¹ÀâÇÑ ¸í·ÉÀ̳ª ¸ðµÎ 32bitÀÇ µ¿ÀÏÇÑ ¸í·É¾î ±æÀ̸¦ °¡Áö°í Àֱ⠶§¹®¿¡ ÄÚµåÀÇ ÁýÀûµµ°¡ ¶³¾îÁú ¼ö ¹Û¿¡ ¾ø½À´Ï´Ù. À̸¦ º¸¿ÏÇϱâ À§Çؼ­ 16bit ÄÚµå »çÀÌÁ °¡Áö°í Thumb ¸í·É¾î¸¦ Áö¿øÇÏ°í ÀÖ°í Cortex-M °è¿­¿¡¼­´Â ARM, Thumb¸í·É¾îÀÇ ÀåÁ¡À» ÃëÇÑ Thumb2 ¸í·É¾î¸¦ »ç¿ëÇÏ°í ÀÖ½À´Ï´Ù.

- Simple Hardware, Low Power, Mobile Device µéÀ» À§Çؼ­ ÃÖÀûÈ­ µÇ¾î ÀÖÀ½.
¸í·É¾îÀÇ ±æÀÌ°¡ ¸ðµÎ °°±â ¶§¹®¿¡ ÄÚµå ÁýÀûµµ´Â ¶³¾îÁöÁö¸¸ ÀÌ ´öºÐ¿¡ H/W °¡ ´Ü¼øÇØÁö°í Àü·Â ¼Ò¸ð¸¦ ÁÙÀϼö ÀÖ½À´Ï´Ù.

- Load Store Architecture, needs many registers
¸í·É¾îÀÇ °³¼ö°¡ ¸¹Áö ¾Ê±â ¶§¹®¿¡ ±×¿¡ µû¶ó¼­ ·¹Áö½ºÅÍ°¡ Á»´õ ÇÊ¿äÇÏ°Ô µÇ¾ú½À´Ï´Ù.

(2) CISC (Complex Instruction Set Computer)
CISC ´ëÇ¥ÁÖÀÚ´Â Intel x86, Alpha °è¿­ÀÌ ÀÖ½À´Ï´Ù.

- Complex Hardware
¸í·É¾îÀÇ ±æÀÌ°¡ ±â´É¿¡ µû¶ó¼­ ´Ù¸£±â ¶§¹®¿¡ º¹ÀâÇÑ H/W 󸮰¡ ¿ä±¸ µË´Ï´Ù.

- Different Length for different instructions, low code size
¼öÇàÇÏ´Â ¸í·É¿¡ µû¶ó¼­ ¸í·É¾îÀÇ »çÀÌÁî°¡ ´Ù¸£°Ô ¼³°è µÇ¾î ´Ü¼øÇÑ ÀÏÀ»ÇÏ´Â ¸í·É¾î´Â ÄÚµåÀÇ »çÀÌÁî°¡ ÀÛ°í º¹ÀâÇÑ ÀÏÀ» ¼öÇàÇÏ´Â ¸í·É¾î´Â »çÀÌÅ©°¡ Å®´Ï´Ù. ÀÌ·Î ÀÎÇؼ­ ÄÚµå »çÀÌÁî´Â ÀÛ¾Æ Á³À¸³ª °¢±â ´Ù¸¥ »çÀÌÁîÀÇ ¸í·É¾î¸¦ ¼öÇàÇϱâ À§ÇÑ H/W ¼³°è°¡ º¹ÀâÇØ Áö°í »ó´ëÀûÀ¸·Î RISC¿¡ ºñÇØ Àü·Â ¼Ò¸ð°¡ ¸¹¾ÆÁ³½À´Ï´Ù.

- Need small register
º¹ÀâÇÑ ÀÛ¾÷À» ¼öÇàÇÏ´Â ´Ù¾çÇÑ ¸í·É¾î µéÀÌ Àֱ⠶§¹®¿¡ RISC¿¡ ºñÇؼ­ ¸¹Àº ·¹Áö½ºÅÍ°¡ ÇÊ¿ä ÇÏÁö´Â ¾Ê½À´Ï´Ù.

2.3 General Register

ÇÁ·Î¼¼¼­ Äھ À§Ä¡ÇÏ°í ÀÖ°í ÇÁ·Î¼¼¼­°¡ Á¢±Ù °¡´ÉÇÑ °¡Àå ºü¸¥ Àӽà ±â¾ï ÀåÄ¡·Î ARM ÇÁ·Î¼¼¼­´Â ¾Æ·¡°ú °°Àº 3°¡Áö Á¾·ùÀÇ ·¹Áö½ºÅÍ°¡ ÀÖ½À´Ï´Ù.

(1) General Purpose Register : ÇÁ·Î±×·¥ µ¥ÀÌÅÍ Ã³¸®¿¡ »ç¿ëµË´Ï´Ù.
(2) Control Register : Stack Pointer, Link Register, Program Counter
- Stack Pointer´Â ÇöÀç ÇÁ·Î¼¼½º ¸ðµåÀÇ StackÀÇ Top ÁÖ¼Ò¸¦ °¡¸£Å°°í ÀÖ½À´Ï´Ù.
- Link Register´Â ¼­ºê·çƾ ºÐ±â½Ã ¼­¸£ºÎƾÀ» ³¡¸¶Ä¡°í º¹±Í ÇÒ ÁÖ¼Ò¸¦ °¡Áö°í ÀÖ½À´Ï´Ù.
- Program Count´Â ÇöÀç ½ÇÇà ÁßÀÎ ÁÖ¼Ò °ªÀÔ´Ï´Ù.
(3)Program Status Register : Processor ÀÇ »óÅÂÁ¤º¸¿Í ALUÀÇ °á°ú Á¤º¸¸¦ ÀúÀåÇÏ°í ÀÖ½À´Ï´Ù.

2.4 SFR(Special Function Register)

Âü°í·Î ÀÏ¹Ý ·¹Áö½ºÅÍ ¿Ü¿¡ Ưº°ÇÑ ·¹Áö½ºÅÍ°¡ Àִµ¥ ÁÖ·Î Processor ÁÖÀ§¿¡ ÀÖ´Â ÁÖº¯ ÀåÄ¡µéÀ» Á¦¾îÇϱâ À§Çؼ­ SFR (Special Function Register) °¡ ÀÖ½À´Ï´Ù. ÁÖ·Î Memory-Mapped ¹æ½ÄÀ¸·Î Á¢±ÙÀÌ µÇ°í ´ëºÎºÐ bit ´ÜÀ§·Î Á¦¾î°¡ µË´Ï´Ù.(AND, OR, EOR ... ) ±×¸®°í Memory-Mapped µÇ¾î ÀÖ´Ù´Â ¸»Àº SFRÀº °¢ ·¹Áö½ºÅÍ¿¡ ÇØ´çÇÏ´Â ÁÖ¼Ò°¡ Á¤ÇØÁ® ÀÖ¾î ÁÖ¼Ò¸¦ ÅëÇؼ­ Á¢±ÙÀÌ °¡´É ÇÏ´Ù´Â À̾߱â ÀÔ´Ï´Ù. S/W ¿£Áö´Ï¾î°¡ ARM Æß¿þ¾î ÇÁ·Î±×·¥À» ÇÑ´Ù°í ÇÏ¸é ´ëºÎºÐÀÇ ÀÛ¾÷ÀÌ ¹Ù·Î SFR ·¹Áö½ºÅ͸¦ ¼¼ÆÃÇÏ°í Á¦¾îÇÏ´Â ÀÏÀÔ´Ï´Ù.

¼ÒÇÁÆ®¿þ¾î ±¸¼º


¿¹Á¦·Î ¾Æ·¡ ±×¸²Àº ARM9 ÇÁ·Î¼¼¼­ÁßÀÇ ÇϳªÀÎ »ï¼ºÀÇ S3C2440ÀÇ UARTÁ¦¾î¸¦ À§ÇÑ SFR ·¹Áö½ºÅÍ ÀÔ´Ï´Ù.

¼ÒÇÁÆ®¿þ¾î ±¸¼º

ULCON0 ·¹Áö½ºÅÍÀÇ °æ¿ì 0x50000000 ¹øÁö¸¦ ÅëÇؼ­ Á¢±ÙÀÌ °¡´ÉÇÕ´Ï´Ù. 0x50000000 ¹øÁöÀÇ 32Bit ·¹Áö½ºÅÍ´Â °¢ ºñÆ®º°·Î ±â´ÉÀÌ ³ª´©¾îÁ® ÀÖ½À´Ï´Ù. 0 ~ 1 ºñÆ®´Â UART Åë½Å½Ã WordLength ¸¦ ¼³Á¤ÇÒ ¼ö ÀÖ°í, ·¹Áö½ºÅͺ°·Î °¢ ºñÆ®ÀÇ ±â´ÉÀÌ ¼¼ºÐÈ­ µÇ¾î ÀÖ½À´Ï´Ù.

S3C2440 CPU¿¡¼­ UART °ü·Ã SFRÀ» ¼¼ÆÃÇÏ´Â Äڵ带 ¿¹¸¦ µé¸é ´ÙÀ½°ú °°½À´Ï´Ù.

// S3C2440 CPUÀÇ UART SFR ·¹Áö½ºÅÍÀÇ ÁÖ¼Ò¸¦ Á¤ÀÇ ÇÕ´Ï´Ù.
#define rULCON0 (*(volatile unsigned *)0x50000000) //UART 0 Line control
#define rUCON0 (*(volatile unsigned *)0x50000004) //UART 0 Control
#define rUFCON0 (*(volatile unsigned *)0x50000008) //UART 0 FIFO control
#define rUMCON0 (*(volatile unsigned *)0x5000000c) //UART 0 Modem control
#define rUTRSTAT0 (*(volatile unsigned *)0x50000010) //UART 0 Tx/Rx status
#define rUERSTAT0 (*(volatile unsigned *)0x50000014) //UART 0 Rx error status
#define rUFSTAT0 (*(volatile unsigned *)0x50000018) //UART 0 FIFO status
#define rUMSTAT0 (*(volatile unsigned *)0x5000001c) //UART 0 Modem status
#define rUBRDIV0 (*(volatile unsigned *)0x50000028) //UART 0 Baud rate divisor

// Á¤ÀÇµÈ SFR ·¹Æ¼½ºÅÍÀÇ ÁÖ¼Ò¿¡ Á÷Á¢ °ªÀ» ½á ³ÖÀ» ¼ö ÀÖ½À´Ï´Ù.
rUFCON0 = 0x0; //UART channel 0 FIFO control register, FIFO disable
rUFCON1 = 0x0; //UART channel 1 FIFO control register, FIFO disable
rUFCON2 = 0x0; //UART channel 2 FIFO control register, FIFO disable
rUMCON0 = 0x0; //UART chaneel 0 MODEM control register, AFC disable
rUMCON1 = 0x0; //UART chaneel 1 MODEM control register, AFC disable

//UART0
rULCON0 = 0x3; //Line control register : Normal,No parity,1 stop,8 bits


2.5 ALU (Arithmetic Logic Unit)

(1) »ê¼ú ¿¬»ê ¼öÇà : ADD, SUB µî ¿¬»ê ¼öÇà
(2) ³í¸® ¿¬»ê ¼öÇà : AND, OR, XOR µî ¿¬»ê ¼öÇà
(3) Program Status Register Update : Negative, Zero, Carry, Overflow, Saturation(Sticky Overflow, ARM5TE ±¸Á¶¸¸ ÀÖÀ½)
Program Status Register Update ±â´ÉÀº Á¶°ÇºÎ ¸í·É°ú °ü·ÃÀÌ ÀÖ½À´Ï´Ù. Á¶°ÇºÎ ¸í·É¿¡ °üÇؼ­´Â ARM Instruction ¿¡¼­ ÀÚ¼¼È÷ ¼³¸í Çϵµ·Ï ÇÏ°Ú½À´Ï´Ù.

2.6 Control Unit

(1) ¸Þ¸ð¸®¿¡¼­ ¸í·ÉÀ» ÀÎÃâ ÇÕ´Ï´Ù.
(2) ÀÎÃâµÈ ¸í·ÉÀ» ºÐ¼®ÇÏ¿© ¾î¶² ¸í·ÉÀÎÁö ¾î¶² ·¹Áö½ºÅ͵éÀÌ »ç¿ëµÇ´ÂÁö¸¦ È®ÀÎ ÇÕ´Ï´Ù.
(3) ¸í·É¾î ½ÇÇà¿¡ ÇÊ¿äÇÑ Á¦¾î½ÅÈ£¸¦ ¸¸µé¾î ³»°í ½ÇÇà ÇÕ´Ï´Ù.

2.7 Bus

(1) CPU¿Í ¸Þ¸ð¸® »çÀÌÀÇ µ¥ÀÌÅÍ Åë·Î
(2) CPU : Bus Master, Memory : Bus Slave
(3) Bus´Â Address ¹ö½º¿Í Data ¹ö½º°¡ ÀÖ½À´Ï´Ù.

¼ÒÇÁÆ®¿þ¾î ±¸¼º

2.7.1 Von-Neumann Bus
CPU¿Í ¸Þ¸ð¸® »çÀÌ¿¡ ¹°¸®ÀûÀ¸·Î ÇϳªÀÇ ¹ö½º¸¸ Á¸Àç ÇÕ´Ï´Ù.

Von-Neumann Bus


2.7.2 Harvard-Architecture Bus
CPU¿Í ¸Þ¸ð¸® »çÀÌ¿¡ ¹°¸®ÀûÀ¸·Î 2°³ ÀÌ»óÀÇ Bus Á¸ÀçÇÏ¿© Von-Neumann Bus ±¸Á¶¿¡ ºñÇؼ­ CODE, DATA ¿¡ µ¿½Ã¿¡ Á¢±Ù ÇÒ ¼ö ÀÖ½À´Ï´Ù.

Harvard-Architecture

2.8 Processor ±âº» µ¿ÀÛ

(1) ¸í·É¾î ÀÎÃâ( Instruction Fetch )
¸í·É¾î¸¦ ij½Ã ȤÀº ¸Þ¸ð¸®¿¡¼­ ÀÐ¾î ¸í·É¾î ÆÄÀÌÇÁ ¶óÀο¡ ÀúÀå

(2) ¸í·É¾î Çص¶( Instruction Decoding )
¾î¶² ÀÏÀ» ÇÏ´Â ¸í·É¾î ÀÎÁö, ¾î¶² ·¹Áö½ºÅ͸¦ »ç¿ëÇÏ´ÂÁö Çص¶

(3) ¸í·É¾î ½ÇÇà( Instruction Execution )
ALU ¿¬»ê¼öÇà - ¸Þ¸ð¸® Á¢±Ù ¸í·É¾îÀÎ °æ¿ì ¸Þ¸ð¸® Á¢±ÙÀ» À§ÇÑ ÁÖ¼Ò °è»ê

(4) ¸Þ¸ð¸® Á¢±Ù( Memory Access )
- ALU ¿¬»ê¿¡ ÀÇÇØ °áÁ¤µÈ ÁÖ¼Ò¸¦ »ç¿ëÇÏ¿© ¸Þ¸ð¸® Á¢±Ù
- ¸Þ¸ð¸® Á¢±Ù ¸í·É¾î°¡ ¾Æ´Ñ°æ¿ì, °á°ú¸¦ ÇÑ »çÀÌŬ µ¿¾È ÀúÀå

(5) ·¹Áö½ºÅÍ ¾²±â( Register Write Back )
- ALU ¿¬»ê°á°ú¸¦ Regisger ¿¡ ±â·Ï
- ¸Þ¸ð¸®¿¡¼­ ÀÐÀº °ªÀ» Register ¿¡ ±â·Ï

2.9 Pipeline

- Cache¿Í ´õºÒ¾î ÇÁ·Î¼¼¼­ÀÇ ¼Óµµ¸¦ ȹ±âÀûÀ¸·Î °³¼± ÇÏ¿´½À´Ï´Ù.
- ÇϳªÀÇ ¸í·É¾î¸¦ ¿©·¯ °³ÀÇ µ¶¸³ÀûÀÎ ÀÛ¾÷µé·Î ³ª´©¾î º´·ÄÀûÀ¸·Î ½ÇÇà ÇÕ´Ï´Ù.

ARM7ÀÇ °æ¿ì 3´Ü ÆÄÀÌÇÁ ¶óÀÎÀ» °¡Áö°í Àִµ¥, ¾Æ·¡ 4°³ÀÇ ¸í·É¾î°¡ 󸮵Ǵ °úÁ¤À» ÆÄÀÌÇÁ ¶óÀÎÀÌ ÀÖÀ» °æ¿ì¿Í ¾øÀ» °æ¿ì·Î ³ª´©¾î¼­ ¼³¸íÇϵµ·Ï ÇÏ°Ú½À´Ï´Ù.

JOB1 : MOV R0, #0x1
JOB2 : MOV R1, #0x2
JOB3 : ADD R2, R0, R1
JOB4 : MOV R3, R2

* ÆÄÀÌÇÁ ¶óÀÎÀÌ ¾ø´Â ½Ã½ºÅÛ

¼ÒÇÁÆ®¿þ¾î ±¸¼º

ÆÄÀÌÇÁ ¶óÀÎÀÌ ¾ø´Â ½Ã½ºÅÛ¿¡¼­´Â 4°³ÀÇ ¸í·É¾î¸¦ ¼öÇàÇÏ´Â °¢ ´Ü°èº°·Î 3Cycle¾¿ ÃÑ 12CycleÀ» ¼Ò¸ðÇÏ°í ÀÖ½À´Ï´Ù.

* 3´Ü ÆÄÀÌÇÁ ¶óÀÎ ½Ã½ºÅÛ( ARM7 )

¼ÒÇÁÆ®¿þ¾î ±¸¼º

3´Ü ÆÄÀÌÇÁ ¶óÀÎÀÌ ÀÖ´Â ½Ã½ºÅÛ¿¡¼­´Â 4°³ÀÇ ¸í·É¾î¸¦ ¼öÇàÇϴ óÀ½ ´Ü°è¿¡¸¸ 3CycleÀ» ¼Ò¸ðÇÏ°í ´ÙÀ½ ºÎÅÍ´Â 1CycleÀÌ ¼Ò¸ðµÇ¾î ÃÑ 6CycleÀ» ¼Ò¸ðÇÏ°í ÀÖ´Ù. °á°úÀûÀ¸·Î ÆÄÀÌÇÁ ¶óÀÎÀÌ ¾ø´Â ½Ã½ºÅÛ º¸´Ù 2¹è Á¤µµÀÇ ¼º´É Çâ»óÀ» °¡Á® ¿É´Ï´Ù.

- F(Instruction Fetch), D(Instruction Decoding), E(Instruction Execution)
- À§ÀÇ ¿¹´Â ¸ðµç ¸í·É¾î°¡ ij½Ã¿¡ À־(±×·¯¹Ç·Î ¸ðµç °úÁ¤ÀÌ 1Cycle À̳»¿¡ ó¸®) ¸ÞÀÎ ¸Þ¸ð¸® Á¢±ÙÀÌ ¾ø´Ù´Â °¡Á¤ ÇÏ¿¡¼­ ¼öÇàµÇ´Â °á°ú ÀÔ´Ï´Ù. ¸¸¾à ÇÁ·Î¼¼¼­°¡ Áָ޸𸮿¡ Á¢±ÙÇØ¾ß ÇÏ´Â ÀÏÀÌ ¹ß»ýÇÑ´Ù¸é Ãß°¡·Î ¸Þ¸ð¸® Á¢±Ù ÆÄÀÌÇÁ¶óÀÎ ´Ü°è°¡ ÇÊ¿ä ÇÏ°Ô µË´Ï´Ù

¼ÒÇÁÆ®¿þ¾î ±¸¼º

Áö±Ý±îÁö ¼³¸íÇÑ ÇÁ·Î¼¼¼­ÀÇ ±âº» µ¿ÀÛÀ» À§ÀÇ ±×¸²(ARM7TDMI Processor Block Diagram)À¸·Î ¼³¸íÀ» Çϸé, [1] ¸Þ¸ð¸®¿¡¼­ ¸í·É¾î¸¦ FetchÇÏ¿© Instruction Pipeline¿¡ Áý¾î ³Ö°í [2] ±× ¸í·É¾î¸¦ Control unit ¿¡¼­ Çص¶ÇÏ°í [3]ALU¿¡¼­ ½ÇÇà, [4]¸Þ¸ð¸® Á¢±Ù ¸í·ÉÀÇ °æ¿ì ¸Þ¸ð¸® Á¢±ÙÇÒ ÁÖ¼Ò °è»ê, [5] ±×¸®°í °á°ú¸¦ ´Ù½Ã Register¿¡ Write ÇÏ°í ÀÖ½À´Ï´Ù. [2] ¿¡¼­ Instruction Decoder´Â ¸í·É¾î¸¦ Àо Çؼ®ÇÏ´Â ÀÏÀ» Çϸç, ÀÌ¿¡ ´ëÇÏ¿© Control UnitÀº °¢Á¾ Á¦¾î ½ÅÈ£¸¦ ¹ß»ýÇÏ°Ô µË´Ï´Ù. ¿¹¸¦ µé¾î ALU¿¡°Ô ´õÇϱ⸦ Ç϶ó´Â ½ÅÈ£¸¦ ¹ß»ý ½ÃŲ´Ù´ø°¡, ¶Ç´Â ¸Þ¸ð¸®¿¡°Ô ƯÁ¤ ÁÖ¼Ò¸¦ ReadÇÒ ¼ö ÀÖµµ·Ï ½ÅÈ£¸¦ ¹ß»ý½ÃŲ´Ùµç°¡ ÇÏ´Â ¿©·¯ °¡Áö Control signalµé ÀÔ´Ï´Ù.


3. ÇÁ·Î¼¼¼­ ¼º´É
3.1 CPU ¼º´É Áõ°¡ ±â¹ýµé

(1) Clock
CPU ¼º´ÉÀ» ³ôÀ̴µ¥ °¡Àå ÀϹÝÀûÀÎ ¹æ¹ýÀ¸·Î ´Ü¼øÈ÷ CPUÀÇ µ¿ÀÛ Å¬·°À» ³ôÀÌ´Â ¹æ¹ýÀÌ ÀÖ½À´Ï´Ù. ´ç¿¬È÷ °°Àº ÀÛ¾÷À» ÇÒ¶§ CPU Tick ½Ã°£ÀÌ ºü¸¥ CPU°¡ ±×·¸Áö ¾ÊÀº CPUº¸´Ù ºü¸£°Ô µ¿ÀÛÀ» ÇÏ°ÚÁö¿ä.

(2) Execution Optimization

¾Æ·¡ ³»¿ëµéÀº °£´ÜÈ÷ °³³ä Á¤µµ¸¸ ¼³¸íÇϵµ·Ï ÇÏ°Ú½À´Ï´Ù. °¢ Ç׸ñ Çϳª¿¡ ´ëÇÑ À̷и¸ ÇÏ´õ¶óµµ ºÐ·®ÀÌ »ó´çÇÒ°Í °°½À´Ï´Ù.

- Pipeline : ±âº» °³³äÀº ÇϳªÀÇ ¸í·É¾î¸¦ ¿©·¯°³ÀÇ µ¶¸³µÈ ÀÛ¾÷À¸·Î ³ª´©¾î º´·ÄÀûÀ¸·Î ½ÇÇà. PipelineÀº ÀÌÀü¿¡µµ Çѹø ¼³¸í ÇÏ¿´½À´Ï´Ù.

- Branch prediction(ºÐ±â¿¹Ãø) : Á¤»óÀûÀÎ ÇÁ·Î±×·¥ È帧¿¡¼­ ºÐ±â¸¦ ÇϰԵǸé PipelineÀÌ ¹«³ÊÁö°Ô µÇ´Âµ¥ ÀÌ·¸°Ô µÇ¸é ´Ù½Ã Pipeline¿¡ ¸í·É¾î°¡ ÀûÀçµÇ¾î ½ÇÇàÀÌ µÇ±â±îÁö CPU´Â Stall ÇÏ°Ô µË´Ï´Ù. À̸¦ ¹æÁöÇϱâ À§Çؼ­ ÇÁ·Î¼¼¼­°¡ ºÐ±â¹®À» ½ÇÇàÇϱ⵵ Àü¿¡ ºÐ±â ÁöÁ¡À» ¿¹ÃøÇÏ¿© PipelineÀ» ´Ù½Ã ÀûÀçÇÏ´Â ±â´É ÀÔ´Ï´Ù. ¹°·Ð ºÐ±â°¡ µÇ´Â ÁöÁ¡À» ÇÁ·Î¼¼¼­¿¡¼­ 100% ¿¹ÃøÇÒ¼ö´Â ¾ø½À´Ï´Ù. ¿¹ÃøÀÌ ¸ÂÀ¸¸é ÁÁÀº°Å°í(PipelineÀÌ ¹«³ÊÁöÁö ¾ÊÀ½), Ʋ·ÈÀ» °æ¿ì¿¡´Â ¿ø»óÅ·Πº¹±¸ÇÏ´Â Ãß°¡ ÀÛ¾÷ÀÌ ÆÞ¿ä ÇÕ´Ï´Ù. ºÐ±â ¿¹Ãø¿¡´Â µ¿Àû¿¹Ãø, Á¤Àû ¿¹Ãø µî ¿©·¯°¡Áö ¹æ¹ýÀÌ ÀÖ½À´Ï´Ù.

- Out-of-order execution

Address: Instructions

0x0004 : a = b + c
0x0008 : d = a + b
0x000c : z = x + y

À§ÀÇ ¿¹Á¦¿¡¼­ º¸Åë ÇÁ·Î¼¼¼­´Â 0x0004 ¹øÁöºÎÅÍ ¼øÂ÷ÀûÀ¸·Î 0x0008, 0x000c ¹øÁö·Î ½ÇÇàÀÌ µÇ´Âµ¥, ÀÚ¼¼È÷ º¸¸é 0x0008¹øÁö´Â "a", "b" ¿Í ¿¬°üÀÌ Àֱ⠶§¹®¿¡ 0x0004¹øÁö°¡ ¹Ýµå½Ã ¸ÕÀú ½ÇÇàÀÌ ¿Ï·á°¡ µÉ¶§±îÁö ±â´Ù¸° ÀÌÈÄ¿¡ ½ÇÇàÀÌ µÇ¾î¾ß ÇÕ´Ï´Ù. CPUÀÔÀå¿¡¼­ º¸¸é ÀÏÀ» ÇÏÁö ¸øÇÏ´Â À¯ÈÞÇÑ ½Ã°£ÀÌ µÇ°ÚÁö¿ä. ÇÏÁö¸¸ 0x000c ¹øÁö ó·³ ÀÌÀüÀÇ ½ÇÇà³»¿ë°ú ¹«°üÇÏ´Ù¸é 0x0008¹øÁö º¸´Ù ¸ÕÀú ½ÇÇàÀÌ µÉ¼öµµ ÀÖ°Ô ÇÏ´Â °ÍÀÔ´Ï´Ù. ¹°·Ð ¼ÒÇÁÆ®¿þ¾î °³¹ßÀÚ ÀÔÀå¿¡¼­´Â ÀÌ·¯ÇÑ ¹®Á¦¿¡ ½Å°æ¾²Áö ¾Ê¾Æµµ ½Ã½ºÅÛ¿¡¼­ ¾Ë¾Æ¼­ ÇØÁÖÁÒ. ÀÌ°ÍÀ» S/W °³¹ßÀÚ°¡ ¸ðµÎ »ý°¢Çϸ鼭 ÀÛ¾÷À» ÇØ¾ß ÇÑ´Ù¸é ¾öµÎ°¡ ³ªÁö ¾Ê°ÚÁÒ..

- Superscalar
CPU´Â ÇÑ Å¬·°¿¡ Çϳª¾¿ÀÇ ¸í·É¾î¸¦ ó¸®ÇÏ°Ô µÇ¾îÀÖ½À´Ï´Ù. À̸¦ °³¼±Çؼ­ µ¿½Ã, ȤÀº ÇÑ »çÀÌŬ ¹Ì¸¸À¸·Î µÑ ÀÌ»óÀÇ ¸í·É¾î¸¦ ó¸®ÇÏ´Â ¹æ½ÄÀ¸·Î ½´ÆÛ½ºÄ®¶ó µîÀÇ ¹æ½ÄÀÌ ³ª¿ÔÀ¸¸ç, ÀÌ´Â ÆÄÀÌÇÁ¶óÀÎÀ» ³ª´©¾î ÈÞÁö »óÅÂÀÇ Çϵå¿þ¾î¸¦ È°¿ëÇϵµ·Ï ÇÏ´Â ¹æ½ÄÀ» »ç¿ëÇÕ´Ï´Ù. ÀÌó·³ º´·Ä¿¬»ê ±¸Á¶´Â °ãÄ¡Áö ¾Ê´Â ¸í·É¾î¸¦ º´·Ä·Î µ¿½Ã ÁøÇàÇÔÀ¸·Î¼­ ÇÁ·Î¼¼¼­ÀÇ ³»ºÎ¿¡¼­ ÀÛµ¿À» ´ë±âÇϸç ÈÞÁö »óÅ·ΠÀÖ´Â ÆÄÆ®¸¦ ÁÙÀÓÀ¸·Î¼­ ÀÛ¾÷È¿À²À» ³ô¿© ¿¬»ê ¼Óµµ¸¦ Çâ»ó½ÃÅ°´Â °Í¿¡ ¸ñÀûÀÌ ÀÖ½À´Ï´Ù. ¸í·É¾î ½ºÄÉÁÙÀ» H/W¿¡ ÀÇÁ¸ÇÕ´Ï´Ù. Multi-ALU ±â´ÉÀ¸·Î ÇÑ Å¬·°¿¡ ¿©·¯ ¸í·É¾î µéÀ» fetch Çؼ­ µ¿½Ã¿¡ ¿©·¯ ¸í·É¾î µéÀ» ½ÇÇà ½Ãų ¼ö ÀÖ¾î CPI(Clock per Instruction)°¡ 1º¸´Ù ÀÛ¾Æ Áú¼öµµ ÀÖÀ½. µ¥ÀÌÅÍ ÀÇÁ¸¼º, ÀÚ¿ø ÀÇÁ¸¼º, ÇÁ·Î½ÃÀú ÀÇÁ¸¼ºÀÌ Á¸ÀçÇÏ´Â °æ¿ì¿¡´Â µ¿½Ã¿¡ ½ÇÇàµÇ¾î¼­´Â ¾ÈµË´Ï´Ù. µµÀÔÇÑ ¿¡·Î´Â IBM RS/6000, DEC 21064, Intel i960CA µîÀÌ ÀÖ½À´Ï´Ù.

- VLIW (Very Long Instruction Word)
VLIW´Â ILP(Instruction Level Parallelism)¸¦ ÃÖ´ëÇÑ È°¿ëÇؼ­ º´·Ä ¿¬»êÀ» ÁøÇàÇϸç, À̸¦ ÇϳªÀÇ ±ä ¸í·É¾î Çü½Ä ³»¿¡ µ¿½Ã¿¡ ½ÇÇàµÉ ¼ö ÀÖ´Â ¸í·É¾î(¿¬»ê ÄÚµå ¹× ¿ÀÆÛ·£µå)µéÀ» ¿©·¯ °³ Æ÷ÇÔ½ÃÅ´À¸·Î½á °¢¸í·É¾î ´ÜÀ§¸¦ ÀÎÃâÇØ ½ÇÇàÇÒ ¶§ ¸¶´Ù ¿©·¯ ¿¬»êÀÌ µ¿½Ã¿¡ ½ÇÇàµÇµµ·Ï ÇÏ´Â ¹æ½Ä ÀÔ´Ï´Ù. ¸í·É¾î ÄÚµå´Â ±æÁö¸¸ Çϳª·Î Ãë±ÞµÇ±â ¶§¹®¿¡ ÀÎÃâ°ú Çص¶Àº ÇϳªÀÇ È¸·Î¿¡ ÀÇÇØ ÀÌ·ç¾îÁö°í, °¢ ¿¬»êÀÇ ½ÇÇà »çÀÌŬ¸¸ ¿©·¯ °³ÀÇ À¯´ÏÆ®(ALU¸¦ ºñ·ÔÇÑ Function unit)µé·Î ³ª´©¾îÁ® µ¿½Ã¿¡ ó¸®µÇ°Ô µÈ´Ù. ÄÄÆÄÀÏ·¯´Ü¿¡¼­ ¸í·É¾îÀÇ ¹èÄ¡°¡ ÀÌ·ç¾î Áö´Â ¹æ½ÄÀÔ´Ï´Ù. ÇϳªÀÇ ¸í·É¾î ÄÚµåÀÇ ±æÀÌ°¡ 128, 256, 512 ºñÆ®´ÜÀ§·Î ±¸¼ºµÇ¾î Áú¼ö ÀÖ½À´Ï´Ù. VLIW¸¦ µµÀÔÇÑ ¿¹·Î TI C6000 Series, ATI GPU core, Intel Itanium µîÀÌ ÀÖ½À´Ï´Ù.

Superscalar¿Í VLIW°¡ ºñ½ÁÇÏ°Ô »ý°¢ µÇ¾îÁú ¼ö Àִµ¥, ½´ÆÛ½ºÄ®¶ó(superscalar)´Â CPU ³»¿¡ ÆÄÀÌÇÁ¶óÀÎÀ» ¿©·¯ °³ µÎ¾î ¸í·É¾î¸¦ µ¿½Ã¿¡ ½ÇÇàÇÏ´Â ±â¼úÀÔ´Ï´Ù. ¸í·É¾î¸¦ µ¿½Ã¿¡ ½ÇÇà ½ÃÅ°±â À§Çؼ­ ALU°¡ ¿©·¯°³ ÀÖ¾î¾ß ÇÕ´Ï´Ù. VLIW´Â 1°³ÀÇ ±ä ¸í·É¾î ¾È¿¡ ¿©·¯°³ÀÇ ¸í·É¾îµéÀ» ÀÎÃâÇÏ¿© µ¿½Ã¿¡ ½ÇÇàÇÏ´Â ±â¼úÀÔ´Ï´Ù.

(3) Cache
CPU ¼º´ÉÀ» ³ôÀÌ´Â ¹æ¹ýÀ¸·Î ¿äÁîÀ½ µðºÎºÐÀÇ CPUµéÀº Cache¸¦ »ç¿ëÇÕ´Ï´Ù. ij½Ã°¡ »ý°Ü³ª°ÔµÈ ¹è°æÀº ÀϹÝÀûÀ¸·Î ÇÁ·Î±×·¥Àº Çѹø ÂüÁ¶Çß´ø ¸í·É¾î³ª µ¥ÀÌÅÍ´Â ´Ù½Ã ÂüÁ¶ ÇÒ °¡´É¼ºÀÌ ³ô´Ù´Â µ¥¼­ ±âÀÎ ÇÕ´Ï´Ù. À̸¦ ÂüÁ¶ÀÇ Áö¿ª¼º À̶ó°í ÇÕ´Ï´Ù. ÂüÁ¶ÇÒ µ¥ÀÌÅÍ°¡ °¡±î¿îÁÖ¼ÒÀÇ ¿µ¿ª¿¡ Àִ Ư¼ºÀ» °ø°£Àû Áö¿ª¼º(Spatial locality)¶ó ÇÏ°í ÃÖ±Ù¿¡ ÂüÁ¶Çß´ø ÁÖ¼Ò¸¦ ´Ù½Ã ÂüÁ¶ÇÒ °¡´É¼ºÀÌ ³ôÀº Ư¼ºÀ» ½Ã°£Àû Áö¿ª¼º(Temporal locality) À̶ó°í ÇÕ´Ï´Ù. ÀÌ·¯ÇÑ Æ¯¼ºÀ» °¡Áö°í ij½ÃÀÇ ºí·°Àº ÃÖ±Ù¿¡ ÂüÁ¶Çß´ø ÁÖ¼ÒÀÇ µ¥ÀÌÅ͸¦ ºí·°´ÜÀ§·Î SRAM ij½Ã °ø°£¿¡ ÀúÀåÀ» Çؼ­ CPU¿¡¼­ ¼Óµµ°¡ ´À¸° ¸ÞÀθ޸ð¸®ÀÇ Á¢±ÙÀ» ÃÖ¼ÒÈ­ Çϵµ·Ï ÇÕ´Ï´Ù.

3.2 CPU Clock Áõ°¡ÀÇ ÇÑ°èÁ¡

(1) Clock
2000³âµµ Áß¹Ý ÀÌÈÄ CPUÀÇ Å¬·Ï ¼Óµµ´Â ´õ ÀÌ»ó ±Þ°ÝÇÏ°Ô Áõ°¡ÇÏ°í ÀÖÁö ¾ÊÀ½. Ŭ·Ï ¼Óµµ°¡ Áõ°¡Çϸé Àü·Â ¼Òºñ¹× ´©¼³Àü·ù Áõ°¡¿Í ÇÔ²² ½ÉÇÑ ¹ß¿­ÀÌ ¹ß»ýÇÏ°í ÀÌ·ÎÀÎÇØ º¹ÀâÇÑ Ä𸯠½Ã½ºÅÛ ¼³°è°¡ ÇÊ¿äÇØ Áý´Ï´Ù. ¿¹ÀüÀÇ Pentium ½Ì±ÛÄÚ¾î CPUµéÀÇ Äð¸µÆÒÀ» »ý°¢ÇÏ¸é ¹ß¿­µîÀÌ ¾î´ÀÁ¤µµ ÀÎÁö ÁüÀÛÀÌ °©´Ï´Ù.

Âü°í. Moore’s Law
1965³â¿¡ ¹ßÇ¥ µÇ¾ú°í, ±× Àǹ̴ "¸¶ÀÌÅ©·ÎĨÀÇ °¡°ÝÀº 18°³¿ù ¸¶´Ù Àý¹ÝÀ¸·Î Ç϶ô" ÇÏ°í "¸¶ÀÌÅ©·ÎĨÀÇ ¼º´ÉÀº 18°³¿ù ¸¶´Ù 2¹è·Î ¹ßÀüÇÑ´Ù." ´Â ÀǹÌÀÌ´Ù.
2000³âµµ Á߹ݱîÁö ¹ýÄ¢ÀÌ ¸Â¾Æ ¿ÔÀ¸³ª ÃÖ±Ù¿¡´Â ¼º´ÉÀÌ 2¹è·Î ¹ßÀüÇÑ´Ù´Â ¹ýÄ¢Àº ÇÑ°èÁ¡¿¡ µµ´ÞÇÏ°í ÀÖ´Ù.

3.3 Multi Core Processor

(1) Hyper Threading
- ÇϳªÀÇ CPU¿¡¼­ 2°³ ÀÌ»óÀÇ Thread¸¦ º´·ÄÀûÀ¸·Î ¼öÇà ½ÃÅ´. ¾ö¹ÐÈ÷ À̾߱â Çϸé Multi Core Process´Â ¾Æ´Õ´Ï´Ù.
- Hyper threaded CPU´Â Ãß°¡ÀûÀÎ ·¹Áö½ºÅÍµé ¹× Çϵå¿þ¾î°¡ ÇÊ¿ä ÇÔ

(2) Multi Core
- ÇϳªÀÇ CPU ³»ºÎ¿¡ µÎ °³ ÀÌ»óÀÇ Processor Äھ µÎ¾î °¢°¢ÀÇ Processor¿¡¼­ ÇÁ·Î±×·¥À» ¼öÇà ½Ãŵ´Ï´Ù.
- Homogeneous : µ¿ÀÏÇÑ, ±ÕÁúÀÇ - ¶È°°Àº Á¾·ùÀÇ CPU¸¦ ¿©·¯°³ °¡Áö°í ÀÖÀ½
- Heterogeneous :  ÀÌÁ¾È¥ÇÕ(CPU+GPU) - ÀÎÅÚ ¿ïÆ®¶óºÏ µî ¿¡¼­ »ç¿ëÇÏ´Â CPUµé

(3) Memory Wall
- Core °³¼ö°¡ ¸¹À» ¼ö·Ï ÇÑ Äھ ¸Þ¸ð¸®¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Â ±âȸ°¡ Àû¾îÁü.
- CoreÀÇ °³¼ö°¡ 8°³ ÀÌ»ó Áõ°¡µÇ¸é, ¿ÀÈ÷·Á ¸Þ¸ð¸® ´ë¿ªÆø ¼º´ÉÀÌ °¨¼ÒµÊ

(4) Parallel Programming
- Multi Core ½Ã½ºÅÛ¿¡¼­ ¼º´ÉÀ» ³ôÀ̱â À§Çؼ­´Â º´·Ä ÇÁ·Î±×·¡¹Ö È¿À²¿¡ ´Þ·Á ÀÖÀ½(The Free Lunch is Over)
- Àΰ£ÀÇ º¸ÆíÀûÀÎ »ç°í¸¦ ¶Ù¾î ³Ñ¾î¾ß ÇÏ´Â ¾î·Á¿ò

- ÄÄÆÄÀÏ·¯ÀÇ ¼º´ÉÀÌ ±×´ÙÁö ¶Ù¾î³ªÁö ¸øÇÔ

Âü°í. The Free Lunch is Over


A fundamental turn toward concurrency in software.

¿¹Àü¿¡´Â ¼ÒÇÁÆ®¿þ¾î °³¹ßÀÚµéÀÌ ¸ÖƼÄÚ¾îµîÀ» ½Å°æ¾²Áö ¾Ê°í °³¹ßÀ» Çصµ Çϵå¿þ¾î ¼º´ÉÀÌ ±Þ°ÝÇÏ°Ô ¹ß´ÞÀÌ µÇ¾î ¼ÒÇÁÆ®¿þ¾î ¼º´ÉÀÌ °³¼±µÇ¾úÀ¸³ª ÃÖ±Ù¿¡´Â ¹«¾îÀÇ ¹ýÄ¢¿¡µµ ÇÑ°èÁ¡ÀÌ µµ´ÞÇß°í ¸¶ÀÌÅ©·Î ÇÁ·Î¼¼¼­ÀÇ ¼º´É °³¼±ÀÇ ¹æ¹ýÀ¸·Î ¸ÖƼÄÚ¾îÂÊÀ¸·Î ÁøÈ­ÇÏ°í ÀÖ¾î, °³¹ßÀÚµéÀÌ ¼ÒÇÁÆ®¿þ¾î ¼º´ÉÀ» °³¼±Çϱâ Çؼ­´Â µ¿½Ã¼ºµîÀ» °í·ÁÇÏ¿© °³¹ßÀ» ÇØ¾ß ÇÏÁö¸¸, ÀÌ°ÍÀº ½¬¿î ¹®Á¦°¡ ¾Æ´Õ´Ï´Ù.

- Refer to
Dr. Dobb’s Journal, 30(3), March 2005
http://www.gotw.ca/publications/concurrency-ddj.htm



4. Embedded Software
4.1 Machine & Language

(1) ±â°è¾î( Machine Code )
- Processor (CPU)°¡ ÀÌÇØÇÏ´Â 0°ú 1·Î ÀÌ·ç¾îÁø µðÁöÅÐ ½ÅÈ£
- Processor Á¦Á¶»ç¸¶´Ù ÄÚµå ¹æ½ÄÀÌ ¸ðµÎ ´Ù¸§
- °³¹ßÀÚ°¡ ±â°è¾î¸¦ »ç¿ëÇÏ¿© ÇÁ·Î±×·¥ ÇÏ´Â °ÍÀº °ÅÀÇ ºÒ°¡´É : ¿¹Àü¿¡´Â ±â°è¾î·Î Á÷Á¢ ÇÁ·Î±×·¥À» Çß´Ù°í ÇÏ´Â ºÐµéµµ °è½Ã´Âµ¥ ÇÊÀÚ´Â ±×·± Á¤µµÀÇ ¼¼´ë´Â ¾Æ´Ï¾î¼­ Çغ¸Áö´Â ¸øÇßÁö¸¸, »ý°¢¸¸ Çصµ ¸Ó¸®°¡ Áö²ö ¾ÆÆÄ ¿À³×¿ä.

(2) ¾î¼Àºí¸®¾î( (Assembly Code )
- ±â°è¾î ÀÛ¼ºÀÇ ºÒÆíÇÔÀ» ±Øº¹Çϱâ À§Çؼ­ Processor Á¦Á¶»ç¿¡¼­ Á¤ÀÇÇÔ.
- 󸮼ӵµ°¡ ±â°è¾î¿Í °°À½( ±â°è¾î¿Í 1:1 ·Î ¸ÅĪ )
- Processor Core ¸¶´Ù ¾î¼Àºí¸® Äڵ尡 ´Ù¸§ : ARM, MIPS, x86 ¸í·É¾îµé ..
- °¡µ¶¼º( Readability ) ÀÌ ±â°è¾îº¸´Ù ÈξÀ ÁÁÁö¸¸ ¿©ÀüÈ÷ º¸ÅëÀÌ °³¹ßÀÚ¿¡°Ô´Â ½±Áö ¾ÊÀ½

(3) C Language
- Assembly ¸í·É¾îµéÀÇ ´ÜÁ¡À» ±Øº¹ÇÑ ¾ð¾î
- ÀÓº£µð½º S/W °³¹ß¿¡ °¡Àå ¸¹ÀÌ ÀÌ¿ëµÊ
- ¾î¼Àºí¸®º¸´Ù °¡µ¶¼ºÀÌ ¸Å¿ìÁÁ°í °ü¸®°¡ ÆíÇÔ
- ±¸Á¶Àû, ¸ðµâÈ­ ÇÁ·Î±×·¡¹Ö °¡´É
- ¾î¼Àºí¸®Ã³·³ Çϵå¿þ¾î Á÷Á¢Á¦¾î °¡´É

4.2 ÄÄÆÄÀÏ·¯

(1) C¾ð¾î ¹ø¿ª±â
- C·Î Ç¥ÇöµÈ ¾ð¾î¸¦ ¾î¼Àºí¸®·Î ¹ø¿ªÇÏ°í ¿ÀºêÁ§Æ® ÆÄÀÏ·Î º¯È¯ ½ÃŲ´Ù.
- »ç¿ëÇÏ·Á´Â ProcessorÄھ ¸Â´Â ÄÄÆÄÀÏ·¯¸¦ »ç¿ëÇØ¾ß ÇÔ
- C·Î Ç¥ÇöµÈ ÇÁ·Î±×·¥À» ARMÄÚ¾î CPU ¿¡¼­ µ¿ÀÛ½ÃÅ°±â À§Çؼ­´Â ARM ÄÄÆÄÀÏ·¯¸¦ »ç¿ë ÇØ¾ß ÇÔ. º¸ÅëÀº x86 PC¿¡¼­ °³¹ß(ÄÚµù) ÇÑÈÄ ARM¿ë ÄÄÆÄÀÏ·¯¸¦ ÀÌ¿ëÇؼ­ ÄÄÆÄÀÏÀ» ÇÑÈÄ Å¸°ÙÀÌ µÇ´Â ARM CPU ¿¡ ´Ù¿î·Îµå(ǻ¡) ÇÏ¿© ½ÇÇà ½ÃÅ´. x86 PC¿¡¼­ »ç¿ëÇÏ´Â ARM¿ë ÄÄÆÄÀÏ·¯¸¦ Cross Compiler ¶ó°í ÇÔ. ARM¿ë Å©·Î½º ÄÄÆÄÀÏ·¯·Î´Â KEIL MDK, IAR Workbench(EWARM), ADS, RVDS, ARM¿ë GCC(ÁÖ·Î ¸®´ª½º °³¹ßȯ°æ¿¡¼­ »ç¿ë) µîÀÌ ÀÖÀ½.

(2) ¿ÀºêÁ§Æ® ÆÄÀÏ
- ¾î¼Àºí¸® ÄÚµå ¼½¼Ç, µ¥ÀÌÅÍ ¼½¼Ç
- µð¹ö±ë Á¤º¸
- ½Éº¼ Á¤º¸

4.3 ¾î¼Àºí·¯

¾î¼Àºí¸® ¾ð¾î¸¦ ±â°è¾î(¿ÀºêÁ§Æ® ÆÄÀÏ)·Î º¯È¯ ÇÕ´Ï´Ù. ¾î¼Àºí·¯¿Í ¾î¼Àºí¸® ¾ð¾î¸¦ È¥µ¿ÇÏ¸é ¾ÈµË´Ï´Ù. ¾î¼Àºí¸® ¾ð¾î´Â Äڵ带 ÀÛ¼ºÇÏ´Â ¾ð¾îÀÌ°í, ¾î¼Àºí·¯´Â ÀÛ¼ºµÈ ¾î¼Àºí¸® ¾ð¾î¸¦ ±â°è¾î·Î º¯È¯ ½ÃÅ°´Â ¿ªÇÒÀ» ÇÕ´Ï´Ù.

4.4 Linker
- ¿©·¯ ÄÚµå¹× µ¥ÀÌÅÍ ¼½¼Çµé¿¡ ¹Ì¸® Á¤ÀÇµÈ ÁÖ¼Ò¸¦ ÇÒ´çÇÕ´Ï´Ù.
- ÀÌ¹Ì ºôµåµÈ ¶óÀ̺귯¸®µéÀÌ ÇÔ²² »ç¿ë µÉ ¼ö ÀÖ½À´Ï´Ù.
- ¸µÅ© ÀÛ¾÷½Ã °°Àº ¼Ó¼ºÀÇ ¼½¼Çµé(.text, .ro, .rw)À» °°ÀÌ ¹­¾îÁÖ´Â ÀÛ¾÷µµ ÇÕ´Ï´Ù.

¿©±â±îÁö ÄÄÆÄÀÏ·¯, ¾î¼Àºí·¯, ¸µÄ¿µî °¢°¢ÀÌ ÇÏ´Â ÀϵéÀ» »ìÆì º¸¾Ò½À´Ï´Ù. ±×·¸´Ù¸é ÄÄÆÄÀÏÇÏ°í, ¾î¼ÀºíÇÏ°í, ¸µÅ©ÀÛ¾÷±îÁö ¿Ï·á°¡ µÇ¸é »ý¼ºµÇ´Â ½ÇÇà°¡´ÉÇÑ Binary ´Â ¾î¶² ±¸Á¶·Î Çؼ­ ¸¸µé¾î Áö´Â °ÍÀϱî¿ä. ¾Æ·¡ ±×¸²À» ÅëÇؼ­ ¾Ë¾Æ º¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.

¼ÒÇÁÆ®¿þ¾î ±¸¼º

*.c ÆÄÀÏÀ» ÄÄÆÄÀÏ Çϸé *.s ÆÄÀÏÀÌ »ý¼ºµÇ°í *.s ÆÄÀÏÀ» ¾î¼Àºí Çϸé *.o ÆÄÀÏÀÌ »ý¼ºÀÌ µÇ°í *.o ÆÄÀϵé°ú ´Ù¸¥ ¶óÀ̺귯¸® ÆÄÀϵé(*.a) À» Link ½ÃÅ°¸é ½ÇÇà °¡´ÉÇÑ bin ÆÄÀÏÀÌ »ý¼ºÀÌ µË´Ï´Ù. ±×·¯¸é Linker´Â ¿©·¯°³ÀÇ *.o ÆÄÀϵéÀ» ¾î¶»°Ô ¹­¾î¼­ bin ÆÄÀÏÀ» »ý¼ºÇÏ´Â °É±î¿ä? ÀÌ°ÍÀ» ¾Ë·Á¸é *.o ÆÄÀÏÀÇ ±¸Á¶¿Í ¸µÅ©½ºÅ©¸³Æ® ÆÄÀÏ¿¡ ´ëÇؼ­ ¾Ë¾Æ¾ß ÇÕ´Ï´Ù. ¸µÅ©½ºÅ©¸³Æ® ÆÄÀÏÀº ³ªÁß¿¡ ´Ù½Ã À̾߱â Çϵµ·Ï ÇÏ°í ¿ì¼± *.o ÆÄÀÏ¿¡ ´ëÇؼ­¸¸ ÀÚ¼¼È÷ º¸µµ·Ï ÇսôÙ.

¾Æ·¡ ÀϹÝÀûÀÌ *.c ÆÄÀÏÀÌ ÀÖ½À´Ï´Ù. °¢ º¯¼öµé°ú ÇÔ¼öµéÀÌ ¸Þ¸ð¸® »ó¿¡ ¾î¶»°Ô ÀÚ¸®¸¦ Àâ´ÂÁö RO, RW, ZI ¿µ¿ªÀ¸·Î ±¸ºÐÇØ º¸¼¼¿ä.
Âü°í·Î 0 À¸·Î ÃʱâÈ­ µÇ°Å³ª °ªÀÌ ÇÒ´çµÇÁö ¾ÊÀº º¯¼ö´Â ZI(Zero-initialized) ¿µ¿ª,
ÃʱⰪÀÌ Àü¿ª º¯¼ö´Â RW(read-write) ¿µ¿ª,
Äڵ峪 º¯°æ ºÒ°¡´ÉÇÑ º¯¼ö´Â RO(Read only) ¿µ¿ªÀ¸·Î ÇÒ´çÀÌ µË´Ï´Ù.
RW, ZI, RO´Â GCC µî¿¡¼­´Â °¢°¢ .data, .bss, .constdata + .text ·Î ºÒ¸®±âµµ ÇÕ´Ï´Ù. Áï RW = .data, ZI = .bss, RO = .constdata + .text °¡ µË´Ï´Ù.

¼ÒÇÁÆ®¿þ¾î ±¸¼º

Á¤´äÀº ¾Æ·¡¿Í °°½À´Ï´Ù. ¾Æ·¡ ¿À¸¥ÂÊ ±×·¥¿¡ Àִ ǥÀÇ ³»¿ëÀÌ ¹Ù·Î CÄڵ尡 ÄÄÆÄÀÏ µÇ¾î ¿ÀºêÁ§Æ®(*.O) ÆÄÀÏÀÇ ±¸¼ºÀÌ µÇ´Â °ÍÀÔ´Ï´Ù.

¼ÒÇÁÆ®¿þ¾î ±¸¼º

¿©±â¼­ Áß¿äÇÑ »ç½ÇÀº ÇÔ¼ö, Àü¿ªº¯¼ö, static º¯¼ö´Â Àڱ⸸ÀÇ ÁÖ¼Ò¸¦ °¡Áö¸ç Map ÆÄÀÏ¿¡ Symbol ÇüÅ·Π³ªÅ¸³ª¸ç, Local º¯¼ö´Â Àڱ⸸ÀÇ ÁÖ¼Ò¸¦ °®Áö ¸øÇÕ´Ï´Ù.
SymbolµéÀÌ Àڱ⸸ÀÇ °íÀ¯ ÁÖ¼Ò¸¦ °®°í Àֱ⠶§¹®¿¡ ´Ù¸¥ ÆÄÀÏÀÇ ÇÔ¼öµé¿¡¼­µµ Á÷Á¢ access°¡ °¡´ÉÇÑ ÀÌÀ¯ À̱⵵ ÇÕ´Ï´Ù.