본문으로 건너뛰기
Embedded Performance Engineering · 19/57

임베디드 Bus Architecture — AHB·AXI·CHI 진화와 5-Channel

· Hawk · 7분 읽기

#한 줄 요약

**“Bus = CPU와 peripheral 사이 다리”**입니다. 시스템의 bandwidth와 latency를 결정합니다.

#AMBA 진화

Bus도입특징사용처
APB (Advanced Peripheral Bus)1996단일 사이클, 단순UART·timer·GPIO
AHB (High-perf)1999Burst, pipelineCortex-M, 옛 Cortex-A
AXI (eXtensible Interface)20035 channel, OoOCortex-A, GPU
ACE (AXI Coherency Ext)2011Cache coherencebig.LITTLE
CHI (Coherent Hub Interface)2014Mesh, scalableserver-class SoC

ARM Cortex-M은 AHB-Lite와 APB를 함께 씁니다. Cortex-A는 AXI에 CCI/CCN/CMN(CHI)을 결합합니다.

두 세대를 한 장의 그림으로 비교하면 master/slave 연결 구조의 차이가 잘 드러납니다.

AHB-Lite + APB(Cortex-M)와 AXI Interconnect(Cortex-A) 비교

#AXI 5 채널

AXI 5 Channels — Read/Write 독립 Handshake

5 채널은 각각 독립적으로 핸드셰이크합니다. Read와 Write가 동시에 진행되며, OoO 응답도 가능합니다.

#채널별 시그널

AR (Read Address):

  • ARID, ARADDR, ARLEN, ARSIZE, ARBURST, ARLOCK, ARCACHE, ARPROT, ARVALID, ARREADY

R (Read Data):

  • RID, RDATA, RRESP, RLAST, RVALID, RREADY

AW (Write Address):

  • AWID, AWADDR, AWLEN, AWSIZE, AWBURST, AWLOCK, AWCACHE, AWPROT, AWVALID, AWREADY

W (Write Data):

  • WDATA, WSTRB, WLAST, WVALID, WREADY

B (Write Response):

  • BID, BRESP, BVALID, BREADY

VALID/READY handshake는 양쪽이 모두 high여야 transfer가 발생합니다.

#ID — Out-of-Order 지원

Master가 transaction에 ID 부여:

  • AR0: ID=0, addr=0x1000
  • AR1: ID=1, addr=0x2000 (다른 ID)
  • AR2: ID=0, addr=0x3000 (같은 ID — 순서 보장)

Slave 응답:

  • R: ID=1, data=0xCAFE (AR1 응답 먼저 가능)
  • R: ID=0, data=… (AR0)
  • R: ID=0, data=… (AR2 — 같은 ID 내 순서)

같은 ID끼리는 FIFO 순서를 지키고, 다른 ID 사이에서는 OoO가 가능합니다.

#Burst Transaction

ARBURST:
00 FIXED — 같은 주소 반복 (peripheral FIFO read)
01 INCR — 주소 자동 증가 (memory)
10 WRAP — 경계에서 wrap (cache line fill)
11 reserved
ARLEN — burst 길이 (0=1 transfer, 15=16 transfer)
ARSIZE — 각 transfer bytes (000=1, 011=8, 100=16, ..., 111=128)

예를 들어 cache line fill(64 byte, 8 × 64-bit beat)은 ARLEN=7, ARSIZE=011, ARBURST=WRAP으로 표현합니다.

#Outstanding Transaction

Master가 응답 받기 전에 다음 AR을 발사할 수 있다.

Time123456
ARAR0AR1AR2AR3AR4AR5
RR0R1 (R2…)

이렇게 하면 throughput이 향상됩니다. DRAM latency를 parallelism으로 가리는 효과가 있습니다.

Outstanding count는 동시에 미응답 상태로 둘 수 있는 transaction 수입니다. Cortex-A72는 32개 이상, peripheral은 보통 2-4개 수준입니다.

#AHB-Lite vs AXI 차이

항목AHB-LiteAXI
Master1N
Channel단일 (address + data)5
OoOXO
Outstanding1N
PipelineYesYes
BurstINCR4/8/16flexible 1-256
사용처Cortex-MCortex-A

AHB는 간단해서 작은 MCU에 적합합니다. AXI는 복잡하지만 throughput이 높습니다.

#APB — Peripheral 전용

2-cycle (setup + access):

  • Cycle 1: PSEL=1, PENABLE=0, PADDR set
  • Cycle 2: PENABLE=1, PRDATA returned (read) / PWDATA captured (write)

매우 단순한 구조라서 UART·timer·GPIO처럼 낮은 대역폭 peripheral에 어울립니다.

Cortex-M에서는 보통 [Cortex-M] ─ AHB ─ [bridge] ─ APB ─ [UART, timer, GPIO] 형태로 연결합니다.

#NoC — Network-on-Chip

NoC — Network-on-Chip Multi-core SoC 구조

ARM CMN(Coherent Mesh Network)은 grid topology 구조로, server 및 고급 모바일 SoC에서 사용합니다.

#Cortex-A72 — Bus Hierarchy

Cortex-A72 Bus Hierarchy — L1/L2/SCU/CCI-400/DDR

각 stage는 AXI 또는 ACE로 연결됩니다. CCI-400은 4 cluster cache coherent interconnect입니다.

#측정 — AXI 활용도

Metric의미
VALID without READYBackpressure (downstream 못 따라옴)
READY without VALIDIdle (upstream 데이터 없음)
Outstanding countConcurrency 수준
Burst length 분포Cache line fill vs single

SoC integration 단계에서 AXI monitor(Synopsys VIP 등)로 데이터를 캡쳐합니다.

#STM32H7 — AXI 사례

Cortex-M7 (AHB-Lite) ─→ AXI bus matrix ─→ DDR ext / SRAM / FMC
Master:
- M0: Cortex-M7 ITCM·DTCM access
- M1: Cortex-M7 AXI
- M2: SDMMC1·2
- M3: MDMA (Master DMA)
- M4: HASH·CRYP·CAMERA
- M5: LCD-TFT
Slave:
- S0: AXI SRAM (512 KB)
- S1: AHB SRAM1
- S2: AHB SRAM2
- S3: APB1·2·3·4 (peripheral)
- S4: FMC ext memory
- S5: QUADSPI

STM32H7이 고성능 Cortex-M7으로 평가받는 이유 중 하나가 바로 AXI bus matrix를 통한 parallel access입니다.

#DMA·CPU Contention

CPU AXI master와 DMA AXI master가 같은 slave (DDR)에 접근하면 arbiter가 우선순위를 결정한다.

  • DMA 우선 시 — CPU stall
  • CPU 우선 시 — DMA latency 증가

ARQOSAWQOS는 4-bit priority를 제공합니다. CCI-400은 bandwidth regulation도 가능합니다.

#Slave Response — OKAY/EXOKAY/SLVERR/DECERR

00 OKAY — 정상
01 EXOKAY — exclusive access 성공
10 SLVERR — slave 오류 (peripheral 미준비)
11 DECERR — decode 오류 (해당 주소 없음)

Bus fault가 발생하면 ARM Cortex-A에서는 Synchronous External Abort, Cortex-M에서는 BusFault로 잡힙니다.

#자주 하는 실수

⚠️ Burst boundary 넘김

AXI burst는 4KB boundary를 넘으면 안 된다. INCR16 (16 transfer × 8 byte = 128 byte)은 4 KB 안에 있어야 한다.

DMA controller는 자동으로 split을 처리하지만, 수동으로 AXI master를 다룰 때는 직접 split해야 합니다.

⚠️ ID 충돌

같은 ID로 2 outstanding이면 slave가 응답을 순서대로 줘야 한다. 서로 다른 slave면 재정렬 못 함 → deadlock 가능.

slave 경로마다 unique ID를 두는 것이 안전합니다.

⚠️ Outstanding 너무 많음

CPU가 outstanding 100개를 발사하면 DRAM scheduler에 queue pressure가 쌓이고, 다른 master가 굶주리게 됩니다.

⚠️ APB peripheral을 AHB master로 가정

APB는 단순한 2-cycle 프로토콜이라서 burst나 OoO가 없습니다. AXI에서 APB로 넘어갈 때는 bridge를 통해 매핑해야 합니다.

#정리

  • AMBA는 APB → AHB → AXI → ACE → CHI 순으로 진화했습니다.
  • AXI는 5 channel(AR·R·AW·W·B)로 구성되며 독립 handshake를 합니다.
  • ID·Burst·Outstanding으로 OoO와 parallel throughput을 얻습니다.
  • Cortex-M7은 AHB-Lite + APB + AXI bus matrix를 함께 사용합니다.
  • Cortex-A는 AXI에 CCI/CMN coherent interconnect를 결합합니다.
  • DMA와 CPU가 contention을 일으킬 때 QoS를 활용합니다.

다음 편에서는 Bus Contention 분석을 다룹니다.

#관련 항목

Embedded Performance Engineering · 20 of 57

  1. 1Embedded Performance Engineering — 임베디드 성능 엔지니어링 시리즈 소개
  2. 2임베디드 성능 분석 방법론 — Measure → Analyze → Optimize 사이클
  3. 3성능 지표 정의 — Latency·Throughput·Utilization 분석
  4. 4성능 측정의 기본 — Wall-Clock·CPU Cycle·Instruction Count
  5. 5성능 데이터 통계적 분석 — Percentile·Histogram·평균의 함정
  6. 6실시간 성능 분석 — WCET·Jitter·Deadline Miss 측정
  7. 7임베디드 벤치마킹 기초 — 재현성·Warmup·노이즈 제거
  8. 8성능 모델링 — Amdahl·Gustafson·Roofline Model 적용
  9. 9프로파일링 기법 개요 — Sampling vs Instrumentation·PGO·LTO
  10. 10CPU 파이프라인 분석 — 5-stage·Cortex-M·Cortex-A 비교
  11. 11Pipeline Stall 분석 — Data·Structural·Control Hazard·Forwarding
  12. 12Branch Prediction 분석 — Static·2-bit·BTB·BHT·Mispredict 비용
  13. 13Speculative Execution 분석 — OoO·Reorder Buffer·Register Renaming
  14. 14CPU Cache 기초 — L1·L2·L3·Set Associative·Replacement Policy
  15. 15Cache Miss 3C Model 분석 — Compulsory·Capacity·Conflict
  16. 16Cache Line 최적화 — Alignment·Prefetch·False Sharing 처리
  17. 17메모리 대역폭 분석 — STREAM·Roofline·Bus Saturation 측정
  18. 18SIMD·NEON 활용 — 128-bit Vector·Auto-Vectorization·SVE/SVE2
  19. 19PMU·HPM 하드웨어 카운터 분석 — 정밀 성능 진단
  20. 20임베디드 Bus Architecture — AHB·AXI·CHI 진화와 5-Channel
  21. 21Bus Contention 진단 — Arbitration·QoS·Starvation 측정
  22. 22DMA 성능 최적화 — Burst·Scatter-Gather·Chain·Cache 일관성
  23. 23DMA vs CPU Copy 성능 비교 — Break-even·Setup Overhead 실측
  24. 24Interrupt Latency 분석 — 진입·종료·Tail-Chaining·Late Arrival
  25. 25Interrupt Storm 처리 — NAPI·Rate-Limit·Polling 전환
  26. 26MMIO 접근 성능 — Cache Policy·Write-Combining·Volatile·Barrier
  27. 27Peripheral Clock 분석 — PLL·Divider·Gating·DVFS
  28. 28Power vs Performance 트레이드오프 — DVFS·Race-to-Idle·Big.LITTLE
  29. 29Thermal Throttling 분석 — Junction Temp·Trip Point·냉각
  30. 30CXL Interconnect 분석 — AI 시대 메모리 대역폭 확장
  31. 31Concurrency 기초 — Concurrency vs Parallelism·Race·Memory Model
  32. 32False Sharing 진단 — Cache Line Ping-Pong·Padding·측정
  33. 33Lock Contention 분석 — Wait·Hold·Convoy·측정 기법
  34. 34Spinlock 성능 분석 — Spin-Wait vs Context Switch·Ticket·MCS
  35. 35Mutex 성능 분석 — Futex·Adaptive·Priority Inheritance
  36. 36Reader-Writer Lock 성능 — Reader/Writer Priority·RCU·Seqlock
  37. 37Lock-Free 자료구조 성능 — CAS·ABA·Hazard Pointer·Epoch Reclamation
  38. 38Memory Ordering 분석 — Acquire·Release·Seq-Cst·ARM Relaxed Model
  39. 39Cache Coherency 프로토콜 — MESI·MOESI·Snoop·Directory
  40. 40SMP 성능 분석 — Per-Core·Affinity·Load Balance·Scalability
  41. 41Linux perf 기초 — stat·record·report 활용
  42. 42Linux perf 고급 — Raw Event·Tracepoint·perf script
  43. 43ftrace 활용 — function·function_graph·latency tracer
  44. 44eBPF·bpftrace 동적 트레이싱 — 커널 무수정 관측
  45. 45Flamegraph 분석 — On-CPU·Off-CPU·Differential
  46. 46ARM DS·Lauterbach 분석 — Hardware Trace 전문 도구
  47. 47Bare-metal 프로파일링 — GPIO·DWT·SysTick·ITM 활용
  48. 48NVIDIA Nsight Systems — GPU·NPU 포함 시스템 분석
  49. 49모던 프로파일러 비교 — Tracy·Hotspot·uftrace·Coz
  50. 50연속 프로파일링 — Parca·Pixie·Pyroscope·Tetragon
  51. 51실전 사례 — ISR Latency 100µs Deadline Miss 추적
  52. 52실전 사례 — Matrix Multiply가 예상의 10배 느린 이유
  53. 53실전 사례 — 8-core가 4-core를 넘으면 throughput이 떨어지는 이유
  54. 54실전 사례 — 카메라 1080p 60fps가 30fps로 떨어지는 이유
  55. 55CXL.mem 지연·대역폭 실측 — Direct·Switch·Pooled 토폴로지 비교
  56. 56CXL 성능 프로파일링 도구 — cxl-cli·DAMON·perf-mem 활용
  57. 57실전 사례 — CXL.mem 추가로 LLM inference KV cache 처리량 회복