Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14,...

60
Soonhoi Ha, SNU 1 1 Feb. 14, 2006 HOPES HOPES : Embedded Software Deve : Embedded Software Deve lopment Environment for MPSoC lopment Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University
  • date post

    15-Jan-2016
  • Category

    Documents

  • view

    213
  • download

    0

Transcript of Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14,...

Page 1: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 11Feb. 14, 2006

HOPESHOPES: Embedded Software Developme: Embedded Software Development Environment for MPSoCnt Environment for MPSoC

Feb. 14, 2006

Soonhoi HaSeoul National University

Page 2: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 22Feb. 14, 2006

Contents

• Introduction• Proposed Design Flow• Key Techniques• Status• Conclusion

Page 3: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 33Feb. 14, 2006

Deep Submicron Era

• Increased chip density– MPSoC (Multiprocessor System on Chip), NoC (Network on Ch

ip)– Increased chip density– Increased NRE cost– Increased manufacturing cost

• Platform based design– Platform: common (HW/SW) denominator over multiple applic

ations– Pre-built and verified (HW/SW) architecture– SW design and system verification are major challenges

Page 4: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 44Feb. 14, 2006

SoC (System-on-a-Chip)

• Assembly of “prefabricated component”– Maximize VC(IP) reuse: over

90% – New economics:

fast and correct design > optimum design

• Design and Verification at the system level– interface between VCs– SW becomes more important

up memory

video unitgraphics

coms DSP custom

software

up

Page 5: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 55Feb. 14, 2006

HOPES Project

• Project– Title: Development of Embedded software design and verificat

ion techniques for MPSoC, Period: 2005.3.1 - 2008.2.29,– Amount: $4,200,000 – Sponsor: Korean Ministry of Information and Communication,

• Mission– Develop an integrated embedded software development envir

onment based on model-based programming techniques and multi-stage validation techniques for MPSoC (Multi-Processor System on Chip)

Page 6: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 66Feb. 14, 2006

Motivation

• Current SoC-related projects (in Korea) focus on hardware design and verification

• Software design on MPSoC– Embedded software with timing and resource constraints– Parallel programming for heterogeneous multiprocessors– Fast virtual prototyping

Page 7: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 77Feb. 14, 2006

Current Practice (in Korea)

• Virtual prototyping– Coware ConvergenSC, ARM(Axys) MaxSim– Manual software and hardware design– TLM (transaction level modeling) simulation: 100K inst./sec

• Model-based programming– UML based tool: (ex) Telelogic TAU– Limited capability: documentation, code structure.

• No tool is available for parallel programming– Manual programming

Page 8: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 88Feb. 14, 2006

Common Intermediate Code (CIC)

CIC (w/ API) translator

Generic API

HOPES Proposal

UMLModel-basedProgramming

(PeaCE model)

KPN

Target HW platform

SW Platform 1 2

API lib.Per-processor code

Static C code analysis

Perf. & power estimationVirtual

prototypingProcessor ISS

Page 9: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 99Feb. 14, 2006

Key Techniques

• SW design techniques– Model-based specification– Partitioning and automatic code generation from

specification– Parallel programming (task parallelism, data parallelism)– Generic APIs (independent of OS and target

architecture)

• SW verification techniques: 3-phase verification– At specification level: static analysis of program

specification and functional simulation– After code generation: static analysis of C code– At simulation time: debugging on virtual prototyping

environment

Page 10: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 1010Feb. 14, 2006

Contents

• Introduction• Proposed Design Flow• Key Techniques• Status• Conclusion

Page 11: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 1111Feb. 14, 2006

Proposed design flow

• Model-based programming– PeaCE model (dataflow + FSM + task model)– ESUML (embedded system UML) model

• CIC (Common Intermediate Code)– OpenMP pragma + generic API

• Static Analysis– Buffer overrun, memory leak, null dereference, stack size

• Virtual prototyping – Performance and power estimation– with source-level debugging capability

Page 12: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 1212Feb. 14, 2006

Software Module Interface

OS API Translator

Verification OS

Code Synthesizer

PeaCE_Modeler

PeaCE_Partitioner

ARM processor simulation

ESUML_Modeler

Power analysis module

MPI Library

Common Intermediate Code (CIC): task_graph.cic

GUI SW Platform

Document generation

Performance analysys module

ESUML_Verifier

results

ESUML_Partitioner

Block library DB

Generic parallel API Generic API

{processorX.c}

virtual prototype system

proc. code with OS

OpenMP translatorparallel API

MPSoC {prototype system}

C-code static analyzer

HW component DBproc. code with generic API

Comm. API Lib.

proc. code without OS

Page 13: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 1313Feb. 14, 2006

PeaCE_Modeler

PeaCE_Partitioner

ESUML_Modeler

▼ 공동 1

Common Intermediate Code (CIC): task_graph.cic

GUI SW Platform

Document gen.

Application_graph.xmluser command

Task_graph.xmlsched.xml

ESUML_Verifier

resultsApp_classDiagram.xmlApp_seqDiagram.xmlAction semantics

{Application_graph.xml}user command

User_commandsched.xml

ESUML_Partitioner

Block perf. DB

TimeCost.xmlarchi.xml

Page 14: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 1414Feb. 14, 2006

OS API Translator

Verification OS

Code Synthesizer

ARM ISS

Power estimation

MPI Library

Common Intermediate Code (CIC): task_graph.cic

Perf. estimation

processor parameter

openMP pragma Generic API

{processorX.c}

processorX.elf

virtual prototype system

code w/ OS

OpenMP translatorparallel API

MPSoC {prototype system}Function symbol table

Cycle-level execution trace

C-code static analyzer

HW component DBproc. Code(generic API)

comm API Lib.

code w/o OS

Page 15: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 1515Feb. 14, 2006

Demo 1. HOPES Design Flow

• Model-based programming (ex: divx player)– PeaCE Model

• Dataflow + (FSM) + task model

– Fault simulation• sample rate inconsistency

(Y;U;V= 3:1:1)• deadlock error

– Functional simulation• Host machine

Page 16: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 1616Feb. 14, 2006

Demo 1. HOPES Design Flow (2)

• C code static analysis – Buffer overrun error detection– Fault simulation: wrong array siz

e in “AviFileReader task”

• Runtime verification– Simulation with Realview ARM d

ebugger– Fault simulation

• Logical error insertion

Page 17: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 1717Feb. 14, 2006

Demo 2. HOPES (single task)

• Single task example: H.263 decoder

• C-code static analysis• Performance and power

estimation – Custom-designed ARM

Simulator– Per-function estimation

• Runtime verification– Source level debugging– Fault simulation : logical error

insertion

Page 18: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 1818Feb. 14, 2006

HOPES flow for single processor

Manual for now

HOPES GUI

PeaCE code gen.- CIC(xml) - CIC(.cic)

Xml files (topology, property)

CIC code withGeneric API, OpenMP pragma

Generic API tranformer

OpenMP translator

Code Synthesizer- C code, Executable

CIC code With Generic API

CIC xml

C codesWith Generic API

ExecutableWith target API

C code staticanalysis

perf. And powerestimation

ARM ISS

Page 19: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 1919Feb. 14, 2006

Demo 3. UML 2.0 –based Modeling

• ESUML : Embedded Software modeling with UML 2.0

Analysis &Design

Verification& Validation

Code Gen. &Optimization

feedback

ESUML Modeler ESUML Statis analyzer ESUML Simulator

Simulation TraceSimulation Trace

Environment Interface Controller Heater

PushButton()

HeaterOn()

Heat()

Heat_OK

DisplayHeat()

Embedded S/W Needs

TargetMPSoC

Page 20: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 2020Feb. 14, 2006

ESUML

• Model – Driven Application Development

Requirements Capturing PIM Modeling

Model Verification

PSM Modeling

Code Generation

Use-Casemodel

Use-Casemodel

Structural model

Structural model

Behavioral model

Behavioral model

H/W architecture modelH/W architecture model

Static AnalysisStatic Analysis

Model SimulationModel Simulation

CIC codeCIC code

PIM : Platform Independent ModelPSM : Platform Specific Model

Physical modelPhysical model JavacodeJavacode

Page 21: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 2121Feb. 14, 2006

ESUML Characterisitcs

• Light-Weight Development Methodology

Real-Time Embedded Software

Interaction-based Behavior Modeling

Large-Scale System

Requirement Capturing

PIM and PSM modeling

Analysis

Code Generation

Use Case DiagramClass DiagramInteraction Overview DiagramSequence DiagramHardware Architecture Diagram

Event-Based Modeling

Hierarchical Decomposition

Modeling Guidelines and Tips

ESUML

Concepts Process

Notations Rules

Page 22: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 2222Feb. 14, 2006

UCDuse case 1

use case 2

use case 3

Scenarios

ESUML Characteristics

• Hierarchical Modeling• Interaction-based Behavior Modeling

IOD of UC3

SDs of X

Global IODs

A B

C

IOD of UC1X

IOD of UC2

Y Global behavioral view SDs of Z SDs of Y

SDs of X

Page 23: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 2323Feb. 14, 2006

PSM Modeling (To-Be)

• PSM Modeling : Physical Model

ref Door Opened

ref Door Closed

ref Cook Button Pressed

ref Cooking Complete

ref Waiting

DoorClosed

CookButtonPressed

CookButtonPressed

DoorOpened

[ Door. isOpen()==false]

OvenCtrl Beeper

beep()

sd Single Beep

[ Door. isOpen()==true]

TimerExpired

ref Cancel Button PressedCancelButtonPressed

ref DoorOpenedDoorOpened

sd Cook

Add60SecTimer

StartTimer

StopTimer

Add60SecTimer

P11_ActiveMain

P30_PostProcessing

P20_ActiveSub1

P12_ActiveSub2

ARM1 ARM2SRAM1 SRAM2S_SRAM1

AHB_1

AHBtoAHBBridge

AHB2

ARMSub S_SRAM2TFTLCD

Ctrl

DMACtrl

APB1

IntrCtrl AudCodec UARTCtrl

AHBtoAPBBrdige I2CCtrlGPIOCtrlDCTIDCT

RDRAMCtrlARM1 ARM2SRAM1 SRAM2S_SRAM1

AHB_1

AHBtoAHBBridge

AHB2

ARMSub S_SRAM2TFTLCD

Ctrl

DMACtrl

APB1

IntrCtrl AudCodec UARTCtrl

AHBtoAPBBrdige I2CCtrlGPIOCtrlDCTIDCT

RDRAMCtrl

Automatically Recommended Partition +ModelerEnforced Partition

Page 24: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 2424Feb. 14, 2006

ESUML Code Gen. (To-Be)

• Platform Independent Code Generation

PIM/PSM Models

C

C++

JAVACICCICCode Generator

Page 25: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 2525Feb. 14, 2006

ESUML Verification and Validation

• Rule-based consistency analyzer– Intra-model, inter-model, action-language

64Rules

Page 26: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 2626Feb. 14, 2006

ESUML Simulator

MicroOven.XMI File

SimMicroOven.txt

Define Scenario

Simulation result

(1) input

(2) input

Feedback to Modeler

(4) output

(5) save

(5) modify model (if needed)

SimulationEngine

Simulation TraceSimulation Trace

Environment Interface Controller Heater

PushButton()

HeaterOn()

Heat()

Heat_OK

DisplayHeat()

(3) output

CFGGeneration

Page 27: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 2727Feb. 14, 2006

Contents

• Introduction• Proposed Design Flow• Key Techniques

– PeaCE Modeling– CIC & Generic API– Static Analysis

• Status• Conclusion

Page 28: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 2828Feb. 14, 2006

PeaCE Model

• Top model: Task model

• Computation task model: Dataflow model– Extended SDF model: SPDF (Synchronous Piggybacked Data Fl

ow) and FRDF (Fractional Rate Data Flow)

• Control task model: FSM model– Hierarchical and concurrent FSM model: fFSM (flexible Finite

State Machine)

Page 29: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 2929Feb. 14, 2006

PeaCE Project

• PeaCE– Ptolemy extension as a Codesign Environment

based on Ptolemy classic– open-source research platform– Officially released in DAC 2005. (version 1.0)

• PeaCE home page– http://peace.snu.ac.kr/research/peace

Page 30: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 3030Feb. 14, 2006

Seamless HW/SW Codesign Flow

1 2 3

4 5 6 7 8

Func. Simulation

C-code

PE SelectionPartition & mapping

DB

sched.xml

PE Code generation

Comm. arch DSE

IF Code generation

OS API

Coverification & Prototyping

clustered.xml

Archi.xml

VHDL-codeC-code

Graph Analysis

+

Profiling33333

11

44

35335

36336

37337

36336 37337

38338

38338

TimeCost.xml.

Algorithm spec. Architecturetemplates

22

Block Lib.

Page 31: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 3131Feb. 14, 2006

Divx Player: Top Model

Page 32: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 3232Feb. 14, 2006

H.264 Decoder

if-then-else construct

Page 33: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 3333Feb. 14, 2006

SPDF Model

• Basic SDF Model– A node represents a function block (ex: FIR, DCT) – A block is fireable (executable when it receives all required nu

mber of input samples) – Statically scheduled at compile-time:

sample rate inconsistency, deadlock condition

• Our extensions– Generic message type data -> code generation only– FRDF: fractional rate data flow– SPDF: synchronous piggybacked dataflow

Page 34: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 3434Feb. 14, 2006

Fractional Rate Dataflow

Schedule : 99(ME,EN)

The macro block is 1/99 of the video frame in its size.

For each execution of the ME node, it consumes a macro-blockfrom the input frame, and produces a macro-block output.

ME1

EN1 1

1/99

1/99 16x16

Page 35: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 3535Feb. 14, 2006

FRDF (Fractional Rate DF)

Reference Code SDF FRDF

361KB 686KB 225KBBuffer size

5 8 3No. of frameType data

MotionEstimation

MacroBlock

Encoding

VariableLengthCoding

MacroBlock

Decoding

MotionCompensation

WriteTo

Device

ReadFrom

Device

11/99

1 1 1

1111/99

1/99

1 1/99

11/99

Page 36: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 3636Feb. 14, 2006

Synchronous Piggybacked Dataflow

• Global data structure with limited access• Each data sample is piggybacked with an SU

request• A block updates its internal parameters

depending on applicability of SU request

PD A B C

“gain”= 5

SU

data

piggyback

202nd iteration

“gain”= 10

C

“gain” 10

….

State name 1st iteration

Page 37: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 3737Feb. 14, 2006

SPDF (Synchronous Piggybacked DF)

• Piggybacking the control variable• Special super-block definition for the body of DC

PB

xc

A B

Mux

y

1 0MUX

A B

x

y

c

Page 38: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 3838Feb. 14, 2006

fFSM (flexible FSM) Model

• Hierarchical FSM

• Concurrent FSM

A

a

b/v

C Dc/u

B

A BC

BD

a

b/v

b/v b’c/u

AC BC

AD BD

ac’

bc’

a

b

a’c b’cbcac

A B

C D

a

b

c

Page 39: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 3939Feb. 14, 2006

fFSM + SPDF

start

divx

divxstop

scripts in divx {deliver ui filename divxread filename} {run divx}

stop==1/tostart=1

tostart==1

script in divxstop{stop divx}

text==4exitDivx==1

exit

1

script in exit state{get divx exit exitDivx}

divxrun

divxsuspend

script in divxrun{run divx}

script in divsuspend{suspend divx}

suspend==1

start==1

startsuspend

stoptext

AVIReader

H.263Decoder

MP3Decoder

divx

divxread

exit

Page 40: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 4040Feb. 14, 2006

Task Model

• Task execution semantics– periodic, sporadic, functional

• Port properties– data rate : static or dynamic – data size : static or variable– port type : queue or buffer

AviReader

H.263decoder

MP3decoder

periodic

Basic Task Block(SDF or FSM)

Task Wrapper

Execution Typeport semantic

Page 41: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 4141Feb. 14, 2006

CIC Code Generation

• Application tasks– Task in task-level specification model task_name.cic

• Generic API• Partitioning considering data parallelism

– openMP programming

void h263decoder_go (void) {...

        l = MQ_RECEIVE("mq0", (char *)(ld_106->rdbfr), 2048);         ...         # pragma omp parallel for         for(i=0; i<99; i++) {              //thread_main()

....         }          // display the decode frame            dither(frame);          }

Page 42: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 4242Feb. 14, 2006

CIC Format

Architecture Task Code

Constraints

Structure

Kernel code_init()_go()

_wrapup()

Generic API Parallel API

Hardware

Page 43: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 4343Feb. 14, 2006

DivX player CIC xml (Hardware)

<?xml version="1.0" ?> <CIC_XML> <hardware> <processor name="arm926ej-s0"> <index>0</index> <localMem name=“lmap0”> <addr>0x0</addr> <size>0x10000</size> // 64KB </localMem> <sharedMem name=“shmap0”> <addr>0x10000</size> <size>0x40000</size> // 256KB <sharedWith>1</sharedWith> </sharedMem> <OS> <support>TRUE</support> </OS> </processor>

<processor name="arm926ej-s1"> <index>0</index> <localMem name=“lmap1”> <addr>0x0</addr> <size>0x20000</size> // 128KB </localMem> <sharedMem name=“shmap1”> <addr>0x20000</size> <size>0x40000</size> // 256KB <sharedWith>0</sharedWith> </sharedMem> <OS> <support>TRUE</support> </OS> </processor> </hardware>

Page 44: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 4444Feb. 14, 2006

P1P1 P2P2LocalMem

Shared Mem

TCM0x0

0x10000

shared=NO

0x50000

shared=YES

0x0

0x20000

shared=NO

0x60000

shared=YES

Hardware Architectures

P1P1 P2P2 P3P3

SM1

SM2

Page 45: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 4545Feb. 14, 2006

DivX player CIC xml (Constraint)

<constraints> <memory>16MB</memory> <power>50mWatt</power> <mode name="default"> <task name="AviReaderI0"> <period>120000</period> <deadline>120000</deadline> <priority>0</priority> <subtask name="arm926ej-s0"> <execTime>186</execTime> </subtask> </task> <task name="H263FRDivxI3"> <period>120000</period> <deadline>120000</deadline>

<priority>0</priority> <subtask name="arm926ej-s0"> <execTime>5035</execTime> </subtask> </task> <task name="MADStreamI5"> <period>120000</period> <deadline>120000</deadline> <priority>0</priority> <subtask name="arm926ej-s0"> <execTime>13</execTime> </subtask> </task> </mode></constraints>

Page 46: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 4646Feb. 14, 2006

DivX player CIC xml (Structure)

<structure> <mode name="default"> <task name="AviReaderI0"> <subtask name="arm926ej-s0"> <procMap>0</procMap> <fileName>AviReaderI0_arm926ej_s0.cic</fileName> </subtask> </task> <task name="H263FRDivxI3"> <subtask name="arm926ej-s0"> <procMap>0</procMap> <fileName>H263FRDivxI3_arm926ej_s0.cic</fileName> </subtask> </task> <task name="MADStreamI5"> <subtask name="arm926ej-s0"> <procMap>0</procMap> <fileName>MADStreamI5_arm926ej_s0.cic</fileName> </subtask> </task> </mode>

<queue> <name>mq0</name> <src>AviReaderI0</src> <dst>H263FRDivxI3</dst> <size>30000</size> </queue> <queue> <name>mq1</name> <src>AviReaderI0</src> <dst>MADStreamI5</dst> <size>30000</size> </queue></structure></CIC_XML>

Page 47: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 4747Feb. 14, 2006

Task Code: Structure

• Task kernel code – _init(): before main loop– _go(): in the main loop – _wrapup(): after main loop

(example) h263dec.cic // header file // global declaration and definition // procedure definition h263dec_init() { … }

h263dec_go() { … } h263dec_wrapup() { … }

Page 48: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 4848Feb. 14, 2006

Generic API

• Generic API– OS-indepednent API– API translator to OS-specific APIs

• Generic API Definition– Abstraction from IEEE POSIX 1003.1-2004– OS services:

• Process, memory, synchronization, file system, networking, real-time, thread, I/O, timer, etc.

– C library functions based on use frequency• stdio.h, stdlib.h, time.h, signal.h

Page 49: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 4949Feb. 14, 2006

Generic API 정의function header total API Selected API Generic API

C Library Signal, I/O, Time

signal.h 26 2 2stdio.h 65 19 10stdlib.h 68 5 3time.h 30 3 3

OS Services

Processsched.h 8 3 3sys/wait.h 3 1 1unistd.h 79 13 13

Memory stdlib.h 68 5 3

Synchronizationsys/mman.h 14 4 4pthread.h 100 21 12

File systemfcntl.h 5 1 1sys/stat.h 9 2 2unistd.h 79 13 13

IPCmqueue.h 10 8 5semaphore.h 10 8 3sys/mman.h 14 4 4

Network sys/socket.h 18 11 9

Realtimemqueue.h 10 8 5semaphore.h 10 8 3sched.h 8 3 3

Thread pthread.h 100 21 12

I/Ostropts.h 8 1 1sys/select.h 6 1 1poll.h 1 1 1

Timertime.h 30 3 3sys/time.h 4 3 3

Total     18 464 107 77

Page 50: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 5050Feb. 14, 2006

OS API Translator

• OS API Translator

OS API Translator

OS-Specific C Code

Code Analysis

Transformation

Symbol TableConstruction

CIC’s Task Code APIs, Patterns, and Rules

register

Generic APIs

modify

POSIX APIs

Non-POSIX APIs

TransformationRules

Translation pattern and rules

Pattern mapping - 1-to-1, 1-to-m, n-to-m - initialize/finalize - acquire/releaseparameters - type, number, valueVariable names - naming of additional variables

Page 51: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 5151Feb. 14, 2006

Airac5

• Static Analyzer for Detecting All Buffer Overrun Errors in C Programs

• Keywords– static program analysis: abstract interpretation – C: ANSI C + somje GNU C extensions– all: detects all buffer-overrun places – statically: at compile-time– always stops: finishes even for infinite-loop programs– modular: separate C files– correct: based on a firm theoretical framework

• SAS’05, BUGS’05• being in use inside Samsung and LG

Page 52: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 5252Feb. 14, 2006

Airac5’s Performance(1/3)

Linux kernel-2.6.4

Software #Lines Time(sec) #Alarms #Bugs

vmax301.c 246 7.42 1 1

cdc-acm.c 849 17.66 7 2

atkbd.c 944 4.20 3 2

eata-pio.c 984 15.45 16 1

ip6_output.c 1110 47.69 0 0

xfrm_user.c 1201 56.52 4 1

keyboard.c 1256 90.42 31 1

af_inet.c 1273 186.06 12 2

usb-midi.c 2206 53.98 12 4

mptbase.c 6158 206.04 12 1

on P4, 3.2GHz, 4GB

Page 53: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 5353Feb. 14, 2006

Airac5’s Performance(3/3)

Program(LOC)

Airac5 SWAT#Real Bugs

#Time(sec)

#Alarms

#Alarms

vmax301.c(246) 7.42 1 1 1

xfrm_user.c(1201)

56.52 4 1 1

usb_midi.c(2206) 53.98 12 2 4

atkbd.c(944) 4.20 3 2 2

keyboard.c(1256) 90.42 31 1 1

af_inet.c(1273) 186.06

12 1 2

eata_pio.c(984) 15.45 16 1 1

cdc_acm.c(849) 17.66 7 1 2

ip6_output.c(1110)

47.69 0 1 0

mptbase.c(6158) 206.04

12 1 1

aty128fb.c(2466) 98.49 4 1 1

Comparison with Coverity’s SWAT

Page 54: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 5454Feb. 14, 2006

GNU applications

Software #Lines Time(sec)

#Alarms #Bugs

tar-1.13 20258 2003 76 1

bison-1.875 25907 7050 30 0

sed-4.0.8 6053 256 5 0

gzip-1.2.4a 7327 330 50 0

grep-2.5.1 9297 1314 24 0

Airac5’s Performance(2/3)

• Statistical technique ranks the alarms• Linear regression statistical analysis• Users see truer alarms first• 4.10% of false alarms mixed up until 50% of true alarms seen

Page 55: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 5555Feb. 14, 2006

Airac5 Available

• free-trial version• performance data• on-line demo• etc informationqq

ropaswork.com/airac5

Page 56: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 5656Feb. 14, 2006

Contents

• Introduction• Proposed Design Flow• Key Techniques• Status• Conclusion

Page 57: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 5757Feb. 14, 2006

Status (1)

• CIC and Generic API translator– Translator for single processor– To-do

• openMP translator• support on more APIs

• Target specific API libraries– ARM multi-processor platform for now– To-do

• Libraries for a real MPSoC platform

Page 58: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 5858Feb. 14, 2006

Status (2)

• Virtual Prototyping– 1st version of ARM simulator and debugger – To-do

• Multiprocessor system simulator and source level debugger• OS porting on the ISS

• Performance and power estimation– Function-based estimation for ARM processor– To-do

• system-level estimation, other processors

Page 59: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 5959Feb. 14, 2006

Conclusion

• HOPES is a newly launched project to make a embedded software development environment for MPSoCs– Support of diverse models– Target independent environment + target specific libraries– 3-phase verification: model-level, C code static analysis, run-t

ime simulation– Integration of software modules at various stages

– http://peace.snu.ac.kr/hopes (sorry, only Korean for now)

Page 60: Soonhoi Ha, SNU 11 Feb. 14, 2006 HOPES: Embedded Software Development Environment for MPSoC Feb. 14, 2006 Soonhoi Ha Seoul National University.

Soonhoi Ha, SNU 6060Feb. 14, 2006

Thank you !