当前位置:
首页> Saber-MATLAB Integrations
Saber-MATLAB Integrations
时间: 下载该word文档
>>>>>>>>Saber-MATLABIntegrations:EnablingVirtualHW/SWCo-Verification
LeeJohnson—Synopsys
June2004
>>>>©2004Synopsys,Inc.
>>>>Introduction
Theamountandcomplexityofembeddedcontentinautomotivesystemsiscontinuallyincreasing.Drivenbypressurestoincreasecontentandreducecosts,automotiveOEMsandsuppliersarerelyingmoreonembeddedsystemsforcontrol,configuration,andcalibrationofadvancedtechnologiessuchasX-by-wiresystems,in-vehiclenetworking,andelectrichybridsystems.Accordingly,moreeffortisdedicatedtodevelopmentofembeddedsystemsandverificationwiththecontrolledmechatronichardware.
Severaltoolsareavailabletodaythatstreamlinetheembeddedsoftwaredevelopmentprocess.Inparticular,model-baseddesigntechniquesarebecomingincreasinglycommon,allowingdesignerstocreateandmaintainanexecutablespecificationofembeddedsoftwarethatcanbeusedforcontrolalgorithmdevelopmentthroughautomaticcodegenerationtargetedtoaspecificmicrocontroller.
Despitetheadvancesinsoftwaredesigntools,embeddedsoftwareverificationistypicallynotemphasizeduntillateinthedesigncycle.Inmanycases,designersmustwaitforaphysicalprototypeofthemechatronicsystemtobecomeavailablebeforeconcentratingtheireffortsonsoftwarevalidation.Hardware-in-the-loop(HILsimulationeliminatestheneedforaphysicalprototypeofthemechatronicsystemduringsoftwareverification;however,HILplatformsareexpensiveandcannotbeimplementeduntilmicrocontrollerhardwareandtargetcodeisavailable.Becausetheyareperformedrelativelylateinthedesignprocess,prototypingandHILtestingtechniquesfocusprimarilyonverifyingexecutionperformanceofthesoftwareandlittleonthebehaviorandrobustnessoftheunderlyingcontrolstrategies.ThispaperprovidesanoverviewofthreelinksbetweenSaber®andMATLAB®/Simulink®thatenableearlyvalidationofembeddedcontrolalgorithmswithsimulatedmechatronichardware—avirtualHW/SWco-verificationplatform.
HW/SWCo-Verification
Theautomotiveindustryisplacingincreasedimportanceonfullsystemverificationthroughouttheentireembeddedsystemdesignprocess.Accordingly,acompletesolutionforvalidatinghardwareandsoftwareperformanceinasimulatedenvironmentisrequired,i.e.avirtualHW/SWco-verificationplatform(seeFigure1.HW/SWco-verificationisinitiatedearlyinthedesignprocess,wherecontrolstrategiesareverifiedandoptimizedinconjunctionwithsimulatedmodelsofthemechatronicsystemsbeingcontrolled.Lateron,ascontrolalgorithmsareimplementedascode,thefocusshiftstowardsverifyingtheexecutionperformanceoftheoperatingsystem,peripheraldrivers,andcontrolapplications,whereitiscriticaltotakecycle-accuratebehaviorintoaccount.
Algorithm1
EmbeddedSoftware
Algorithm2Algorithm3
MechatronicHardware
ControlApplicationsOperatingSystems
PeripheralDrivers
VirtualReal
Figure1.VirtualHW/SWCo-VerificationPlatform
©2004Synopsys,Inc.
2
>>>>>
>>>>ThebenefitsofHW/SWco-verificationcanberealizedbynotonlytheembeddedsoftwaredesigner,butthemechatronicsystemsintegratoraswell.Withearlyaccesstothesoftwareimplementation,thesystemsintegratorcanbeginfullsystemvalidationandavoidwaitinguntilaprototypeisavailablebeforeproblemsarediscovered.
StrivingforacompletevirtualenvironmentforHW/SWco-verificationofembeddedsystems,SynopsyshasdevelopedasetofintegrationsbetweenSaberandMATLAB/SimulinkfromTheMathWorks.Saber,aproduction-proventoolrecognizedthroughouttheautomotiveindustryformulti-technologysimulationanalysis,providesthecapabilitytoaccuratelymodelvirtualmechatronicsystems,includingelectrical,mechanical,hydraulic,pneumatic,andmagneticbehaviors.Likewise,MATLABandSimulinkarewidelyusedthroughouttheautomotiveindustryformodel-baseddevelopmentofembeddedsoftware.BylinkingthecomplimentarysolutionsofferedbySaberandMATLAB/Simulink,embeddedsystemsdesignersandmechatronicsystemsintegratorshavethecapabilitytoperformearlierco-verificationofcomplexembeddedsystems.
TheSaber-MATLABintegrationsincludeSaber-Simulinkco-simulation,Simulink-to-SaberModelImport,andSaberLinkPost-SimulationDataExchange.
Saber-SimulinkCo-simulation
TheSaber-Simulinkco-simulationinterfaceallowstheembeddedsoftwaredesignertoconcurrentlysimulatecontrolalgorithmsmodeledinSimulinkwithamechatronicsystemmodeledinSaber.Inthe
contextofHW/SWco-verification,thisinteractiveco-simulationlinkprovidestheabilitytoverifyalgorithmrobustnessandcalibratecontrollerparameters,allwithanentirelyvirtualrepresentationofthecompleteembeddedsystem.
Saber-Simulinkco-simulationisenabledthroughasynchronousinterfacethatexchangesdatabetweensimulatorsatafixedinterval,effectivelymodelingthediscrete-timecommunicationbetweenarealmicrocontrollerandsensorsinthephysicalmechatronicsystem(seeFigure2.Inotherterms,theco-simulationinterfaceperformsabehavioralanalog-digitalconversionbetweenthecontrollerandthemechatronicsystem.
A/D
MechatronicSystem
D/A
EmbeddedController
CosimulationInterface
SaberSimulink
Figure2.Saber-SimulinkCo-simulation
Saber-Simulinkco-simulationisinitializedandcontrolledentirelythroughtheSaberuserinterface.Atthesametime,theSimulinkinterfaceremainsactiveandaccessibletotheuser,allowingimmediatealterationstomodelparametersortopology.BecauseSaberactsasthemaster,thedesignercantakeadvantageofSaber’sadvancedanalysiscapabilities,includingiteratedandstatisticalanalyses(e.g.VaryandMonteCarlo.
3
>>>>>©2004Synopsys,Inc.
>>>>FullHW/SWSystemSimulationwithSimulink-to-SaberModelImport
Whileco-simulationoffersinteractiveaccesstobothSaberandSimulinkforthepurposeofverifyinganddebuggingcontrolalgorithms,itisnottheoptimalarrangementforthesystemintegratorconstructingavirtualmechatronicsysteminSaber.Instead,itisconvenienttoprovideamodeloftheembeddedsoftwarealgorithmsthatcanrunsolelyintheSaberenvironmentandnotdependonanactiveconnectionwithSimulink.TheSimulink-to-SaberModelImportUtilityoffersa“one-click”methodforconvertingSimulinkorStateflowmodelsintoaformthatcanbesimulatedentirelyinSaber.
UtilizingTheMathWorks’Real-TimeWorkshop‚,theSimulink-to-SaberModelImportUtilitygeneratesC-codeforaSimulink/StateflowmodelthatisthencompiledasadynamicallylinkedlibraryandaccessedthroughtheSaberforeignroutineinterface.ASaberMASTtemplateandSaberSketchsymbolarealsoautomaticallycreated,resultinginastand-alonemodelofembeddedsoftwarealgorithmsthatisreadyforuseintheSaberenvironment(seeFigure3.
Saber
Simulink
ANSICCode{
MastWrapperDLL
RTW
...}
CCompiler
Figure3.Simulink-to-SaberModelImport
SharingSimulationResultswithSaberLink
Usingmultiplesimulationtoolsforco-verificationofembeddedsoftwareandmechatronichardwareoftenposesanobstacleaftertheanalyseshavebeencompleted.AnalysisresultsfromaSaber-Simulinkco-simulationarestoredinformatsspecifictoeachsimulator,makingitdifficulttocomparedataineachtool.SaberandMATLABeachhavetheirstrengthsinanalysisdatapost-processing,soitisundesirabletoconfinesimulationresultstoasingleenvironment.
TheSaberLinkdataexchangeinterfaceprovidesadirectconnectionbetweenCosmosScope’andMATLAB,allowingtheusertoquicklyandeasilytransferpost-simulationdatabetweeneachenvironmentandeliminatinganydifficultyposedbycollectingsimulationdatafromeachtool(seeFigure4.
©2004Synopsys,Inc.
4
>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>