heterogeneous multicore

26
The World Leader in High Performance Signal Processing Heterogeneous Multicore for blackfin implementation pen Platform Solutions teven Miao

Upload: erwin

Post on 25-Feb-2016

115 views

Category:

Documents


1 download

DESCRIPTION

Heterogeneous Multicore. for blackfin implementation. Open Platform Solutions Steven Miao. Outline. Modern SoC architecture Generic AMP/IPC framework overview Intercore communication protocol Userspace API for intercore communication(MCAPI) Q & A. The emergence of multicore. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Heterogeneous  Multicore

The World Leader in High Performance Signal Processing Solutions

Heterogeneous Multicorefor blackfin implementation

Open Platform SolutionsSteven Miao

Page 2: Heterogeneous  Multicore

Outline

Modern SoC architectureGeneric AMP/IPC framework overview Intercore communication protocolUserspace API for intercore communication(MCAPI)Q & A

2

Page 3: Heterogeneous  Multicore

3

The emergence of multicore

With the ever-increasing demands for devices, multicore solutions are becoming more prevalent.

Performancepower managementCosts

Page 4: Heterogeneous  Multicore

4

Today’s SoC architecture

Page 5: Heterogeneous  Multicore

5

Ingredients for multicore development

Soc architectureHomogenous coresHeterogeneous cores

Operating system, multicore processingSmpAmpHybrid

ApplicationA collection of threads or tasks

Inter-core communications or message passing mechanism

Page 6: Heterogeneous  Multicore

6

Different Types of multicore

Homogeneous multicore - Multicore chips coming to market all have the same instruction sets/data structures.

Heterogeneous multicore – At least one core in a multicore architecture is different, different instruction sets/data structures.

Page 7: Heterogeneous  Multicore

7

Multicore processing

AMP - A separate OS, or a separate instantiation of the same OS, runs on each CPU.

SMP - A single instantiation of an OS manages all cores simultaneously, and applications can float to any of them.

Page 8: Heterogeneous  Multicore

8

Embedded heterogeneous multicore usage

Performance Increase system performance by implementing multicore hardware and software parallelism.

Migration Avoid costly porting and software rewrite efforts

Usability Enhance an existing real-time device by adding user-interface features on a general purpose operating system.

Reliability/security Improve system robustness by protecting and isolating operating environments from each other.

Even Safety-Critical Software

Page 9: Heterogeneous  Multicore

9

Programming model on heterogeneous multi-core Master and slave modelTypical GP core runs operating system such as Linux,

Microsoft Windows Embedded CE…The DSP as a slave to offload GP core or accelerate

Application Specific task like real-time, audio/video codec, signal processing, power management, runs OS as vdsp, uc/os, nucleus

We need a generic AMP/IPC mechanism

Page 10: Heterogeneous  Multicore

10

A generic AMP/IPC framework

Some existing solutionsSyslink of TI (syslink, dsplink, dspbridge)Qmi of qualcomm(qualcomm msm/modem interface)

Generic IPC framework features for embedded systemControl (power on, boot, power off)CommunicateSynchronizeResource manageMinimal foot printSource level portabilityScalable

Page 11: Heterogeneous  Multicore

11

Hardware Requirements

Each core can interrupt the other (required)Mailbox register for buffer transfer(optional)Shared Memory between cores (required)

16-bit and 32-bit shared memory reads must be indivisiblePossible to either disable or flush the data cache on shared

memory regionDMA to shared memory available from each core

Same memory addressing on each core (desirable)Address N in shared memory on one core is address N in shared

memory on the otherSystem-wide memory protection (optional)

Each core can protect areas of shared memory

Page 12: Heterogeneous  Multicore

12

ICC protocol of ADI

Shared Memory based Inter-core Communication ProtocolMessage passingDsp controlResource managementDesigned for heterogeneous multicore system first Implementation on BF561

Page 13: Heterogeneous  Multicore

13

ADSP-BF561 Block Diagram

Page 14: Heterogeneous  Multicore

14

Message Format

typedef struct { sm_endpoint_t dst_ep, src_ep; sm_uint32_t type; sm_uint32_t length; /* data1 */ sm_address_t payload; /* data0 */} sm_msg_t;

Page 15: Heterogeneous  Multicore

15

All protocol Types

Protocol type Value Protocol nameSP_CORE_CONTROL 1 Core control protocol

SP_TASK_MANAGER 2 Task manager protocol

SP_RES_MANAGER 3 Resource manager protocol

SP_PACKET 4 Connectionless packet transfer protocol

SP_SESSION_PACKET 5 Connection packet transfer protocol

SP_SCALAR 6 Connectionless scalar transfer protocol

SP_SESSION_SCALAR 7 Connection scalar transfer protocol

Page 16: Heterogeneous  Multicore

16

coreA

ep1

ep2

ep3

ICC message passing

coreB

ep1

ep2

ep3

msg queue

Page 17: Heterogeneous  Multicore

17

User Interface

Linux User Interface, device node /dev/iccioctl(fd, CMD_DSP_START, NULL); ioctl(fd, CMD_DSP_STOP, NULL);

DSP User InterfaceDSP initializationApplication entryEntry(icc_task_init)Entry(icc_task_exit)

Page 18: Heterogeneous  Multicore

18

DSP task on core BLink coreB application$(LD) -static $(LDFLAGS) -o $@ -T coreb_task.lds --just-symbol $(ICC_CORE)$< $(LIBMCAPI_COREB) -Ttext $(TASK_LOAD_BASE)coreb_task.lds: .text_l1 : { /* basiccrt.o(.text) */ *(.l1.text) } >MEM_L1_CODE =0 .text : { /* *(EXCLUDE_FILE (*basiccrt.o ) .text) */ *(.text .stub .text.* .gnu.linkonce.t.*) KEEP (*(.text.*personality*)) /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) } >MEM_ICC =0

Page 19: Heterogeneous  Multicore

19

Run DSP task on core B

Dynamic load by icc_loader

Parsing the executable image file format(bfin ELF, vdsp ELF)Find the task entriesLoading and controlling the DSP bare metal application via

task manager protocol.Core B will start running task from task init entry

Page 20: Heterogeneous  Multicore

20

Why MCAPI?

A unified communications API to handle this multitude of hardware and software

Standardized ScalablePortable

Page 21: Heterogeneous  Multicore

21

Goals of MCAPI

Generic API for any target and OSFast, lightweight, and scalableMultiple channelsFlexiblePortability

Page 22: Heterogeneous  Multicore

22

Key concepts in MCAPI

Endpoints, the start and end points of the communication <domain, node, port> ChannelMessages, connectionless, buffer communication Packet channels, connected, unidirectional , buffer

communication Scalar channels, connected, unidirectional, scalar (8, 16, 32

or 64 bit) communication

Page 23: Heterogeneous  Multicore

23

Mcapi topology

Nodes exchange data via endpointsA node is implementation defined, i.e. a coreAn endpoint is created on a node to send/receive dataMCAPI has no knowledge of the underlying transport

mechanism, share memory, ethernet, linkport, etc.

Page 24: Heterogeneous  Multicore

24

The big picture

core 0 core 1 core 2

Linux SMP RTOS

ICC Resource management

ICC Resource management

MCAPI MCAPI

End applications

Hybrid mixed OS system

Page 25: Heterogeneous  Multicore

25

Resources

ICC protocol on wikihttps://docs.blackfin.uclinux.org/doku.php?id=protocols:icc#inter_

core_communication_introductionMCAPI home page

http://www.multicore-association.org/ Implementation on bf561

http://blackfin.uclinux.org/gf/project/uclinux-dist/scmsvnuClinux-dist/lib/libmcapiuClinux-dist/user/blkfin-app/icc_utils uClinux-dist/linux-2.6.x/drivers/staging/icc

Page 26: Heterogeneous  Multicore

26

ThanksQ&A