Testing and Debugging DSP Systems.docx
《Testing and Debugging DSP Systems.docx》由会员分享,可在线阅读,更多相关《Testing and Debugging DSP Systems.docx(27页珍藏版)》请在冰豆网上搜索。
TestingandDebuggingDSPSystems
TestingandDebuggingDSPSystems,Part1
RobOshana,TexasInstruments
2/22/20073:
00AMEST
Parttwo explainstheworkingsoftheJTAG(IEEE1149.1)boundary-scantechnology.
Insoftwaredevelopment,perhapsthemostcritical,yetleastpredictablestageintheprocessisdebugging.Manyfactorscomeintoplaywhendebuggingsoftwareapplications.Amongthesefactors,timeisoftheutmostimportance.Thetimerequiredtosetupanddebuga software applicationcanhavesignificantimpactsontime-to-market,meetingcustomerexpectations,andthefinancialimpactofawelldevelopedproductthatsucceedsinthemarket.Theintegrationofanapplicationfollowsamodelofmultiplespiralsthroughthestagesofbuild,load,debug/tune,andchange,asshowninFigure1.
Figure1Theintegrationanddebugcycle.Thegoalistominimizethenumberoftimesaroundthisloopaswellasminimizingthetimespentineachsegment.
Debuggingembeddedreal-timesystemsispartartandpartscience.Thetoolsandtechniquesusedindebuggingandintegratingthesesystemshaveasignificantimpactontheamountoftimespentinthedebug,integration,andtestphase.Themorevisibilitywegainintotherunningsystem,thefasterweareabletodetectandfixbugs.
Oneofthemoretraditionalandsimplestwaysofgainingvisibilityintothesystemistoaddmessagesatcertainpointsinthesoftwaretooutputinformationaboutthestateofthesystem.Thesemessagescanbeintheformof"printf"statementsoutputtoa monitor ortheblinkingofaLEDorsetofLEDstoindicatesystemstatusandhealth.Each function ortaskcanbeginbyoutputtingastatusmessagetoindicatethatthesystemhasmadeittoacertainpointintheprogram.Ifthesystemfailsatsomepoint,diagnosisofthe outputmessagescanhelptheengineerisolatetheproblembyknowingwherethesystemwaslast"good."Ofcourse,instrumentingthesysteminthiswayintroducesoverhead,whichchangesthebehaviorofthesystem.Theengineermusteitherremovetheinstrumentationafterthesystemhasbeentestedandre-validatethesystembeforeshipping,orshipthesystemwiththeinstrumentedcodeinthesystem.Theengineermustusuallyshipwhatisbeingtested(includingthisinstrumentation)andtestwhatisgoingtobeshipped.
Engineerscanusemoresophisticateddebugapproachestoreducethetimespentintheintegrationandtestphase.Oneapproachistheuseofadevicecalleda"debugmonitor."AdebugmonitorisarelativelysmallpieceofcodeembeddedinthetargetapplicationorintegratedintothemicrocontrollerorDSPcorethatcommunicatesovera serial interface toahostcomputer[1].Thesemonitorsprovidetheabilitytodownloadcode,readandwriteDSPmemoryandregisters,setsimpleandcomplex breakpoints, singlestep theprogram,andprofile sourcecodeatsomelevel.
ForsystemswithROMbasedsoftwareprograms,anotherformofdebugmonitor,calledaROMemulator,isused.AROMemulatorisaplug-inreplacementforthetargetsystemROMdevices.Theplug-indeviceconnectstothehostcomputeroveralink(serial,parallel,Ethernet,andsoon).AROMemulatorprovidestheengineerwithfasterturnaroundtimeduringthedebuggingprocess.Insteadofre-programmingtheROMdeviceusingaROMprogrammerforeachsoftwareiteration,thecodecaninsteadbedownloadedintofastRAMontheROMemulator.ThesystemisthenrunasifcodewasrunningoutoftheROMdevice.
DebugmonitorsandROMmonitorscertainlyprovidealargebenefittotheembeddedsystem debugphase.But,asembeddedprocessorsbecomefasterandfaster,andassystemsmigratetosystemonachipsolutions,visibilityintotheinternalprocessorpresentschallengesthatrequireevenmoresophisticateddebugsolutions.
Integratinganddebuggingcomplexdigitalsystemsalsorequirestheuseofsophisticatedandcomplexdebugtoolssuchas logicanalyzers.Alogicanalyzerisatoolthatallowsthesystemintegratortocaptureanddisplaydigitalsignalsinvariousformatssuchasbit,byte,andwordformats.Usingalogicanalyzer,thesystemintegratorcananalyzedigitalbehaviorsuchas:
∙Digitalcounters
∙Complexstatemachines
∙BuffersandFIFOs
∙Systembuses
∙Othersystemonachip(SoC)functionssuchasFPGA,ASICandstandardcellimplementations
Logicanalyzersarepowerfultoolsthatarealsoportableandveryversatile.Thesetoolsrequireasmalllearningcurveaswellashighinitialinvestment(dependingonhowmuchcapabilityisneededbythetoolandwhatclockratesneedtobesupported).Byusingtriggeringmechanismsinthetool,thesystemintegratorcancapturedataintolargebufferswithinthelogicanalyzer.Thisdatacanbepre-triggerdata,post-triggerdata,oracombination.Tracescanbesavedandprintedandthedatacanbefilteredinanumberofdifferentways.
AfundamentaldisadvantagetousingalogicanalyzerforembeddedDSPsoftwaredebugisthattheyarecomplexhardwaredebugtoolsbeingusedforsoftwaredebug.Thedegreeofsuccessusingalogicanalyzerisrelatedtohowhardwaresavvythesystemintegratorissincethetoolishardware-debugbasedandmayrequirecomplexsetupandconfigurationtogettherightinformationtoanalyze.
Anotherdisadvantagetousingalogicanalyzerforsystemdebugisvisibilityofthesignals.AlogicanalyzerneedstobeconnectedtothepinsoftheDSPdeviceinordertogetvisibilityintothesystem.ThevisibilityislimitedbythetypesofpinsontheDSP.AsDSPdevicesbecomemoreintegratedintosystemonachipcapability,thevisibilitytoseewhatisgoingoninsidethedevicediminishes.
Footnote
1.ArnoldBergerprovidesaveryintuitiveoverviewofdebuggersin EmbeddedSystemsDesign,Chapter6,CMPBooks,copyright2002.
TestingandDebuggingDSPSystems,Part1
RobOshana,TexasInstruments
2/22/20073:
00AMEST
DebugChallengesforDSP
Vanishingvisibility
In1988,theembeddedsystemindustrywentthroughachangefromconventional InCircuitEmulation[2]toscanbasedemulation.Thiswasmotivatedbydesigncycletimepressuresandnewlyavailablespaceontheembeddeddeviceforon-chipemulation.Scan-based,or JTAG,emulationisnowwidelypreferredovertheolderandmoreexpensive"in-circuitemulation,"or"ICE"technology.
DebugChallengesforDSP
ThehavebeenanumberofindustryforcesthathavebeenchangingtheDSPsystemdevelopmentlandscape:
Systemlevelintegration;Asapplicationcomplexityhasincreasedandsystemonachipcomplexityhasledtosmallerfootprints,thevisibilityintothesystemcomponentshasdiminished(Figure2).Embeddedsystembusesleadtoaninstrumentationchallenge.Widersystembusesalsoleadtosystem bandwidthissues.Programcontrolintheseenvironmentsisdifficult.
Figure2Systemlevelintegrationleadstodiminishingvisibility(courtesyofTexasInstruments)
Inordertorestorevisibility,DSPvendorshaveaddressedtheissueonseveralfronts:
On-chipinstrumentation –Assystemsbecomemoreintegrated,on-chipvisibilityintothedeviceoperationisbecomingblocked(Figure3). Bus snoopinglogicanalyzerfunctionshavebeenimplementedinon-chiplogic.Examplesofthisincludetriggeringlogictofindtheeventsofinterest,tracecollectionandexportlogictoallowingtheviewingofevents,andmaximizingexportbandwidthperavailablepinontheDSPcore.Debugcontrolisthroughanemulatorwhichextractstheinformationofinterest.
Figure3Vanishingvisibilityrequiresadvanceddebuglogicon-chip(courtesyofTexasInstruments)
Offchipcollectionfoundation –OncethedataisexportedfromtheDSPcore,thedatamustbestored,processed,filtered,andformattedinsuchawayastobeusefultothosetestengineerstointerpretthedatameaningfully.
Datavisualizationcapability –DSPintegrationcapabilitiesincludetheabilitytoeasilyviewthedataindifferentconfigurations.TheentirechainisshowninFigure4.Thelogicanalyzerfunctionsarenowon-chip,thecontrolandinstrumentationcollectionisprimarilythroughtheemulationcontroller,andthedataisdisplayedonthehostinavisualizationcontainer.Thekeychallenge,then,istoproperlyconfigurethesystemtocollecttherightdataattherighttimetocatchtherightproblem.
(Clicktoenlarge)
Figure4DSPtoolsareusedtovisualizedebugdataextractedfromtheDSP(courtesyofTexasInstruments)
Applicationspacediversity –DSPapplicationsarebecomingmorediverseandthispresentschallengestoDSPtestandintegrationengineers.Thisdiverseapplicationspacespectrumrequiresdifferentcostmodelsfordebugsupport:
∙DSPbasestationapplicationsrequirehighbandwidth,highfrequencydebugcapabilities.
∙Voiceover IP applicationsrequireMIPSdensityandmanyhomogeneousprocessorsperboard.
∙Cellphoneandother wireless applicationsrequireheterogeneousmultiprocessorsandveryhighsystemlevelintegration.
∙AutomotiveDSPapplicationsrequirelowcostdebugsolutionswhereDSPchippinsareatapremium.
Userdevelopmentenvironment;thedevelopmentenvironmentforDSPdevelopersischangingandDSPdebugtechnologiesarechangingtoaccommodatethesenewenvironments.DSPengineersaretransitioningdebugplatformsfromdesktopPCsystemstolaptopsthatareportabletothefieldfordebuginthecustomer'senvironment.PortableremoteapplicationsrequireportableDSPdebugenvironments.
Continuedclockrateincreases;asDSPcoreclockspeedsincreasemoredataisrequiredtoperformdebugging.Infact,theamountofdatarequiredtoperformdebugandtuningisdirectlyproportionaltotheDSPcore clock speed.MoreDSPpinsandmoredataperpinarerequiredtomaintaintherequiredvisibilityi