system-on-chip design

22
System-on-Chip Design HW/SW Interfaces and Communica;ons Hao Zheng Comp Sci & Eng U of South Florida 1

Upload: others

Post on 10-Dec-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: System-on-Chip Design

System-on-ChipDesignHW/SWInterfacesandCommunica;ons

HaoZhengCompSci&EngUofSouthFlorida

1

Page 2: System-on-Chip Design

SystemStructuralModel

2

Bridge

HW

P5

HW

P3P4

P1P2

CPU MemArbiter

Page 3: System-on-Chip Design

BasicElementsofHW/SWInterfaces

3

1.On-chipcommunicaConfabrics,ex.buses

Page 4: System-on-Chip Design

BasicElementsofHW/SWInterfaces

4

2.CPUinterfaceforSWtocommunicatewithcustomHW.

Page 5: System-on-Chip Design

BasicElementsofHW/SWInterfaces

5

3.HWinterfaceforcustomHWtocommunicatewithCPU.

Page 6: System-on-Chip Design

BasicElementsofHW/SWInterfaces

6

4.SWdriverconvertsSWIOoperaConstooperaConssupportedbyCPUinterface.

Page 7: System-on-Chip Design

BasicElementsofHW/SWInterfaces

7

5.ProgrammingmodelwhereSWrunningCPUusestocontrolcustomHWmodule.

Page 8: System-on-Chip Design

Synchroniza;onSchemes

8

SynchronizaConisnecessaryforeffecCvecommunicaCons,i.e.datatransferredbetweenCPUandHWcorrectly.

SynchronizaConispartofinterfaceimplementaCon.

Page 9: System-on-Chip Design

Synchroniza;onSchemes

9

Time:howsynchronizaConisdefinedoverCme.

Page 10: System-on-Chip Design

Synchroniza;onSchemes

10

Data:howdataisrepresentedinsynchronizaCon.

Page 11: System-on-Chip Design

Synchroniza;onSchemes

11

Control:howsynchronizaConisimplementedlocallyinindividualmodules..

Page 12: System-on-Chip Design

Semaphores

•  Usedtocontrolofaccessestosharedresource.•  TwoopsonsemaphoreS:– P(S):acquireS.– V(S):releaseS.

•  Howcanweensureanorderbetweenthread 1&2?

12

thread1:…P(S);x++;V(s);…

thread2:…P(S);x=x–2;V(s);…

Page 13: System-on-Chip Design

Semaphores

13

intshared_data;semaphoreS;

enCtyone{P(S);while(1){short_delay();shared_data=…;V(S);}}

enCtytwo{short_delay();while(1){P(S);rd=shared_data;}}

Page 14: System-on-Chip Design

Semaphores

•  Semaphorescanonlyguaranteeexclusiveaccesstosharedresources.– Difficulttocontrolprecisedatatransfer– MulCplesemaphorescanbeused,butnotelegant.

•  Handshaking:asignalingprotocolbetweentwoenCCestocoordinatedatatransfers.– CanhandleenCCeswithdifferentspeeds.

14

Page 15: System-on-Chip Design

One-WayHandshake

15

AssumethatenCtytwoisslower.

Page 16: System-on-Chip Design

Two-WayHandshake

16

Page 17: System-on-Chip Design

X

Two-WayHandshakeforDataTransfer

17

reqackdata

XXXXX d1

clk

req

ack

data

Src Dest

XXX

Page 18: System-on-Chip Design

Communica;onConstrainedvsComputa;onConstrained

18

SystemperformanceshouldconsiderbothcomputaConperformanceandcommunicaConoverhead.

Page 19: System-on-Chip Design

Communica;onConstrainedvsComputa;onConstrained

19

Page 20: System-on-Chip Design

TightandLooseCoupling

20

Coupling:thelevelofinteracConsbetweentwocomponents.

DegreeofcouplingaffectschoiceandimplementaConofsynchronizaCon.

Page 21: System-on-Chip Design

DedicatedvsSharedInterfaces

21

282 9 Principles of Hardware/Software Communication

Table 9.2 Comparing acoprocessor interface with amemory-mapped interface

Coprocessor Memory-mappedFactor interface interface

Addressing Processor-specific On-chip bus addressConnection Point-to-point SharedLatency Fixed VariableThroughput Higher Lower

describe in detail in the next Chapters – are called memory-mapped interface andcoprocessor interface respectively. Table 9.2 compares the key features of these twointerfaces.

These two interfaces each take a different approach to synchronization. In thecase of a coprocessor interface, synchronization between a hardware module andsoftware is at the level of a single instruction. Such a coprocessor instructiontypically carries both operands (from software driver to hardware coprocessor)as well as result (from hardware coprocessor to software driver). In the case ofa memory-mapped interface, synchronization between a hardware module andsoftware is at the level of a single bus transfer. Such a bus transfer is unidirectional(read or write), and either carries operands from the software driver to the hardwarecoprocessor, or else results from the hardware coprocessor to the software driver.Clearly, the use of a coprocessor interface versus a memory-mapped interface implya different style of synchronization between hardware and software.

A given application can use either tight-coupling or loose-coupling. Figure 9.10shows how the choice for loose-coupling of tight-coupling can affect the latenciesof the application. The left side of the figure illustrates a tight-coupling scheme.The software will send four separate data items to the custom hardware, each timecollecting the result. The figure assumes a single synchronization point which sendsthe operand and retrieves the result. This is the scheme that could be used by acoprocessor interface. The synchronization point corresponds to the execution of acoprocessor instruction in the software.

The right side of the figure illustrates a loosely coupled scheme. In this case, thesoftware provides a large block of data to the custom hardware, synchronizes withthe hardware, and then waits for the custom hardware to complete processing andreturn the result. This scheme would be used by a memory-mapped interface, forexample using a shared-memory.

Loosely-coupled schemes tend to yield slightly more complex hardware designsbecause the hardware needs to deal more extensively with data movement betweenhardware and software. On the other hand, tightly-coupled schemes lean moreon the software to manage overall system execution. Achieving a high degree ofparallelism in the overall design may be easier to achieve with a loosely-coupledscheme than with a tightly-coupled scheme.

Cghtcoupling

loosecoupling

NatureofcouplingaffectstheorganizaConofHW/SWinterfaces

Page 22: System-on-Chip Design

ReadingGuide

•  Chapter9,theCoDesignbook.

22