Improving Automotive ECU Deployment Efficiency by a Model-Based Code Generation Approach
2024 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE credits
Student thesisAlternative title
Förbättring av automotive ECU implementeringseffektivitet med en modellbaserad kodgenerering (Swedish)
Abstract [en]
Modern automotive systems critically depend on efficient software for their operation. To improve the software development efficiency, automatic code generation tools are used to generate the C/C++ codes for model-based software for Electronic Control Units (ECU). However, the generated code often has low execution efficiency when deployed on the ECU. Thus, it seriously impacts the functionalities of automobile-embedded systems. To address this problem, the degree project conducted at ZEEKR Technology Europe R&D Center (ZEEKR) investigates a method for improving ECU efficiency by decreasing data dependencies while deployed on the onboard embedded systems. The study covers algorithm design and code optimization, contributing a novel model-based code generation method. First, the Simulink model will be transferred into an Extensible Markup Language (XML) structure. Then, a methodology will be utilized to analyze the data flow of the model, which will also build a data graph in C++. Then, an algorithm will be implemented to optimize the original C code sequence to improve the efficiency of the embedded system in a designated automobile caused by data dependencies. The algorithm's core is the Breadth First Search (BFS) methodology which scans and assigns each node. Finally, an optimized code execution sequence is generated based on these hierarchical relationships, reducing data dependencies. Processor in the Loop (PiL) simulations were performed for system testing to examine the performance and correctness of the layer-based new algorithm. The benchmark of the experiment will be the clock cycle, which is the minor operation unit executed within the processor. By measuring the number of clock cycles executed, the performance of the optimized code compared with the original can be accurately evaluated. The results show that the optimized methodology could take 0.5% to 2.5% less time owing to reduced data dependencies in the model.
Abstract [sv]
Moderna fordonssystem är kritiskt beroende av effektiv programvara för sin drift. För att förbättra effektiviteten i mjukvaruutvecklingen används automatiska kodgenereringsverktyg för att generera C/C++-koder för modellbaserad programvara för Electronic Control Units (ECU). Den genererade koden har dock ofta låg exekveringseffektivitet vid implementering på ECU:n. Detta påverkar allvarligt funktionaliteten hos fordonsinbäddade system. För att komma till rätta med detta problem undersöker examensarbetet som genomförts vid ZEEKR Technology Europe R&D Center (ZEEKR) en metod för att förbättra ECU-effektiviteten genom att minska databeroenden i de inbyggda systemen. Studien omfattar algoritmdesign och kodoptimering som bidrar till en ny modellbaserad kodgenereringsmetod. Först överförs Simulink-modellen till en XML-struktur (Extensible Markup Language). Därefter används metodiken för att analysera modellens dataflöde och bygga en datagraf i C++. Sedan implementeras en algoritm för att optimera den ursprungliga C-kodsekvensen och förbättra effektiviteten hos det inbyggda systemet för ett designat fordon med databeroenden. Kärnan i algoritmen utgörs av Breadth First Search-metoden (BFS) för scanning och tilldelning av varje nod. Slutligen genereras en optimerad kodexekveringssekvens baserad på dessa hierarkiska relationer, vilket minskar databeroenden. För systemtestning utfördes Processor in the Loop (PiL) simuleringar för att undersöka prestanda och korrekthet hos den nya lagerbaserade algoritmen. Experimentets riktmärke är klockcykeln, den minsta operationsenheten som utförs i processorn. Genom att mäta antalet utförda klockcykler kan den optimerade kodens prestanda noggrant utvärderas mot originalet. Resultaten visar att den optimerade metodiken reducerar exekveringstiden med 0,5% till 2,5% genom minskade databeroenden i modellen.
Place, publisher, year, edition, pages
2024. , p. 61
Series
TRITA-ITM-EX ; 2024:580
National Category
Mechanical Engineering
Identifiers
URN: urn:nbn:se:kth:diva-362112OAI: oai:DiVA.org:kth-362112DiVA, id: diva2:1950545
External cooperation
Zeekr Technology Europe AB
Subject / course
Embedded System Design
Educational program
Master of Science - Embedded Systems
Presentation
2024-10-11, 00:00
Supervisors
Examiners
2025-04-082025-04-082025-04-08Bibliographically approved