GeneratingCodeforProductionECUsGeneratingCodeforProductionECUsUsingSimulink®,Inc.eMathWorks©2008The1Td’AdToday’sAgendaTheMathWorksataglanceTheMathWorksataglanceCodeGenerationOverviewArchitectureComponentManagementpgPackagingDataManagementandDataDictionaryLegacyCodeIntegrationFixed-PointDesignSimulinkCustomizationOverviewEmbeddedCodeGenerationExtensionsDemosandexercises2TheMathWorksTheMathWorks...ataGlanceFddi1984•Foundedin1984•Privatelyheldy•Consistentlyprofitable•Over2000employees,includingover30%ingproductdevelopment•Mth1000000•Morethan1,000,000customersinover100countries3inover100countriesWorldwideOfficesHeadquarters:Natick,MAUSANorthAmericanoffices:AsianandEuropeanoffices:NorthAmericanoffices:California,Michigan,WashingtonDC,TexasAustralia,China,France,Germany,Italy,Korea,Netherlands,Spain,Sweden,Switzerland,UKThismapshowstheEarth’stopographyonanequidistantcylindricalprojection,cylidicalpojectio,usingtheMATLABMappingToolbox.Distributorsin25countries4Worldwidesales,training,andconsultingDistributorsin25countriesDiverseUsersSignalprocessingUtilities&energySignalprocessing&communicationsBiotech,medical,&pharmaceutical&pharmaceuticalFinance&economicsInstrumentationFinance&economicsAutomotiveAGovernment5EducationAerospace&defenseTheMathWorksFamilyMATLABSimulinkApplicationStand-AloneppDevelopmentToolsToolboxesStateflow®ApplicationsDataAccessToolsBlocksetsCodeGenerationDataSourcesCCodeStudentProductsCodeGenerationCCode6Programs&DataMathWorksToolsatWorkWewillanalyzetheperformanceofReal-TimeWorkshopDesignAnalyzeDatageneratedcodeVisualizeWewilldesigndlfitiValidateModelmodelconfigurationforproductioncodegenerationValidateStand-AloneApplicationsWewillvalidate7ApplicationsWewillvalidateReal-TimeWorkshopgeneratedalgorithmWewillmodelcustomdesignrequirementsTheMathWorksWebResources•Information&downloads•Trainingschedule•Solutiondatabase•Documentation•Fileexchange•Newsgroup•Webinars•Newsletters•MATLABbasedbooks•Offeredthroughouttheworld•Scheduleandcourseinformation:h//hk•Bringtrainingtoyoursite•CustomcoursesavailableInstructor-LedE-LearningWheredoyougofromhere?RT04:Real-TimeWorkshop®EmbeddedCoderforEmbeddedSoftwareDevelopmentInstructor-LedE-Learning•Trainatworkorathome•Instructor-lede-learning10Developmentg•FlexibledatesandtimesProductionCodeGenerationTechnology,Inc.gyeMathWorks©2008The11CodeGenerationOverview–CDevelopmentOverview–CodeGenerationBasics12Problem:DesignanEmbeddedControllerPltPlantorEnvironment+-ControllerorAlitiEmbeddedSystemApplication13SimpleECUSWStructureCommunicationCoreSoftwareAlgorithmsMOutputDriversCommDriversCommunicationInterfacesAlgorithmsandLogicActuatorsABCINPUTBLUEGREENREDPOWERRGBSplit-4BLACKBOXVRCSInputDriversSpecialDeviceDriversSpecialSensorsSpecialInterfacesCCPScheduler/OperatingSystemASAP2MostDevelopmentisonCore14AndSupportUtilitiesisonCoreSoftwareAlgorithmsTditilCDltIflTraditionalCDevelopmentInfluencesProcessOrganizationalStandardsOrganizationalIssuesStandardsCCodeAlgorithmsandDesignDetailsDataDictionaryyMemoryMapDataDefinitionsRTOS,Utilities,MathLibrariesDi15Drivers,ToolsExplosiveGrowthofCodeEstimatedSourceLinesofCode“GrowthoftopendautomotiveEstimatedSourceLinesofCode(LOC)Today’spowertrain:500,000LOCToda’sehicles1000000LOCGrowthoftopendautomotiveembeddedsoftwarehasbeenexponential.”Today’svehicles:1,000,000LOC2015vehicles:100,000,000LOCRobertGeeDirectorofStrategyforMotorolaAutomotiveManagementtrends:High-levelarchitecturalplanningAlgorithmdeelopmentithmodels“…NolongerpossibletovalidateandverifyfunctionalitybybruteforceAlgorithmdevelopmentwithmodelsAutomaticgenerationofcodefrommodelsIdtidtdditifyytestingalone.”JimKolhoffDirectorofSoftwareEngineeringatGMPowertrainIndustry-widestandardizationofinterfacesandcommonfunctionalityAutomotiveEngineering,“ManagingforSoftwareSuccess”–Aug2006sae.org/automag/electronics/08-2006/1-114-8-34.pdf16Model-BasedDesignforEmbeddedSystemsyAutomaticcodegenerationisanintegralpartofModel-BasedDesignandenablesallofitsDesignandenablesallofitsaspects:–Executablespecification–Detaileddesign–ImplementationTestanderification–Testandverification17ECUDltPECUDevelopmentProcesswithModel-BasedDesignSystemRequirementsVehicleIntegration&CalibrationSimHILyqHd/Sft&CalibrationRPPILSystemDesignHardware/SoftwareIntegrationSim:SimulationSoftwareDesignSoftwareIntegrationOTRPSILPCGSim:SimulationRP:RapidPrototypingOTRP:On-TargetRapidPrototypingPCG:ProductionCodeGenerationCdiRitTbilit18SIL:SoftwareinLoopTestingPIL:ProcessorinLoopTestingHIL:HardwareinLoopTestingCodingRequirementsTraceabilityConfigurationManagementDocumentationToyotaandDENSOCommitmenttoMBDToyotaandDENSOCommitmenttoMBD–ToyotaandDENSOwilluseTheMathWorksproductsinsoftwareToyotaandDENSOwilluseTheMathWorksproductsinsoftwaredevelopmentforproductionprograms,includingpowertrai