Texas Instruments TMS320 DSP Computer Hardware User Manual


 
www.ti.com
6.1Overview
6.2AlgorithmandFramework
Overview
Rule6statesthat"Algorithmsmustneverdirectlyaccessanyperipheraldevice.Thisincludesbutisnot
limitedtoon-chipDMAs,timers,I/Odevices,andcachecontrolregisters."
ThefactisthatsomealgorithmsrequiresomemeansofmovingdatainthebackgroundofCPU
operations.Thisisparticularlyimportantforalgorithmsthatprocessandmovelargeblocksofdata;for
example,imagingandvideoalgorithms.TheDMAisdesignedforthisexactpurposeandalgorithmsneed
togainaccesstothisresourceforperformancereasons.
ThepurposeofthischapteristooutlineamodeltofacilitatetheuseoftheDMAresourcesfor
eXpressDSP-compliantalgorithms.ThesupportforDMAhasbeenoriginallyintroducedtotheTMS320
DSPAlgorithmStandardthroughtheadditionofrulesandtwostandardinterfaces:IDMAandACPY.
StartingwiththeTMS320DSPAlgorithmStandardRulesandGuidelines,revisionSPRU352E,andthe
TMS320DSPAlgorithmStandardAPIReference,revisionSPRU360C,weintroduceadditionalDMA
RulesandGuidelinesandnewenhancedinterfaces,IDMA2alongwithACPY2forC64xandC5000
devicesandIDMA3forC64x+devices,whichdeprecatetheoriginalIDMAandACPYinterfaces.
AlgorithmsthathavealreadybeendevelopedusingthedeprecatedIDMAandACPYAPIsremain
eXpressDSP-compliant;however,developmentofnewalgorithmsshouldfollowthenewIDMA2/ACPY2
specificationforaccessingDMAresourcesontheC64xandC5000devicesandtheIDMA3specification
foraccessingresourcesfromtheC64x+EDMA3controller.
ThischapterreferencesruntimeAPIs(IDMA2/IDMA3andACPY2)thatgrantalgorithms
framework-controlledaccesstoDMAresources.AdetaileddescriptionoftheseAPIscanbefoundinthe
TMS320DSPAlgorithmStandardAPIReference(SPRU360).
ThischapterspecifiesrulesandguidelinestofacilitatetheuseoftheDMAresourcesforalgorithms.For
analgorithmtoutilizetheDMAresources,therulesoutlinedinthischaptermustbefollowedinordertobe
consideredeXpressDSP-compliant.Theseguidelinesarestronglysuggestedrecommendations.
Thealgorithmstandardlooksuponalgorithmsaspure"datatransducers."Theyare,amongotherthings,
notallowedtoperformanyoperationsthatcanaffectschedulingormemorymanagement.Allthese
operationsmustbecontrolledbytheframeworktoensureeasyintegrationofalgorithms,possiblyfrom
differentvendors.Ingeneral,theframeworkmustbeincommandofmanagingthesystemresources,
includingtheDMAresource.
AlgorithmscannotaccesstheDMAregistersdirectly,norcantheybewrittentoworkwithaparticular
physicalDMAchannelonly.Theframeworkmusthavethefreedomtoassignanyavailablechannel,and
possiblyshareDMAchannels,whengrantinganalgorithmaDMAresource.
WhileRule6preventseXpressDSP-compliantalgorithmsfromdirectlyaccessingorcontrollingthe
hardwareperipherals,theycanaccessDMAhardwarevia"logical"DMAchannelstheyrequestand
receivefromtheclientapplicationusingthestandardIDMAinterfaces.AlgorithmssubmitDMAtransfer
requeststoalogicalchannelusingtheACPY2APIfunctionsprovidedbytheclientapplicationwhenusing
IDMA2interfacesandcustomDMAaccessprotocolwhenusingIDMA3interfaces.
IDMA2.AllalgorithmsthatusetheC64xandC5000DMAresourcesmustimplementtheIDMA2
interface.Thisinterfaceallowsthealgorithmtorequestandreceive"logical"DMAresources.Itis
similartotheIALGinterface,whichisusedtorequestandgrantmemoryneededbyanalgorithm.
IDMA3.AllalgorithmsthatusetheC64x+EDMAresourcesmustimplementtheIDMA3interface.This
interfaceallowsthealgorithmtorequestandreceive“logical”DMAresources.ItissimilartotheIDMA2
interfaceintermsofitsdefinitionandrole,butexposessomephysicalEDMA3resources:Parameter
RAMSets(PaRAMs),TransferCompletionCodes(TCCs),andQDMAChannelids.
ACPY2.Thesefunctionsareimplementedaspartoftheclientapplicationandcalledbythealgorithm
(andpossiblytheclientapplication).AclientapplicationmustimplementtheACPY2interface(or
integrateaprovidedACPY2interface)inordertousealgorithmsthatusetheDMAresource.The
ACPY2interfacedescribesthecomprehensivelistofDMAoperationsanalgorithmcanperform
62UseoftheDMAResourceSPRU352GJune2005RevisedFebruary2007
SubmitDocumentationFeedback