Synthesizing Hardware-Specific Instructions for Efficient Code Generation of Simulink
Zehong Yu, Zhuo Su, Rui Wang, Yu Jiang
Abstract
Simulink has become a pivotal tool in embedded scenarios, offering a model-driven approach for embedded software development. Given the tight performance and resource constraints in embedded applications, it is crucial to ensure the efficiency of the code generated from Simulink models. Code generators implement various optimizations to enhance performance. However, they neglect the potential of hardware-specific instructions available in modern processors, such as saturation-type instructions, which accomplish complex operations in fewer cycles. Moreover, relying on state-of-the-art compilers to use these instructions is also not as effective as expectation, due to their complex semantics. This paper proposes Amica, an efficient code generator for Simulink models with hardware-specific instruction synthesis. The key insight of Amica is to leverage model semantics to effectively synthesize the appropriate instructions. Amica first converts the model into the dataflow graph and crafts a series of optimization rules represented as dataflow subgraph with constraints related to block parameters, data types, and other critical properties. Then, Amica iteratively matches these rules with dataflow graph to obtain the optimizable candidates. The candidate that maximizes latency reduction is chosen to update the dataflow graph. Finally, Amica synthesizes the appropriate instructions for optimizable blocks in accordance with instruction syntax and block properties. We implemented and evaluated Amica on benchmark Simulink models. Compared with the state-of-the-art code generators Simulink Embedded Coder, Mercury, and Frodo, the code generated by Amica is 1.29 × - 8.36 × faster in terms of execution time across different platforms. Besides, Amica reduces 6% - 53% assembly code size of the compiled programs, while performing similarly in terms of data segment size and BSS segment size.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 201a0f7d-5fae-4fe5-87fd-5b68d10222ffBuilds on8
- Vectorization for digital signal processors via equality saturationAlexa VanHattum, Rachit Nigam, Vincent T. Lee, James Bornholt et al.ASPLOS 2021 · 57 citations
- Automatic Generation of Vectorizing Compilers for Customizable Digital Signal ProcessorsSamuel Thomas, James BornholtASPLOS 2024 · 16 citations
- Vector instruction selection for digital signal processors using program synthesisMaaz Bin Safeer Ahmad, Alexander J. Root, Andrew Adams, Shoaib Kamil et al.ASPLOS 2022 · 13 citations
- HCG: optimizing embedded code generation of simulink with SIMD instruction synthesisZhuo Su, Zehong Yu, Dongyan Wang, Yixiao Yang et al.DAC 2022 · 10 citations
- Fast Instruction Selection for Fast Digital Signal ProcessingAlexander J. Root, Maaz Bin Safeer Ahmad, Dillon Sharlet, Andrew Adams et al.ASPLOS 2023 · 7 citations
Related papers
- Efficient Code Generation for Data-Intensive Simulink Models via Redundancy EliminationZehong Yu, Zhuo Su, Yu Jiang, Aiguo Cui et al.DAC 2024 · 3 citations
- AccMoS: Accelerating Model Simulation for Simulink via Code GenerationYifan Cheng, Zehong Yu, Zhuo Su, Ting Chen et al.DAC 2024 · 3 citations
- Satune: synthesizing efficient SAT encodersHamed Gorjiara, Guoqing Harry Xu, Brian DemskyOOPSLA 2020 · 4 citations
- SOFF: An OpenCL High-Level Synthesis Framework for FPGAsGangwon Jo, Heehoon Kim, Jeesoo Lee, Jaejin LeeISCA 2020 · 20 citations
- STCG: State-Aware Test Case Generation for Simulink ModelsZhuo Su, Zehong Yu, Dongyan Wang, Yixiao Yang et al.DAC 2023 · 4 citations
