Interface Synthesis for Embedded Applications in a Co Design Environment

Please download to get full document.

View again

of 6
15 views
PDF
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Document Description
Interface Synthesis for Embedded Applications in a Co Design Environment
Document Share
Document Tags
Document Transcript
  InterfaceSynthesisforEmbeddedApplications inaCoDesignEnvironment  AnupamBasu   R.S.MitraP.MarwedelDept.ofComputerSc.&Engg.InformatikXIII.I.T.KharagpurUniversityofDortmund IndiaGermany  Abstract Inembeddedsystems,programmableperipheralsareoftencoupledwiththemainprogrammableprocessortoachievethedesiredfunctionality.Interfacingsuchperipheralswiththeprocessor qualiesasanimportanttaskofhardwaresoft-warecodesign.Inthispaper,threeimportantas-pectsofsuchinterfacing,namely,theallocation ofaddressestothedevices,allocationofdevicedrivers,andapproachestohandleeventsand transitionshavebeendiscussed.Theproposed approacheshavebeenincorporatedinacodesign systemMICKEY.Thepaperincludesanumber ofexamples,takenfromresultssynthesizedby MICKEY,toillustratetheideas. 1Introduction  Thesoftwareinanembeddedsystemmaybelooselysaidtoconsistoftwoparts:theapplic-ationsoftwareandthesystemsoftware,wheretheformerachievesthefunctionalitiesdelegated tosoftwarebyhardware-softwarepartitioning,andthelatterprovidestheinterfacebetweentheformerandthehardwarecounterpartoftheover-allsystem.Thus,theobjectiveofthesystem softwareistoaimplementthedesiredreact-ivebehavior,byinitiatingstatechangesinre-sponsetoincomingevents,andbdrivetheac-cessoryhardwaredevicesofthesystem,inorderthattheyperformthefunctionalitiesdelegatedto them.Inthispaper,weproposetechniquesfordevelopingevent-handlersanddevice-driversforembeddedsystems.Frameworksforautomateddesignofmicro-controllerbasedsystemshavebeenproposedin   PresentlyattheUniversityofDortmundonHum-boldtFellowship 1,2,3,4.Thethrustofrecentresearchin hardwaresoftwareinterfacinghasbeenintheeldofsynthesizinginterfacesfordevices.An earlyworkonthedevelopmentofinterfacesforavailabledevices5describedtechniquesforim-plementingtheinterfacebyhardwareelementsalone.Alaterwork6extendedthistechniquetoincludesoftwareimplementationsoftheinter-faceaswell,throughamanualpartitioningoftheinterfacefunctionalitiesintohardwareandsoft-wareimplementablepartitions.Thisissuehasalsobeenaddressedin7.Inembeddedsystems,eventsareeitherpolled bysoftwareortreatedas interrupts tothenor-malprocessingofthemicrocontroller.Inthelat-tercase,theinterruptservicecodeISCgen-eratesthenecessaryresponsetotheincoming event.Inmanycases,theinterruptmethodisthepreferredwayofhandlingevents,sincethemi-crocontrolleristhenfreetoperformothertasks.Hence,thedevelopmentoftheISCsisakeyis-sueinthedevelopmentofmicrocontrollerbased systems.However,toourknowledge,nosystem-aticmethodologyhasyetbeenproposedfortheautomateddevelopmentofISCs.TheworkpresentedinthispaperisapartofthesystemMICKEY-asystemforhardwaresoft-warecodesignofmicroprocessorbasedsystems8.InMICKEY,weaccepttheuserspecica-tionintheformofstatechartsandrenethem,usingrules,toarriveatacontrolanddataow graphCDFG.TheleaflevelelementsoftheCDFG,thusobtaineddesignate primitivefunc-tions pf  s ,forwhicheitherhardwareorsoft-wareimplementationsareknowntoexistinthedesignlibrary.TheCDFGisthensubjectedto hardwaresoftwarepartitioning,whichallocatesimplementationseitherhardwareorsoftware,totheprimitivefunctions.Ascheduleoftheop-  erationsisalsoobtainedinthecourseofparti-tioning.Thepartitioningisachievedusingcon-straintsatisfactiontechniques,sothattheover-allcostofthesystemisminimizedandthetimeconstraintsaremet.Thispaperconcentrateson theinterfacedesigntask,thatfollowshardwaresoftwarepartitioning.ThistasksynthesizestheinterfacebetweentheCDFGandtheallocated implementations,andthusaddressesanotherim-portantaspectofhardwaresoftwarecodesign.Since,duringthehardwaresoftwarepartition-ingphase,someofthefunctionalitiesmayhavebeenmappedtoprogrammabledevices,andsometasksmayhavebeenassignedtobeexecutedby theprocessorinanasynchronousmodeinterruptdriven,theaspectsconsideredinthispaperforinterfacesynthesisareiAllocationofnoncon-ictingaddressestothedevicesplacedonthesys-tembus;iiRenementoftheCDFG,toaccom-modateevent-basedandconditionaltransitions;andiiiRenementoftheCDFG,toaccommod-atedevicedrivers.Weassumeuniprocessorenvironmentanddo notallowanysoftwareconcurrencyforthepur-poseofthispaper. 2AddressAllocation  Theselectedmicroprocessordenestheavailableaddressspaceandalsoimposesrestrictionson howthedeviceshavetobemappedtoit.Forexample,forIntel8085,ROMaddressesshould startfrom0,whereasforMotorola6800,thestartaddressofROMisnotspeciedinstead,theROMisconstrainedtoendataddressFFFF  16 .Theaddressallocationsubtaskassignsnoncon-ictingaddressestothedevicesthataretobeplacedonthesystembus,suchthatthesead-dressspaceconstraintsaresatised.Thealgorithmforaddressallocationisshown below.Thealgorithmrstdeterminesthememoryaddressspacepartitioning.Forsomedevices,liketheIntel8155,whichrequireboth memoryaddressspaceandIOaddressspace,allocationofthememoryaddressspacewillim-poseaconstraintontheIOaddressallocation.Insuchcases,IOspaceisalsoallocatedforthatdevice,immediatelyaftermemoryaddressalloca-tion.Then,thepartitioningalgorithmisapplied totheIOspacekeepinginmindthealreadyal-locatedaddressrangessothatnoaddressspaceconictoccurs. allocateaddress f  1.Partitionmemoryspace2.Allocatememoryblockstoconstraineddevices3.Allocatememoryblockstoremaining memory-spacedevices4.PartitionIOspace5.AllocateIOblockstoremaining IO-spacedevices g  partitionaddressspace  f  s =totaladdressspace n  =numberofdevices for i =1 to  n  do  f  blox  i =1; size i =addressspaceofdevice i g  while   n    s   totaladdressspace do  f  foralldevices i having  s= 2 size i   s do  f  n  =  n  +  blox  i ; blox  i =  blox  i   2; size i =  size i   2; g  if s ==1terminatewithfailure s =  s   2 g  *Eachdevice i cannowbeallocatedanaddressspaceofsize blox  i   s .* g  Example1  Asanexample,considerthead-dressallocationfora8085-basedsystemhav-ingthefollowinghardwaredeviceswhichneed amemoryorIOaddressspace.TheresultsaregiveninTable1.AllIOdevicesareconnected inIOmappedIOmode.1.AROMchip-27162.AnADCchip-AD574 3.Atimerchip-82534.AgeneralpurposeIOchip-8155 2  Fortheperipheraldevicesthatwehaveen-counteredsofar,wehavefoundthatbacktracking canbeavoidedintheaddressallocationsteps,by consideringthemostconstraineddevicesrst.In general,however,thismaynotbethecase,and backtrackingmayresultin6whenawiderrangeofdevicesareconsidered.  MemorySpaceDeviceReqd.SpaceAlloc.Space2716800 16 0000 16 -7FFF  16 8155100 16 8000 16 -FFFF  16 IOSpaceDeviceReqd.SpaceAlloc.Space82534  16 0 16 -3F  16 AD5741 16 40 16 -7F  16 81558 16 80 16 -FF  16 Table1:Addressesallocatedforanexampleproblem  3HandlingTransitions  ThissubtaskrenestheCDFG,bytransform-ingtheeventbasedtransitionsandconditionaltransitionsintotheirdetailedimplementations.Eventbasedtransitionsarecharacteristicofre-activesystems,andthusthissubtaskformsacoreofthesynthesisofsoftwareformicroprocessorbasedsystems.Onewayofimplementingreactivesystemsistohaveasingle forever-loop  inthe main  processandonesubsidiaryprocessforeach  event ,and implementtheowofcontrolby  call-and-return  .Inthisimplementation,aseventsisay  e1  and  e2  keepowingin,thesystemalternatesbetween theISRfor e1  andtheISRfor e2  ,andthe main  processbecomesadummyaftertherstoccur-renceof e1  .Sincethealterationisimplemented asa  call-and-return  ,thesystemwillultimately malfunctionduetostackoverow.MICKEYal-leviatesthisproblembyadoptingthemethodde-pictedinFig1a.Herethereturnaddressesarepoppedoutofthestack,preventingtheoverow.TheduplicatecodesofactivityAcanberemoved bymakinga  jump  from  ISR-e2  tothe main  pro-cessseeFig1bHowever,forconcurrentprocessesadierentstrategyisusedinMICKEY.Considertwopro-cessesA,BandC,Doperatingconcurrently Fig2a.Sinceweareconsideringunipro-cessortargetsystemsandnocoroutines,A,B,C,andDcannotallbesimultaneouslyimple-mentedbysoftware.LetusassumethatCand Dareimplementedbyhardwarewhicharestar-tedandstoppedappropriatelybythemicropro-cessor.Hence,themodiedprocessisasshown  POP POPPOP POPA B AMain ISR-e1 ISR-e2(a)ISR-e1A BMain ISR-e2(b) Figure1:Implementing  event-transitions by  jumps inFig2b.Here,theatomicactionsforstarting andstoppingthehardwaredeviceshavebeenat-tachedalongwiththerespectivetransitionarcs,andthemodules wait::1  and  wait::2  areinstancesofthe pf  s wait-for-event .Forexample, wait::1  iswaitingforanexternalevent e3  .Onthisevent,atransitionto  wait::2  willbemade,afterstop-pingCandinitiatingD.Themethodadoptedin MICKEYforimplementingsuchconcurrentpro-cessesistoimplementeach  wait ofthehardwareimplementableprocessasa  Return  ,thusreturn-ingcontroltotheotherprocess.TheISRsfortheeventsofthesehardwareimplementablepro-cessesdonotpopthestack,andsincethereisa corresponding  return  attheend,stacksizedoesnotgrowindenitely.Hence,theimplementation isasshowninFig3.Ifboththeprocessesareallocatedhardwareimplementations,possiblyinordertosatisfytim-ingconstraints,asshowninFig4a,thenthismethodwouldderivetheimplementationshown inFig4b.Here,the wait ofthe Main  CDFGisnotimplementedasa  Return  ,butasanexplicit wait-for-event .Theapproachofusingdierentschemesforsoftwareandhardwareimplementableprocessesaswellasforsequentialandconcurrentpro-cessesresultsinrelativelysimplerCDFGs.ThesestrategieshavebeenimplementedinMICKEYastransformationrules.  ABWait:1Wait:2 Init CInit De3/Stop Ce4/ Stop DInit C ABCD (a)(b) Figure2:Concurrentprocesseswith  event-transitions Intheabovediscussion,wehaveconsidered transitionswhichareredontheoccurrenceofan event.Guardconditionscanalsobeassociated withthetransitions.Moreover,someeventsmay havetobedisabledorenableddependingonthecurrentstate.Ifaneventcausesseveraltrans-itions,theyhavetobetakencareof.Conditionsmayalsobeassociatedwithtransitionswithoutanyassociatedevent.Insuchcasesthecondition hastobemadeexplicitontheCDFGduringre-nement.TherenementrulesinMICKEYex-plicitlyhandleallthesedierentsituations. 4RenementforDevice Drivers  Asoftwaremayneedtointeractwithhardwaredevicesfordeviceinitialization,readingwriting valuesfromtoadevice,andstoppingadevice.Ingeneralahardwaredevicemayrequirease-quenceofinstructionsforinitialization,datain-put,dataoutput,andhalting.ForsimpledevicesliketheADCchip7574,onlyan  IN  instruction isrequiredattheallocatedaddresstoreadtherelevantdatafromthedevice.Howeverforpro-grammabledevices,suchastheIntel8259In-terruptController,asequenceofinstructionsisrequiredtoinitializethedevicetotherequired  ISR-e1POPBISR-e3Stop CInit DRetISR-e4Stop DInit CRetMAINInit CAISR-e2POP Figure3:Implementationof event-transitions in concurrentprocessesby  call-and-return  modeofoperation.Further,forimplementa-tionsthatrequireadditionaldatatransforma-tions,suchasforimplementinga  Counter  bya timeroftheIntel8155chip,thesecomputationshavetobeperformedafterthedataisaccessed fromthedevice.Fig5ashowstheCDFGrenementfordriv-inghardwaredevicesthatexecutetillarequestfortermination.Here,thehardwareimplement-ablestateYisreplacedbyactionsforstarting andstoppingthedevice,anda  wait state.Such renementsareneededforfunctionssuchasa squarewavegenerator,oracounter.Therene-mentforfunctionsthatterminateontheirown,suchasatimer,requireadierentrenementisshowninFig5b,wherethehardwaredeviceis-suesaneventindicatingitstermination,andthiseventisusedtomakethenecessarytransition.Thefurtherrenementofthedevice'scom-mandsi.e.startandstopisdependenton thespecicimplementationthathasbeenselec-ted.TheseimplementationspecicrenementsalsomodifythedataowsoftheCDFG.Anex-ampleisshownbelowfortheimplementationofa  Counter  bytheIntel8253. Example2  Considertheimplementationofan up-counterbyanIntel8253,inMode0.ThecounterseeFig6aisinitiatedbya  pf  ,sayX,ontheevent e1  .Ontheevent e2  ,thecounter  (b)ISR-e3ISR-e4Stop CInit DRetStop DInit CRetMainISR-e2ISR-e1Init AInit CWaitStop BInit AStop AInit BRetRet Init AWait:1Wait:2Wait:3Wait:4Init CInit Ae2/Stop Be1/Stop AInit BInit De3 /Stop Ce4/Stop DInit C(a) Figure4:Specialcase:Allconcurrentprocessesimplementedbyhardwareisstoppedandcontrolpassestoanother pf  ,say Y.Thecounterscansapulsestreamgenerated bya  pf  ,sayA.Afterthecounterisstopped,thecountdatai.e.thenumberofpulsesinthepulsestream,inthedurationwhenthecounterwasactiveispassedtoa  pf  ,sayB.TheresultofapplyingtherenementstepofFig5aontheCDFGofFig6a,isshowninFig 6b.Thenextrenement,showninFigFig6c,isforexpandingthe start and  stop  actionsandformodifyingthedataows.The start actionofthe Counter  involvesprogrammingthe8253inMode0,andsendinginitialdatatoit.Thelatterisrequiredinordertoimplementtheup-counterby the8253'sdown-counter.The stop  actionsendsa  Latch  commandtothe8253,readsthedown- XZXZev(Y-end)Y(hw)Start Y(b)XZeY (hw)XWaitZeStop YStart Y(a) Figure5:Renementsforhardwareimplementa-tionscountdata,andstoresthedataafterinterpreting itappropriatelytoformthecorrespondingup-countdata.TheinputdataowissimplyaconnectionoftheoutputofAtothe8253'sCLKinput.Theoutputdataowisbroken,andBnowtakesin-putfromthememorylocationthatstoresthecountdata. 2  5Conclusion  Inthispaper,wehavepresentedmethodologiesforaddressingthreeimportantaspectsofinter-facesynthesisduringhardwaresoftwarecosyn-thesisofembeddedsystems.Theyareallocation ofnonconictingaddressestothedevices,interfa cedwiththemicroprocessorsystem,accommod-atingeventbasedandconditionaltransitionsby renementoftheControlandDataFlowGraph 
Search Related
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks