{"title":"MFrodo: Efficient and Memory-Sensitive Simulink Code Generation via Redundancy Elimination","authors":"Zehong Yu;Yixiao Yang;Zhuo Su;Haowei Qiu;Rui Wang;Aiguo Cui;Zhan Shu;Yu Jiang","doi":"10.1109/TCAD.2025.3628786","DOIUrl":null,"url":null,"abstract":"Simulink has emerged as the fundamental infrastructure that supports modeling, simulation, verification, and code generation for embedded software development. To improve the performance of the code generated from Simulink models, state-of-the-art code generators employ various optimization techniques, such as expression folding, variable reuse, and parallelism. However, they overlook the presence of redundant calculations within data-intensive models widely used to perform substantial data processing in embedded scenarios, which can significantly degrade the performance and introduce additional memory usage. This article proposes <sc>MFrodo</small>, an efficient and memory-sensitive code generator for data-intensive Simulink models through redundancy elimination. <sc>MFrodo</small> begins by conducting model analysis to construct the dataflow graph and derive the input/output (I/O) mapping of each block. Then, for each block within the dataflow graph, <sc>MFrodo</small> recursively determines its calculation range by leveraging the I/O mapping of its subsequent blocks and marks optimization blocks whose calculation range is eliminated. For optimizable blocks, <sc>MFrodo</small> eliminates the redundant calculations and reduces the memory space associated with these calculations. Finally, <sc>MFrodo</small> rebuilds the I/O mappings of these optimizable blocks to ensure code correctness and synthesizes the embedded code for deployment. We implemented and evaluated <sc>MFrodo</small> on benchmark Simulink models, in terms of execution duration, memory usage, and code generation overhead across different compilers and architectures. The results show that, compared with the Simulink Embedded Coder, DFSynth, and HCG, <sc>MFrodo</small> achieves performance improvements ranging from <inline-formula> <tex-math>$1.17\\times $ </tex-math></inline-formula> to <inline-formula> <tex-math>$8.55\\times $ </tex-math></inline-formula>, while reducing BSS segment usage by 12.00%–52.71%. Besides, <sc>MFrodo</small> reduces compile time by 91.8%–98.7% and code synthesis time by 94.3%–99.6% compared with Simulink Embedded Coder, while incurring comparable overhead to DFSynth and HCG.","PeriodicalId":13251,"journal":{"name":"IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems","volume":"45 7","pages":"3455-3468"},"PeriodicalIF":3.6000,"publicationDate":"2026-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems","FirstCategoryId":"94","ListUrlMain":"https://ieeexplore.ieee.org/document/11225908/","RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2025/11/4 0:00:00","PubModel":"Epub","JCR":"Q2","JCRName":"COMPUTER SCIENCE, HARDWARE & ARCHITECTURE","Score":null,"Total":0}
引用次数: 0
Abstract
Simulink has emerged as the fundamental infrastructure that supports modeling, simulation, verification, and code generation for embedded software development. To improve the performance of the code generated from Simulink models, state-of-the-art code generators employ various optimization techniques, such as expression folding, variable reuse, and parallelism. However, they overlook the presence of redundant calculations within data-intensive models widely used to perform substantial data processing in embedded scenarios, which can significantly degrade the performance and introduce additional memory usage. This article proposes MFrodo, an efficient and memory-sensitive code generator for data-intensive Simulink models through redundancy elimination. MFrodo begins by conducting model analysis to construct the dataflow graph and derive the input/output (I/O) mapping of each block. Then, for each block within the dataflow graph, MFrodo recursively determines its calculation range by leveraging the I/O mapping of its subsequent blocks and marks optimization blocks whose calculation range is eliminated. For optimizable blocks, MFrodo eliminates the redundant calculations and reduces the memory space associated with these calculations. Finally, MFrodo rebuilds the I/O mappings of these optimizable blocks to ensure code correctness and synthesizes the embedded code for deployment. We implemented and evaluated MFrodo on benchmark Simulink models, in terms of execution duration, memory usage, and code generation overhead across different compilers and architectures. The results show that, compared with the Simulink Embedded Coder, DFSynth, and HCG, MFrodo achieves performance improvements ranging from $1.17\times $ to $8.55\times $ , while reducing BSS segment usage by 12.00%–52.71%. Besides, MFrodo reduces compile time by 91.8%–98.7% and code synthesis time by 94.3%–99.6% compared with Simulink Embedded Coder, while incurring comparable overhead to DFSynth and HCG.
期刊介绍:
The purpose of this Transactions is to publish papers of interest to individuals in the area of computer-aided design of integrated circuits and systems composed of analog, digital, mixed-signal, optical, or microwave components. The aids include methods, models, algorithms, and man-machine interfaces for system-level, physical and logical design including: planning, synthesis, partitioning, modeling, simulation, layout, verification, testing, hardware-software co-design and documentation of integrated circuit and system designs of all complexities. Design tools and techniques for evaluating and designing integrated circuits and systems for metrics such as performance, power, reliability, testability, and security are a focus.