www.ti.com
6.7AbstractInterface
AbstractInterface
DMAGuideline1
ThedatatransfershouldcompletebeforetheCPUoperationsexecutinginparallel.
However,wecanneverguaranteethatthedatatransfersarecompletebeforedataareaccessedbythe
CPU,evenifthealgorithmisdesignedinsuchaway(e.g.,futureincreaseinCPUspeedandnotDMA
transferrate).However,sinceitisimportantthatthedatatransfercompletesbeforeaccessingthedatato
ensureaccurateexecutionofthealgorithm,wehaveprovidedtwowaystosynchronizethemethodsof
transferanddataaccess.
•ThealgorithmcancalltheACPY2_complete()runtimeAPItocheckifalldatatransfersonaparticular
logicalchannelhavecompleted.
•ThealgorithmcancalltheACPY2_wait()runtimeAPItowaitforalldatatransfersonaparticular
logicalchanneltocomplete.WhenusingtheACPY2librarywithIDMA2interfaces,thealgorithmscan
calltheACPY2_complete()runtimeAPItocheckifalldatatransfersonaparticularlogicalchannel
havecompleted
Afteranalgorithmreturnstothecallerfromaframework-callablefunction,theclientofthealgorithmisfree
tomoveallitsmemorytoadifferentlocationandshareitsscratchmemoryfollowingtherulesintheIALG
interface.Itisimportantthatdatatransfersdonotoccuracrossfunctionsthatcanbecalledbytheclientto
avoidasituationwheretheDMAistransferringdataandtheframeworkismovingthelocationsofthe
buffersatthesametime.
DMARule1
Alldatatransfermustbecompletedbeforereturntocaller.
WhenusingtheACPY2library,thealgorithmcanusetheACPY2_complete()orACPY2_wait()APIsto
ensurethatalldatatransfershavecompletedbeforereturningtothecaller.
Forexample,analgorithmcannotstartadatatransferinalgActivate()bycallingACPY2_start()or
ACPY2_startAligned()andthencheckforcompletionofthedatatransferinthealgorithm's"process"
functionbycallingACPY2_complete(),orwaitforthecompletionbycallingACPY2_wait().Thealgorithm
mustensurethedatatransferiscompleteinaalgActivate()byusingeithertheACPY2_complete()or
theACPY2_wait()API.
Note:Similartotheabove-mentionedACPY2APIs,theACPY3librarymentionedinUsingDMAwith
FrameworkComponentsforC64x+(SPRAAG1)canbeusedbyalgorithmsthatimplementtheIDMA3
interfaces,torequestDMAservicesfromtheC64x+EDMA3controller.However,unliketheACPY2
library,theuseoftheACPY3libraryisNOTmandatorywiththeIDMA3interfaces.
eXpressDSP-compliantalgorithmsaremodulesthatimplementtheabstractinterfaceIALG.Algorithms
thatwanttoutilizetheDMAresourcemustimplementtheabstractinterfaceIDMA2orIDMA3.Thismeans
thatthemodulemustdeclareandinitializeastructureoftypeIDMA2_Fxns,thestructuremusthavea
globalscope,itsnamemustfollowtheuniformnamingconventions,andthestructuremustbedeclaredin
theheaderfileincludedwiththemodule'slibrary.
ThealgorithmproducerimplementstheIDMA2orIDMA3interfacetodeclarethealgorithm'sDMA
resourcerequirement.Thealgorithm'sclientcallsthisinterfacetogettheresourcerequirement,grant
resources,andchangeresourcesatruntime.
DMARule2
AllalgorithmsusingtheDMAresourcemustimplementtheIDMA2orIDMA3interface.
AlleXpressDSP-compliantalgorithmssupportbothrun-timeanddesign-timecreationofalgorithmobjects.
Tooptimizewithregardstocodespacefordesign-timeobjectcreation,itisimportantthatallmethods
definedbytheIDMA2orIDMA3interfaceareindependentlyrelocatable.
SPRU352G–June2005–RevisedFebruary2007UseoftheDMAResource65
SubmitDocumentationFeedback