Skip to main content

Docs

God shall bless us; and all the ends of the earth shall fear him.

디지털 시스템 설계방법론 통합설계

통합설계

용어

호스트와 타겟 시뮬레이션 시간: 시뮬레이션 계산에 소모되는 시간 시뮬레이션된 시간: 시뮬레이션 대상의 시간 소모

목표

  • SW 개발을 위한 가상 프로토타이핑
  • 디자인 공간 탐색을 위한 시스템 성능 예측
  • 구현 전 시스템 검증

=> 어떻게 통합시뮬레이션으로 목표를 달성할 것인가?

문제

  • 어떻게 처리 요소(processing components)를 시뮬레이션 할 것인가?
  • 어떻게 하드웨어와 소프트웨어 사이에 모델이 통신할 것인가?
  • 어떻게 요소 시뮬레이터(component simulators)를 동기화 할 것인가?

프로세서 시뮬레이터

Software

ISS

Instruction Set Simulator

  • Interpretive ISS 단점: 느리다

  • Compiled ISS 장점: 빠르다 단점: 정적 코드만 지원(부트 로딩 코드x), 큰 메모리 공간 사용

하드웨어 통신 시뮬레이터

  • RTL(Register Transfer Level)
  • TLM(Transaction Level Model)

동기화 방법

  • Lock-step synchronization
  • Conservative synchronization
  • Optimistic synchronization
  • Virtual synchronization

동기화 비용

  • IPC: socket(), pipe()
  • Thread context switch
  • Function call

통합시뮬레이션

통합-검증을 위한 통합시뮬레이션

RTL

바이너리 소프트웨어를 RTL 모델로 시뮬레이션: 너무 느림
검증을 위한 사이클 정확 통합시뮬레이션: 느림(ISS + RTL + Lock-step 동기화)

  • 페치 최적화
  • 데이터 접근 최적화

TLM

TLM은 연산에서 통신을 분리

  • 모듈: 연산(프로세스의 집합)
  • 채널: 통신
  • 포트: 모듈과 체널 서로 묶이는 통신 포트

종류

  • untimed: 기능적 검증
  • approximate timed
  • cycle-timed

연산(Computation)과 통신(Communication) 정확도에 따라

  • Timed Functional Model: 통신은 무시(연산은 추정)
  • Cycle Approximate Model: 사이클 추정(연산/통신 둘다)
  • Bus Functional Model: 정확한 통신 계산(연산은 추정)
  • Cycle Accurate Computation Model: 정확한 연산 계산(통신은 추정)
  • Pin Accurate(RTL): 둘다 정확히 계산

SystemC

동기

  • SoC 디자인에서 하드웨어와 소프트웨어 다른 언어 사용
  • 높은 추상화된 시스템 레벨 디자인 언어

C++에 추가된 것

  • Concurrency: SC_METHOD, SC_THREAD, SC_CTHREAD
  • Timing: sc_clock
  • Rich set of data types: 고정소수점

Module

*computation ?Timing: Time, Clock ?Test Bench

Channel

*communication

  • primitive
  • hierarchical

sc_signal sc_fifo sc_mutex sc_semaphore

TLM2.0

loosely-timed

approximately timed(AT)

design space exploration non-blocking with four phases payload event queues

Core Interfaces

  • transport b_transport nb_transport_fw nb_transport_bw => 채널의 높은 추상화 제공
  • DMI
  • Debug

Socket => replace sc_signal, sc_fifo... etc

Timing Synchronization Problem

Causality error 로컬 클락은 하위 시뮬레이션 진행 이후로 나갈 수 없음 => 병목의 주요 원인

Performance Problem in Cosimulation

프로세서 시뮬레이터는 빠르다 하드웨어는 느리다

모듈이 많아질수록 한 클락에 시뮬레이션 할 항목이 늘어남=>느려짐

Distributed vs. Serial Execution

a processing component is smaller than 10K-100K if lock-step synchronization is used 커뮤니케이션 오버헤드가 시뮬레이션 보다 커서 => 단일 머신/ 단일 코어에서 시뮬레이션 하는게 더 이점

통합시뮬레이션 성능

$\sum_{\forall i} { T \times (st_i + sync) + tran_{num} \times st_{tran} }$

TLM 통합시뮬레이션

$st_i, st_{trans}$ 줄이기

하드웨어 에뮬레이션

$st_i$ 줄이기

동기화 지점 줄이기

$T$를 $sync \times T$로 줄이기

=> 동기화를 매 사이클에 하는건, 언제 올지 몰라서. 보수적으로 다음 이벤트를 예측 => 최적optimistic 방법, 동기화 무시, causality 에러 발생시 다시

  • 보수적 접근(Conservative approach) 인과 에러가 없는 미래 지점

위스콘신방법 -사용자 정한대로(100, 1000 cycle) 동기화 => causality error 허용

  • 최적 방법(Optimistic approach) 인과 에러가 감지된 지점

장점: 다음 시간 예측 필요 없음 단점: 체크포인트, 상태 회복 오버헤드 / 시뮬레이터 지원 필요(ISS는 지원 x) => not feasible cosim?

  • 트레이스 기반 시뮬레이션

  • 다른 방법
    = 명령어 페치 최적화
    = 동기화 비용을 가볍게

병렬 통합시뮬레이션

분산 이벤트 기반 시뮬레이션

-로컬 클락(LCK)를 가짐, pair-wise sync만 필요함(전체 동기화 필요x) -데드락 문제

어떻게 데드락을 해결할 것인가?

-null message -deadlock detection and recovery(chandy and misra) = 매니저가 데드락 감지 후 강제로 실행

*HSIM: Parallel Simulator Structure ISS에서 시뮬레이션, Backplane에서 동기화. LCK는 어떤 Global 클락 정보를 가지고 있지 않음(단순 카운터)

일정 간격을 두고 null 메시지를 보냄(시간 정보 교환)

실제 구현 관점으로 살펴보면- 시뮬레이터가 메모리에 데이터를 보내고, 모든 시뮬레이터가 데이터를 보낼때까지 블락됨 시뮬레이터마다 wrapper를 두고 null 메시지(시간)를 다른 시뮬레이터와 교환

최적의 시간 주기? -짧으면 오버헤드 -길면 동기화 시간

perioidic notification

parallel distributed event simulator PDES

  • async communication
  • simular to null message transfer

solicied: 커널이 ISS에 요청하는가?

Interrupt Modeling

*인터럽트를 통신 수단으로

인터럽트 도착은 예측 불가

  • 언제나 발생 가능
  • 매변 확인? -> 동기화 오버헤드

해결책: 주기적으로 인터럽트 폴링

HSIM

Simulation cache and Message grouping techniques

reduce synchronous communication

Cache Coherence

  • Assuming the relaxed memory model
  • Fork-join model
  • Queue-based communication

Cache Configuration

1024 크기보다 크면 효율 비슷(compulsory miss)

  1. Compare the SW simulation techniques in terms of speed, accuracy, and applicability

ISS, compiled/interprete,

  1. Explain how the following technique can improve the simulation performance.

a) TLM: Higher level abstraction b) Optimistic cosimulation: checkpoint / low level => usally not supported commercial c) hardware emulation

  1. For the parallel co-simulation technique (HSIM), answer the followings:

a) idea => local clock b) periodic update => null message(timing information) c) interrupts => internal/external d) cache boost => prefetch whole data