基于实时系统的时间追踪验证
VIP免费
Master’sthesisinControlEngineering
Trace‐basedTimingVerificationofReal‐
TimeSystems
Tangxuhua
FacultyforOptical‐ElectricalandComputerEngineering
UniversityofShanghaiforScienceandTechnology
incooperationwith
Timing‐ArchitectsEmbeddedSystemsGmbH
1st
assessor
Wanhongpin
2nd
assessor
Wangzhengxiang
Advisors
Dr.MichaelDeubzer
AndreasSailer
Matriculationnumber
127680544
Date
March9,2015
I
Abstract
ThethesisservestopushtheprocessoftheprojectZeloS³:Creatingthemodelwhichcan
reflectthetiming‐behaviorofaspecificrealtimeoperatingsystem(RTOS)withTAToolSuite,
usingOn‐chipanalyzertotraceitsrunningprocessandreconstructitwithTAToolSuite,and
finallyusingthecustomizedJavaapplicationtodothecomparisonabouttherunning
behaviorbetweenthem,andfindingoutthereasonthatcausesthedifferences.
Thethesisbeginswiththeintroductionofbasicknowledgeaboutdebuggingtechnologiesin
themarket,andthendoingthecomparisonamongdifferentkindsofdebugging
technologies.Thesecondchapterisabouttheintroductionofthesoftwareandhardware
platformthatareusedinthethesis.Aftercoveringthefoundationalelements,thecoming
chapterisaboutthecontextswitchingresearching.Thefourthchapterisaboutthetasksin
projectZeloS³,themodelingpartandcomparisonpartwillbeintroducedindetailsinthis
chapter.
Thethesiscloseswithasynopsisofboththeexperiencesandproblemsencounteredduring
therealizationprocessandanoutlooktothefuture.
Keywords:RealTimeOperatingSystem,DebuggingTechnology,HardwareTracing,Java
II
Acknowledgments
Bestregardstoallthepeoplewhosupportandhelpmeduringthissixmonths.
Firstandforemost,Iwouldliketogratefullythankmyadvisor,Dr.MichaelDeubzer.Itisyou
thatgivemeachancetofeeltheawesomeandbeautyofGermany.
Furthermore,I’dliketothankmysupervisorAndreassailer,whoisknowledgeableand
patient,givesmehelpsanytimeIneed,givesmedirectionsanytimeIgetlost.
Thankstoallmycolleagues,FelixMartin,MaximilianHempe,andsoon,whogivemehelps
andadvisesintheirbusytime.
Heartfeltthankstomyfamily,youarethereasonwhyIamheretopursuemydream.
Finally,IexpressmydeepappreciationtomygirlfriendAminWangforherencouragement
andlove.TheromantictimeinSwitzerlandwillbeourmutualbeautifulmemoryinourlife.
Tangxuhua
Regensburg,Germany
October2014
III
Contents
1BackgroundKnowledge.......................................................................................................................1
1.1TheIntroductionofEmbeddedSystem........................................................................................1
1.2TheIntroductionofRealTimeOperatingSystem........................................................................1
1.2.1TheMainCharacteristicsofRTOSes......................................................................................2
1.2.2IntroductionofSeveralPopularRTOSProductsOnTheMarket........................................2
1.3TheIntroductionoftheMulti‐CoreSystems...............................................................................3
1.4DebuggingTechnology.................................................................................................................3
1.4.1TheSoftwareDevelopmentEnvironmentinEmbeddedSystem........................................3
1.4.2IntegratedDevelopmentEnvironmentinEmbeddedSoftware.........................................3
1.4.3CommunicationPortsforCrossDebugging.........................................................................4
1.5TheCategroriesofDebuggingStrategies...................................................................................5
1.5.1Software‐basedDebugging...................................................................................................5
1.5.2Hardware‐basedDebugging..................................................................................................7
1.5.3TheComparisonoftheDebuggingTechnologies...............................................................10
2IntroductionoftheSoftwareandHardwarePlatform....................................................................12
2.1IntroductionoftheSoftwarePlatform.......................................................................................12
2.1.1IntroductionofTAToolSuite................................................................................................12
2.1.2IntroductionofOSEK............................................................................................................12
2.1.3IntroductionofErikaOS.......................................................................................................13
2.2IntroductionoftheHardwarePlatform.....................................................................................15
2.2.1IntroductionofExperimentalBoard....................................................................................15
2.2.2IntroductionoftheOn‐chipAnalyzer..................................................................................16
2.3TheComparisonofOn‐chipAnalyzers.......................................................................................19
3DataTracingResearch........................................................................................................................22
3.1DataTracingConfigurationinOS................................................................................................22
3.2IntroductionoftheContextSwitchinginRTOS........................................................................23
3.2.1TheDefinitionofContextSwitching...................................................................................24
3.3DataHandlinginTAInspector....................................................................................................27
3.4SingleTask..................................................................................................................................30
3.4.1RelatedKnowledgeinErikaOS...........................................................................................30
3.4.2CaseStudy.............................................................................................................................31
3.4.3TheComparisonandConclusion........................................................................................33
3.5MultitaskinginNonPre‐emptiveKernel...................................................................................34
3.5.1DataHandling.......................................................................................................................34
3.5.2CaseStudy.............................................................................................................................37
3.5.3TheComparisonandConclusion........................................................................................43
3.6InterruptHandling......................................................................................................................43
3.6.1RelatedKnowledgeinErikaOS...........................................................................................43
3.6.2CaseStudy............................................................................................................................44
3.6.3TheComparisonandConclusion........................................................................................48
3.7TasksinMulti‐coreCondition.....................................................................................................49
3.7.1TaskSchedulingPrincipleinErikaOS..................................................................................49
3.7.2CaseStudy............................................................................................................................49
4ZeloS³Cycle.........................................................................................................................................51
IV
4.1IntroductionofZeloS³andItsObjectives...................................................................................51
4.2TheMainProcessofZeloS³.........................................................................................................51
4.3MyRoleinThisProject................................................................................................................52
4.3.1ModelDesigning...................................................................................................................52
4.3.2JavaProgramming...............................................................................................................56
5Outlook..............................................................................................................................................69
6Conclusion.........................................................................................................................................70
7Appendix.............................................................................................................................................72
1
1BACKGROUNDKNOWLEDGE
Thedebuggingprocessforembeddedsystemsisanimperativestepinasystemdesigning.
Thevastarrayofembeddedsystems,andtheeverincreasingcomplexityofthesystems
structuremakedebuggingagrowingchallenge.Differentdomainsimposedifferent
requirementsonthesystemsandasembeddedsystemspervadeoursociety,
newrequirementsareintroduced.
1.1THEINTRODUCTIONOFEMBEDDEDSYSTEM
Embeddedsystems,refertothededicatedapplication‐orientedcomputersystems,whose
hardwareandsoftwarepartscanbetailoredfortheconsiderationoffunctionality,reliability,
cost,powerconsumption,etc.
Itgenerallyconsistsoffourparts:anembeddedmicroprocessor,peripheralhardware
devices,embeddedoperatingsystemsandapplicationsusedinembeddedoperating
systemstoperformspecificfunctions.Withthedevelopmentofsocialeconomyand
informationtechnology,embeddedsystemshavebeenusedmorewidelyinourlives,and
playamoreandmoreimportantroleinthefieldofmilitary,academicsanddaily
lives.Prospectsfortheembeddedsystemscan’tbeunderestimated.
Comparedtogeneral‐purposecomputersystems,embeddedsystemshavethefollowing
characteristics:
Embeddedsystemsareoftenapplication‐oriented.Thebiggestdifference
betweenembeddedCPUandgeneral‐purposeembeddedCPUisthatembeddedCPUis
normallyforspecificusergroups.Ithascharacteristicssuchaslow‐powerconsumption,small
size,highintegrationandisabletointegratealotoftaskswhichshouldbefinishedby
general‐purposeCPUboardintothechip,itmakesembeddedsystemssmaller,easierfor
mobilecapability.
Anembeddedsystemistheproductofadvancedcomputertechnology,semiconductor
technology,electronictechnologyandspecificApplicationsindifferentindustries.It
determinesthatitisaninnovativeknowledgeintegratedsystems.
Embeddedsystemdoesnothavebootstrappedcapabilityfordevelopment,evenafterthe
designing,theuserusuallycan’tmodifytheprogramfunction,itonlycanbedevelopedwith
thespecificdevelopmenttoolsandenvironment.
1.2THEINTRODUCTIONOFREALTIMEOPERATINGSYSTEM
“Real‐timesystemsarecharacterizedbythesevereconsequencesthatresultiflogicalaswell
astimingcorrectnesspropertiesofthesystemarenotmet.”[2]
RealtimeoperatingsystemsbelongtoRealtimesystem.TherearetwotypesofRTOS:soft
andhard.Thepurposeofthesoftoperatingsystemistogetabalancebetweenthetask
executionspeedandmeetingthetimerequirements.AnRTOSthatcanusually
orgenerallymeetadeadlineisasoftreal‐timeOS,butifitcanmeeta
deadlinedeterministicallyitisahardreal‐timeOS.[2]
2
1.2.1THEMAINCHARACTERISTICSOFRTOSES
Reliability:Embeddedsystemsmustbereliable.DependingontheApplication,thesystem
mightneedtooperateforlongperiodswithouthumanintervention.Differentdegreesof
reliabilitymayberequired.Forexample,adigitalsolar‐poweredcalculatormightresetitselfif
itdoesnotgetenoughlight,yetthecalculatormightstillbeconsideredacceptable.Onthe
otherhand,atelecomswitchcannotresetduringoperationwithoutincurringhighassociated
costsfordowntime.TheRTOSesintheseApplicationsrequiredifferentdegreesof
reliability.Althoughdifferentdegreesofreliabilitymightbeacceptable,ingeneral,areliable
systemisonethatisavailable(continuestoprovideservice)anddoesnotfail.Acommonway
thatdeveloperscategorizehighlyreliablesystemsisbyquantifyingtheirdowntimeperyear.
Predictability:Becausemanyembeddedsystemsarealsoreal‐timesystems,meetingtime
requirementsisthekeytoensuringproperoperation.TheRTOSusedinthiscaseneedstobe
predictabletoacertaindegree.ThetermdeterministicdescribesRTOSeswithpredictable
behavior,inwhichthecompletionofoperatingsystemcallsoccurswithinknowntimeframes.
Performance:Thisrequirementdictatesthatanembeddedsystemmustperformfastenough
tofulfillitstimingrequirements.Typically,themoredeadlinestobemetandtheshorterthe
timebetweenthemmeansthefasterthesystem'sCPUmustbe.Althoughunderlying
hardwarecandictateasystem'sprocessingpower,itssoftwarecanalsocontributetosystem
performance.Typically,theprocessor'sperformanceisexpressedinmillioninstructionsper
second(MIPS).
Compactness:Applicationdesignconstraintsandcostconstraintshelpdeterminehow
compactanembeddedsystemcanbe.Forexample,acellphoneclearlymustbesmall,
portable,andlowcost.Thesedesignrequirementslimitsystemmemory,whichinturnlimits
thesizeoftheApplicationandoperatingsystem.Insuchembeddedsystems,where
hardwarerealestateislimitedduetosizeandcosts,theRTOSclearlymustbesmalland
efficient.Inthesecases,theRTOSmemoryfootprintcanbeanimportantfactor.Tomeet
totalsystemrequirements,designersmustunderstandboththestaticanddynamicmemory
consumptionoftheRTOSandtheApplicationthatwillrunonit.
Scalability:BecauseRTOSescanbeusedinawidevarietyofembeddedsystems,theymustbe
abletoscaleupordowntomeetApplication‐specificrequirements.Dependingonhowmuch
functionalityisrequired,anRTOSshouldbecapableofaddingordeletingmodular
components,includingfilesystemsandprotocolstacks.
1.2.2INTRODUCTIONOFSEVERALPOPULARRTOSPRODUCTSONTHEMARKET
“VxWorksisaRTOSdevelopedasproprietarysoftwarebyWindRiver.VxWorksisdesigned
foruseinembeddedsystemsrequiringreal‐time,deterministicperformanceand,inmany
cases,safetyandsecuritycertification,forindustries,suchasaerospaceanddefense,medical
devices,industrialequipment,robotics,energy,transportation,networkinfrastructure,
automotive,andconsumerelectronics.”[4]
MicroC/OS‐II(µC/OS‐IIoruC/OS‐II),istheacronymforMicro‐ControllerOperatingSystems
Version2.Itisapriority‐basedpre‐emptivereal‐timemultitaskingoperatingsystemkernelfor
microprocessors,writtenmainlyintheCprogramminglanguage.Itisintendedforuse
inembeddedsystems.μC/OS‐IIcanmanage64tasks,andprovidesthefunctionoftask
3
schedulingandmanagement,memorymanagement,inter‐tasksynchronizationand
communication,timemanagementandinterruptservice.Thecharacteristicsarehigh
efficiency,smallfootprint,excellentreal‐timeperformanceandscalabilityandsoon.
μClinuxwasaforkoftheLinuxkernelformicrocontrollerswithoutamemorymanagement
unit.Itwasintegratedintothemainlineofdevelopment.Theprojectcontinuestodevelop
patchesandtoolsformicrocontrollers.
ErikaOSwasusedfortheresearchandtheproject.Thus,itwillbeintroducedindetailsinthe
secondchapter.
1.3THEINTRODUCTIONOFTHEMULTI‐CORESYSTEMS
Amulti‐coreprocessorisasinglecomputingcomponentwithtwoormoreindependent
actualcentralprocessingunits(called"cores"),whicharetheunitsthatreadand
executeprograminstructions.[5]Manufacturerstypicallyintegratethecoresontoa
singleintegratedcircuitdie,orontomultiplediesinasinglechippackage.Somulti‐coreCPU
designingrequirelessprinted‐circuit‐boardspacecomparedwithmulti‐chipSMPdesigning.
Multi‐corechipsperformancewellatlowerenergy.Also,thememoryissharedbetween
differentcores.
InfineonAurixTC298TFtri‐corecontrollerwasusedasthehardwareplatformintheresearch
andtheproject,thestructurewillbeintroducedastheexampleofmulti‐coresysteminthe
secondchapter.
1.4DEBUGGINGTECHNOLOGY
Aftertherelatedintroductionbefore,wehavealreadyhadthebasicknowledgeaboutRTOS.
Nowthesoftwaredevelopmentenvironmentandtheimplementmethodofcross‐debugging
andthecharacteristicofsomehardwaredebuggertoolssuchasICE,BDM,andJTAG,which
areusuallyusedinembeddedsystem,willbeintroduced.Andthenallthemethodswillbe
comparedaccordingtotheiradvantagesanddisadvantages.
1.4.1THESOFTWAREDEVELOPMENTENVIRONMENTINEMBEDDEDSYSTEM
Embeddedsystemdevelopingenvironmentismainlycomposedoftwoparts,embedded
operatingsystemsandsoftwaredevelopmenttools.Embeddedoperatingsystemisthecore
inembeddedsoftwaredevelopmentenvironment,andisthedevelopingplatformof
embeddedApplicationsoftware.Softwaredevelopmenttoolsforembeddedsystemmainly
refertothetoolforcompiling,debugging,andsimulatingfortargethardwareplatform.The
diversityofthehardwareenvironmentdeterminesthemulti‐platformnatureofthese
toolsinevitably.Socross‐developmentmodelhasbecomethefirstchoiceforembedded
systemdevelopment.Anddebuggingplaysaveryimportantroleinembeddedsystems
developmentprocess.
1.4.2INTEGRATEDDEVELOPMENTENVIRONMENTINEMBEDDEDSOFTWARE.
Therearetworolesintheembeddedsystemdevelopmentprocess‐hostandtarget
machines:thehostmachineisthecomputerwhichisusedforcompiling,linking,addressing;
thetargetmachinereferstothehardwareplatformwhichisusedforrunningembedded
摘要:
展开>>
收起<<
Master’s thesis in Control Engineering Trace‐based Timing Verification of Real‐Time Systems Tang xuhua Faculty for Optical‐Electrical and Computer Engineering University of Shanghai for Science and Technology in cooperation with Timing‐Architects Embedded Systems GmbH 1st assessor Wan hongpi...
相关推荐
作者:侯斌
分类:高等教育资料
价格:15积分
属性:78 页
大小:2.51MB
格式:PDF
时间:2024-11-19

