Texas Instruments TMS320 DSP Computer Hardware User Manual


 
www.ti.com
DMA/CPU idle
CPU context switch
CPU/DMA active
Algorithm A
active
Algorithm B
active active
Algorithm A
CPU context
(timeline)
DMA context
(timeline)
1 2 3 4 5 6
Inter-AlgorithmSynchronization
algorithm.
Events
1.AlgorithmArequestsadatatransferbycallingACPY2_start().Theframeworkexecutesthis
requestimmediatelysincetheDMAchannelisfree.
2.TheframeworkpreemptsAlgorithmAtorunalgorithmB.AlgorithmA'sdatatransferisabortedto
freetheDMAchanneltoAlgorithmB.
3.AlgorithmBrequestsadatatransferbycallingACPY2_start().Theframeworkexecutesthis
requestimmediatelysincetheDMAchannelisfree.
4.AlgorithmBcallsACPY2_complete()tocheckifthedatatransferhascompleted.Theframework
checkstoseethatthedatahasbeentransferred.AlgorithmBcanprocessthetransferreddata.
5.TheframeworkreturnscontroltoAlgorithmAandalsorestartsthedatatransferthatwasabortedin
Event#2.
6.AlgorithmAcallsACPY2_wait()towaitforthedatatransfertocomplete.Theframeworkchecksto
seethatdataisstillbeingtransferred.
7.ThedatatransferiscompleteandtheframeworkreturnscontroltoAlgorithmAsoitcanprocess
thetransferreddata.
Scenario1canresultinalgorithmAwaitingfortheDMAtransfertocompletelongerthannecessary
becauseoftheabort/restartpolicy.However,inthisscenarioitismoreimportanttogranttheDMA
channeltothehigherpriorityalgorithm.
Scenario2:ThesystempolicyistoletthecurrentDMAtransferissuedbythelowerpriorityalgorithm
finishbeforestartingaDMAtransferissuedbythehigherpriorityalgorithm.SeeSection6.15.5.
Events
1.AlgorithmArequestsadatatransferbycallingACPY2_start().Theframeworkexecutesthis
requestimmediatelysincetheDMAchannelisfree.
2.AlgorithmBrequestsadatatransferbycallingACPY2_start().Notethattheframeworkhas
preemptedAlgorithmAtorunalgorithmB.AlgorithmA'sdatatransferisstillinprogress,so
algorithmB'stransferwillbedelayed.
3.AlgorithmA'sdatatransferhascompletedandAlgorithmB'sdatatransferredrequestcanbe
executed.
4.AlgorithmBcallsACPY2_complete()tocheckifthedatatransferhascompleted.Theframework
checkstoseethatdataisstillbeingtransferred.
5.AlgorithmBcallsACPY2_complete()tocheckifthedatatransferhascompleted.Theframework
checkstoseethatdatatransferhascompleted.AlgorithmBcanprocessthetransferreddata.
6.AlgorithmAcallsACPY2_wait()towaitforthedatatransfertocomplete.Theframeworkchecksto
seethatdatatransferhascompleted.TheframeworkreturnscontroltoAlgorithmAsoitcan
processthetransferreddata.
Scenario2canresultinadelayofthedatatransferforalgorithmBsincethetransferforalgorithmA
mightstillbeactive.
SPRU352GJune2005RevisedFebruary2007UseoftheDMAResource73
SubmitDocumentationFeedback