Professional Documents
Culture Documents
Ch 4. HW SW Co design for SoC (최후수정)
Ch 4. HW SW Co design for SoC (최후수정)
Copyrightⓒ2004 1
4 장 . HW/SW Co-Design for SoC
Co-design 이란 ?
하드웨어와 소프트웨어가 조합된 시스템에서 기능과 성능의
목적을 동시에 달성하기 위하여 , 협력성과 동시성을 지원하는
설계 방법론
Abstract Co-design Process
Function Architecture
Refinement
Abstraction
Synthesis Mapping Verification
Hardware Software
Copyrightⓒ2004 2
4 장 . HW/SW Co-Design for SoC
최근의 설계 요구사항
최적의 가격대 성능비
낮은 전력소모량
사용자 편이성 , 무게 , 부피
Time to market
Copyrightⓒ2004 3
4 장 . HW/SW Co-Design for SoC
Co-design 의 필요성
설계 초기 단계부터 하드웨어 소프트웨어를 동시에
고려하는 방법론 필요
“Co-design”
Co-design 의 특징
Concurrency & Integration
하드웨어 / 소프트웨어를 통합하여 동시에 개발 , 검증
임베디드 시스템과 SoC 의 설계에 적합
하드웨어 / 소프트웨어 최적 분할로 가격대 성능비 향상
하드웨어와 소프트웨어의 설계 시간 , 설계 비용 , 에러의
감소로 인한 time-to-market 가능
Copyrightⓒ2004 4
4 장 . HW/SW Co-Design for SoC
Copyrightⓒ2004 5
4 장 . HW/SW Co-Design for SoC
Constraint
C Analysis Memory / Pipeline
O Optimization
Hardware Software
Partitioning
I
Co Synthesis
S
Interface Library
I
M
U
L
A Software Hardware
T Specificaion Interface Specification
Specification
O
R Complier Behavioral
Synthesis
Memory Custom HW
Verification
Application C P U Application
SW SW Debugging
Device Driver Device Driver
System Bus
Copyrightⓒ2004 6
4 장 . HW/SW Co-Design for SoC
System Specification
개요
시스템을 통일된 표현 기법으로 기술하는 단계
특징
하드웨어와 소프트웨어를 위한 통일된 설계 / 분석 기술을 지원해야 함
시스템 작업들이 쉽게 하드웨어 또는 소프트웨어로 변경될 수 있음
통합된 설계 환경에서 시스템 평가 가능
빠른 성능 분석 가능
System-level language : systemVerilog, SystemC, SpecC, etc…
Specification
Models
+ Constraints
Design
Process
Implementation Architecture
Copyrightⓒ2004 7
4 장 . HW/SW Co-Design for SoC
System-Level Language
필요성
시스템 디자인의 복잡도 (complexity) 증가
고수준의 추상화 (abstraction) 와 모델링 (modeling) 요구
효율적인 시스템 디자인 flow 가 필요
갖추어야 할 사항
다양한 추상화 레벨의 시스템 모델을 지원하여야 함
임베디드 소프트웨어 부분을 전체 시스템에 통합할 수 있어야 함
실행가능한 디자인 spec. 을 생성할 수 있어야 함
실행가능한 플랫폼 모델을 생성할 수 있어야 함
Copyrightⓒ2004 8
4 장 . HW/SW Co-Design for SoC
Copyrightⓒ2004 9
4 장 . HW/SW Co-Design for SoC
SystemVerilog
특징
Verilog 코드의 productivity 와 readability 향상
간결한 하드웨어 기술 (hardware description) 제공
Verilog-2001 로 High-level abstraction 을 확장
Verilog 의 assertion 문을 통합하여 검증 (verification) 확장
Reference
systemVerilog 3.1, ballot draft: Accellera’s Extensions to Verilog Accellera, N
apa, California, April 2003
Verilog 2001: A Guide to the new Verilog Standard, Stuart Sutherland, Kluwer
Academic Publishers, Boston, Massachusetts, 2001
http://www.eedesign.com/story/OEG20030521S0086
Copyrightⓒ2004 10
4 장 . HW/SW Co-Design for SoC
Copyrightⓒ2004 11
4 장 . HW/SW Co-Design for SoC
System-Level Language 의 동향
기존의 디자인 언어 기능 확장 (ex: SystemVerilog)
다양한 추상화 레벨의 시스템 모델을 지원
장점
설계자에게 친숙한 문법과 환경 제공
이전 버전과의 호환성 제공
단점
현재 표준화 미비
하드웨어 기술언어 습득이 어려움
Copyrightⓒ2004 12
4 장 . HW/SW Co-Design for SoC
Constraint
C Analysis Memory / Pipeline
O Optimization
Hardware Software
Partitioning
I
Co Synthesis
S
Interface Library
I
M
U
L
A Software Hardware
T Specificaion Interface Specification
Specification
O
R Complier Behavioral
Synthesis
Memory Custom HW
Verification
Application C P U Application
SW SW Debugging
Device Driver Device Driver
System Bus
Copyrightⓒ2004 13
4 장 . HW/SW Co-Design for SoC
HW / SW Partitioning 개요
정 의
HW / SW Co-design 에서의 분할은 상위 단계의 시스템 동작 기술을
하드웨어와 소프트웨어 부분으로 재구성 하는 것을 의미
목 표
시스템의 성능 , 면적 , 지연시간 , 통신으로 인한 오버헤드 등을
고려하여 가격과 성능을 모두 만족시킬 수 있도록 분할
특징
Hardware 구현
하드웨어의 속도와 작업의 병렬 수행을 통한 높은 성능을 제공
추가적인 ASIC 또는 FPGA 등이 필요하므로 하드웨어 비용 증가
Software 구현
저가의 고성능 프로세서에서 동작하므로 하드웨어 비용 감소
오퍼레이션의 순차적인 실행으로 인한 성능의 감소
Copyrightⓒ2004 14
4 장 . HW/SW Co-Design for SoC
HW / SW Partitioning 장점
시스템 개발에 소요되는 비용과 시간의 최소화
시장경쟁력 확보 (Time to Market)
최적의 가격 대 성능비
HW 의 성능과 SW 의 저렴성 사이의 균형을 맞추어 최적의 가격 대
성능비 도출
유연한 시스템 기술 가능
Software 구현으로 개량 및 유지 보수 용이
여러 형태의 시스템 설계 가능
Copyrightⓒ2004 15
4 장 . HW/SW Co-Design for SoC
HW / SW Partitioning Flow
System Specification
System Specification
Target
Architecture
SW
SWCompiler
Compiler
Library
HW
HWCost
Cost SW
SWCost
Cost
Estimation
Estimation Estimation
Estimation
Target
Architecture Partitioning
Graph
HW
HW
HW/ /SWSW
Partitioning
Partitioning SW
Partitioning
Graph
Copyrightⓒ2004 16
4 장 . HW/SW Co-Design for SoC
HW / SW Partitioning 고려사항
Hardware / Software 동작 특성
하드웨어의 특징과 소프트웨어의 특징을 고려하여 분할을
수행해야 함
Hardware 기능의 공유
하드웨어의 면적과 수행시간을 고려하여 하드웨어 기능의 공유
HW 와 SW 간의 통신
하드웨어와 소프트웨어 간의 추가적인 통신시간 고려
Scheduling
하드웨어와 소프트웨어간의 수행시간 및 순서의 조절
Functional Pipeline
하드웨어와 소프트웨어간의 통신 및 수행시간의 최적화
Copyrightⓒ2004 17
4 장 . HW/SW Co-Design for SoC
HW / SW 동작 특성
하드웨어로 구현 : 각각의 모듈이 병렬로 동작 , 하드웨어 면적의 증가
소프트웨어로 구현 : 각각의 모듈이 순차적으로 동작 가능 , 수행시간의 증가
SW
SWImplementation
Implementation HW
HWImplementation
Implementation
Void V1(..)[..]
V1 V2 Void V1(..)[..]
void main()
{ V1 V2
v1(..);
v2(..);
}
Processor Hardware SW
SWSchedule
Schedule HW
HWSchedule
Schedule
P1 H1
… V1 … … V1 …
… V2 … V2 …
…t …t
Copyrightⓒ2004 18
4 장 . HW/SW Co-Design for SoC
HW 기능의 공유
하드웨어 면적 (area) 최소화 가능
수행시간 (execution time) 의 증가
V1 V2 V3 V4
AREA :
FU1 FU2 FU3 FU4 FU1 FU2 FU1
TIME :
V1 V1 V1
V2 V2 V2
V3 V3 V3
V4 V4 V4
t t t
Copyrightⓒ2004 19
4 장 . HW/SW Co-Design for SoC
HW 와 SW 간 Interfacing
하드웨어와 소프트웨어의 데이터 전송을 위해 필요
추가적인 통신 시간에 대한 고려 필요
Processor Hardware
V1 P1 H1
Channel C
Scheduling
V2
P1 V1
H1 V2
t
Copyrightⓒ2004 20
4 장 . HW/SW Co-Design for SoC
Scheduling
Invalid
Channel Accesses V1 V1 V2
w1 r3 w3
Communication
Channel 을 통해서 V2
V3
프로세서 (SW) 가 t
Valid
데이터를 Read 또는 V1 V2
Write 시 다른 동작 (HW V3
또는 SW) 불가능 w1 r3 r3
HW V3
SW t
Execution Order
[Read->Execution->
Write] 단계 Invalid
V1 V2
Communication read1 read2
Channel 을 통해서 r1 r2 w1 w2
데이터를 읽음 (Read) V1 V2 t
필요한 데이터를 읽은
Valid
후 실행 (Execution) write1 write2 V1 V2
실행 결과를 다시 r1 w1 r2 w2
Communication SW
Channel 에 전송 (Write) t
Copyrightⓒ2004 21
4 장 . HW/SW Co-Design for SoC
Functional Pipelining
전체 시스템의 수행시간 (Execution Time) 을 최적화
Not Total Execution Time
NotPipeline
Pipeline
V1 V2 V1 V2
V1
V3 V4 V3 V4
V2 V3 t
HW
SW V3 V4 V3 V4 V3
t
Copyrightⓒ2004 22
4 장 . HW/SW Co-Design for SoC
C’/00 C’/00
S00 S00
C/01 C/01
S12
Copyrightⓒ2004 23
4 장 . HW/SW Co-Design for SoC
If i<=10
Read Read Read
* 1
X(i) Y(i) i
Z(i) = x(i)*y(i)
i=i+1
+ +
Write
r end
end
Copyrightⓒ2004 24
4 장 . HW/SW Co-Design for SoC
Copyrightⓒ2004 25
4 장 . HW/SW Co-Design for SoC
Target
Architecture Partitioning
Graph
HW
HWEstimation
Estimation
Copyrightⓒ2004 26
4 장 . HW/SW Co-Design for SoC
Partitioning Algorithm 분류
구조적 알고리즘 (Constructive algorithms)
분할을 하기 전에 각각의 객체들을 그룹화
객체들의 Closeness 를 이용해 그룹화
회로의 규모가 커지면 , 그룹화 과정에서 과도한 수행시간
Copyrightⓒ2004 27
4 장 . HW/SW Co-Design for SoC
알고리듬
Closeness 가 높은 객체들을 그룹화
다시 Closeness 를 계산
종결 조건이 만족할때 까지 반복 수행
30 O1 25 O1
O2 O1 O3 O1
20
15 O2 O2 O3
O2 O3 O3
10 10 O4
10 10 10 10
O4 O4
O4
Avg(10,10) = 10
Avg(15,25) = 20
Copyrightⓒ2004 28
4 장 . HW/SW Co-Design for SoC
Simulated Annealing
Iterative algorithm modeled after physical annealing
process
알고리즘
초기 분할 시작 및 초기 온도 (temperature)
천천히 온도 감소 e
각각의 온도에서 무작위 이동 발생
분할 비용 (Cost) 가 개선된 이동만 분할 적용
온도가 높을 때는 분할 비용이 좋지 않은 이동도 분할 적용
분할 결과 및 수행 시간 (Complexity) 은 온도 감소량
(Temperature decrease rate) 에 따라 달라짐
Copyrightⓒ2004 29
4 장 . HW/SW Co-Design for SoC
HW / SW Partitioning 관련 Works
POLIS : U.C. Berkeley
Co-simulation 을 통해서 성능을 추정을 해서 사용자가 직접 하드웨어 부분과
소프트웨어 부분으로 분할
Ptolemy
Greedy 알고리즘 사용
시스템의 시뮬레이션과 합성을 위한 통합 환경 제공
전체 시스템을 통일되고 일반적인 언어로 기술하는 대신 각 서브 시스템에
적합한 표현 방식을 사용하며 이질적인 표현 방식들 간의 통일된 인터페이스를
제공
Copyrightⓒ2004 30
4 장 . HW/SW Co-Design for SoC
Constraint
C Analysis Memory / Pipeline
O Optimization
Hardware Software
Partitioning
I
Co Synthesis
S
Interface Library
I
M
U
L
A Software Hardware
T Specificaion Interface Specification
Specification
O
R Complier Behavioral
Synthesis
Memory Custom HW
Verification
Application C P U Application
SW SW Debugging
Device Driver Device Driver
System Bus
Copyrightⓒ2004 31
4 장 . HW/SW Co-Design for SoC
HW/SW Co-Synthesis
분할된 결과로부터 각 하드웨어 /
소프트웨어 컴포넌트와 인터페이스를
합성하는 단계 Partition
실제 시스템 구조 (architecture) 에
적합하도록 성능의 최적화 (optimizati
on)
Hardware synthesis
FPGA or ASIC SW HW
HDL structural description
기존 EDA tools send recv
recv send
Software synthesis
Processor (ARM, Teak DSP…)
C or Assembly code generation
Compile & Optimize
Interface synthesis
Communication channel (BUS, Share Software with
interface
Hardware with
interface
d memory…)
BUS and Protocol generation
Copyrightⓒ2004 32
4 장 . HW/SW Co-Design for SoC
Hardware Synthesis
정의
하드웨어 기술 언어 (HDL) 로 작성된 설계 명세 (specification)
로부터 하드웨어 설계를 자동적으로 구현하는 단계
목표
빠른 설계의 작성과 수정
다양한 설계 대안을 제시하는 방법론이 지원
VLSI 설계 시 디자이너가 지나치게 상세한 부분에 대한 처리를
제거
정확하게 설계된 개발이 가능
Copyrightⓒ2004 33
4 장 . HW/SW Co-Design for SoC
C E
A B D G
Hardware F
Communication Network
C Send 1 Hardware
Receive Send
Recv 1 B D Logic C Logic
B D
Send 2
Hardware
Clock
Control Logic
Copyrightⓒ2004 34
4 장 . HW/SW Co-Design for SoC
Wrapper
Data Bus
Output Ready
Signals for
Processor protocol
ASIC
Intput Ready
Start
Copyrightⓒ2004 35
4 장 . HW/SW Co-Design for SoC
Software Synthesis
정의
명세서 (specifications) 와 재사용 가능한 컴포넌트로부터
정확하고 효율적인 소프트웨어를 자동으로 생성하는 단계
목표
소프트웨어 생산성의 향상
낮은 개발 단가
명세서를 만족하는 소프트웨어 구현의 신뢰성 향상
정확한 프로그램 개발 가능
메모리 사용의 최소화 ( 코드 , 데이터 )
Copyrightⓒ2004 36
4 장 . HW/SW Co-Design for SoC
… A B D G
recv(data);
B();
C();
C Send 1
D(); Recv 1 B D
...
}
Copyrightⓒ2004 37
4 장 . HW/SW Co-Design for SoC
Interface Synthesis
이종 컴포넌트간의 통신이 가능하도록 합성하는 단계
Interface components
Hardware : bus interface, glue logic
Software : device driver, operating system
Device Drivers
Network Network
Interface Interface
On-chip Network
Copyrightⓒ2004 38
4 장 . HW/SW Co-Design for SoC
Shared memory
communication Process A Process B Process A Process B
Channel
begin begin begin begin
variable i; variable j; variable i; variable j;
Communication Channels ...
M := i;
...
j := M;
...
send(i);
...
receive(j);
... ... ... ...
Dedicated lines end end end end
FIFO buffers
Shared memory
Communication Protocols
2-phase or 4-phase
handshake
RS-232, USB, PCI and etc…
Copyrightⓒ2004 39
4 장 . HW/SW Co-Design for SoC
Communication Channels 의 특징
Communication Communication Blocking or
Topology
Channel Model Non-blocking
Copyrightⓒ2004 40
4 장 . HW/SW Co-Design for SoC
Channel Refinement
메시지가 전송되는 채널을
실제적인 통신 네트워크로 구축 Channels
F2
Bus generation F1
bus width 결정
data line 의 개수
F3
Protocol generation
Microprocessor
버스를 통해 일어나는 전송 F1
메커니즘의 정의 OS
ASIC ASIC
F2 F3
Device Drivers
Copyrightⓒ2004 41
4 장 . HW/SW Co-Design for SoC
Constraint
C Analysis Memory / Pipeline
O Optimization
Hardware Software
Partitioning
I
Co Synthesis
S
Interface Library
I
M
U
L
A Software Hardware
T Specificaion Interface Specification
Specification
O
R Complier Behavioral
Synthesis
Memory Custom HW
Verification
Application C P U Application
SW SW Debugging
Device Driver Device Driver
System Bus
Copyrightⓒ2004 42
4 장 . HW/SW Co-Design for SoC
HW/SW Co-verification 란 ?
ASIC 으로 구현되는 하드웨어의 Software Code HDL Code
동작과 마이크로프로세서
위에서 돌아가는 소프트웨어를
동시에 고려하여 회로의 동작을
Compiler Processor Model Setup
검증하는 방법
소프트웨어 요소가 가질 수
있는 모든 문제점을 빠르게
발견하여 수정 HW/SW Co-verification
Copyrightⓒ2004 43
4 장 . HW/SW Co-Design for SoC
Co-verification Methods
시뮬레이션 기반 (Simulation-based)
장점 : 유동성 (flexibility), high visibility
단점 : 검증 속도가 매우 느림
실제적인 구현 전 단계에서 사용가능 하여 경제적
에뮬레이션 기반 (Emulation-based)
장점 : speed, ICE capability
단점 : high cost, low visibility
실제적으로 동작하는 과정을 보며 검증 가능
Copyrightⓒ2004 44
4 장 . HW/SW Co-Design for SoC
Co-simulation
Soft or Virtual Prototype
Software models for system HDL
Bus
ISS Simulator
Simulator Feature Functional
(C/C++) (VHDL,
ISS (Instruction Set Simulator) Model
Verilog)
HDL simulator
Virtual Interface
Hardware Simulation
Behavioral level HDL 로 구현하고 logic sim Source Level Debugger
ulator 를 사용하여 시뮬레이션
Software Simulation
Instruction Set Simulator (ISS) 을 사용하여
컴파일 된 코드를 호스트에서 실행시킴 Processor
(ISS)
Abstract RTOS 를 지원해야 함
Peripherals 를 C-model 로 작성하여
시뮬레이션
Copyrightⓒ2004 45
4 장 . HW/SW Co-Design for SoC
Co-emulation
Real prototype Emulation System
System-Level
Testbench
시뮬레이터에 비해 매우
빠르게 동작하므로 검증 시간 System Interface
(BUS)
단축
Peripherals
(RTL)
Copyrightⓒ2004 46
4 장 . HW/SW Co-Design for SoC
Co-verification Strategy
각 설계 단계 별로 시뮬레이션과 에뮬레이션을 사용하여
시스템 검증
설계 초기 단계
Virtual prototype 을 사용하는 co-simulation 에 의한 검증
Prototype 의 검증을 통해 설계 초기 단계에 나타나는 비교적
간단한 문제점을 빠르게 제거할 수 있음
설계 중반 및 구현 단계
Real prototype 을 사용하는 co-emulation 에 의한 검증
RTL or Gate level 에서 발생할 수 있는 문제점 같은 구현
단계에서 나타날 수 있는 문제점을 제거
Copyrightⓒ2004 47
4 장 . HW/SW Co-Design for SoC
Copyrightⓒ2004 48
4 장 . HW/SW Co-Design for SoC
HDL simulator
Copyrightⓒ2004 49
4 장 . HW/SW Co-Design for SoC
Altera Excalibur
ARM core, AHB, FPGA 를 하나의 칩 안에 구성
실제 구현단계에서의 빠르고 뛰어난 HW/SW 검증 환경 제공
AHB
ARM core
FPGA
Copyrightⓒ2004 50
4 장 . HW/SW Co-Design for SoC
Mentor
Platform Express Platform based SoC design tool
Graphics
Mentor
Seamless CVE HW/SW co-simulation tool
Graphics
Copyrightⓒ2004 51
4 장 . HW/SW Co-Design for SoC
Copyrightⓒ2004 52
4 장 . HW/SW Co-Design for SoC
참고문헌
The Codesign of Embedded Systems : A Unified Hardware/Soft
ware Representation, Sanjaya Kumar, James H.Aylor, Barry W.J
ohnson, Wm. A. Wulf
Synthesis and simulation of digital systems containing interactin
g hardware and software components 29th dac
A model and methodology for hardware-software codesign
CAP Laboratory Homepage (http://peace.snu.ac.kr/)
Pai Chou, Ross Ortega, Gaetano Borriello, "Synthesis of the Har
dware/Software Interface in Microcontroller-Based Systems," Pr
oceedings of the IEEE/ACM International Conference on Compu
ter-Aided Design, Santa Clara, CA, November 1992. pp.488-49
5.
Copyrightⓒ2004 53