www.ti.com
6.3RequirementsfortheUseoftheDMAResource
6.4LogicalChannel
RequirementsfortheUseoftheDMAResource
throughthelogicalDMAchannelsitacquiresthroughtheIDMA2protocol.
AdetaileddescriptionoftheseAPIscanbefoundintheTMS320DSPAlgorithmStandardAPIReference
(SPRU360).
BelowisalistofrequirementsforDMAusageineXpressDSP-compliantalgorithms.Theserequirements
willhelptoclarifytheintentofthestatedrulesandguidelinesinthischapter.
1.AllphysicalDMAresourcesmustbeownedandmanagedbytheframework.
2.AlgorithmsmustaccesstheDMAresourcethroughahandlerepresentingalogicalDMAchannel
abstraction.ThesehandlesaregrantedtothealgorithmbytheframeworkusingastandardIDMA
interface.
3.Amechanismmustbeprovidedsothatalgorithmscanensurecompletionofdatatransfer(s).
4.TheDMAschememustworkwithinapreemptiveenvironment.
5.Itmustbepossibleforanalgorithmtorequestmultiframedatatransfers(two-dimensionaldata
transfers).
6.Theframeworkmustbeabletoobtaintheworst-caseDMAresourcerequirementsatalgorithm
initializationtime.
7.TheDMAschememustbeflexibleenoughtofitwithinstaticanddynamicsystems,andsystemswitha
mixofstaticanddynamicfeatures.
8.AllDMAoperationsmustcompletepriortoreturntocaller.ThealgorithmmustsynchronizeallDMA
operationsbeforereturntothecallerfromaframework-callableoperation.
9.ItmustbepossibleforseveralalgorithmstoshareaphysicalDMAchannel.
DSPalgorithms,dependingonthetypeofalgorithmandtheexecutionflowofthealgorithm,might
scheduletheuseoftheDMAresourceindifferentways.Forexample:
•AnalgorithmmightneedtodoaDMAtransferbasedonresultsafterdecodinganencodedbitstream.
Theresultsfromthesecalculationsdeterminethesource,destination,andconfigurationofaDMAdata
transfer.AllthisinformationmustbepassedtotheDMAdevicetostartthedatatransfer.Thistypeof
datatransferisdatadependent,anditsconfigurationmustthereforebedeterminedon-the-fly.
•AnalgorithmmightscheduleafixednumberofDMAdatatransfersintoitsprogramflowandthe
configurationofthesetransfersmightbethesame.Itisonlynecessarytoprovidethesourceand
destinationinformationtoexecutethesedatatransfers,sincetheconfigurationisfixed.Thistypeof
datatransferisnotdata-dependent;itsconfigurationcanbepredetermined.
•Somealgorithmsmighthaveamixtureoftheabovescenarios.Thesealgorithmshavesome
predetermineddatatransfersandsomedatadependentdatatransfers.
WhenusingtheIDMAinterfaces,aDMAhandleisgrantedtothealgorithmbytheframeworkduring
initialization.ThishandlecanbefurtherutilizedbytheACPY2APIsusedbyIDMA2orcustomprotocols
usedbyIDMA3,toconfigure,requestandsynchronizethedatatransfers
Theterm"logicalchannel"isassociatedwitheachDMAhandlethattheframeworkprovidestothe
algorithmandrepresentsanabstractionforadedicated"privateDMAchannel.Thealgorithmownsthe
logicalchannelitreceives.ThealgorithmusesthechannelhandlestoconfigurethechannelDMAtransfer
settings,submitasychronousDMAtransferrequests,andqueryandsynchronizewiththecompletion
statusofscheduledtransfers.Thelogicalchannelretainsitsstateandappliesthemostrecent
configurationsettingswhenschedulingatransfer.Thechannelconfigurationdetermines,forexample,the
sizeoftheelementsandthenumberofframesinmultiframetransfers.Adatatransferdescriptionis
completewhenthesourceanddestinationinformationandtheframelengthareaddedtothelogical
channel'sconfiguration.
Thelogicalchannelconceptcanbeusedintelligentlybythealgorithmdesignertooptimizethealgorithm's
performance.Forexample,algorithmswithdatatransfersusingthesameconfigurationmayrequestone
logicalchannelforallthesetransfers.Thislogicalchanneldoesnotneedtobeconfiguredforeach
transfer.Furthermore,thealgorithmmayrequestanotherlogicalchannelforthedata-dependenttransfers.
Thislogicalchannelmustbeconfiguredforeachtransfer.
SPRU352G–June2005–RevisedFebruary2007UseoftheDMAResource63
SubmitDocumentationFeedback