Mercury: Instruction Pipeline Aware Code Generation for Simulink Models

被引:8
作者
Yu, Zehong [1 ]
Su, Zhuo [1 ]
Yang, Yixiao [2 ]
Liang, Jie [1 ]
Jiang, Yu [1 ]
Cui, Aiguo [3 ]
Chang, Wanli [4 ]
Wang, Rui [2 ]
机构
[1] Tsinghua Univ, Sch Software, BNRist, KLISS, Beijing 100084, Peoples R China
[2] Capital Normal Univ, Informat Engn Coll, Beijing 100048, Peoples R China
[3] Huawei Technol Co Ltd, Godel Labs, Shanghai 200120, Peoples R China
[4] Hunan Univ, Coll Comp Sci & Elect Engn, Changsha 410082, Peoples R China
关键词
Codes; Pipelines; Software packages; Data models; Generators; Semantics; Embedded software; Code generation; instruction pipeline; Simulink models;
D O I
10.1109/TCAD.2022.3199967
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
Simulink is a widely used model-driven design environment for supporting the simulation and code generation of embedded applications. To improve the quality of the code generated from Simulink models, state-of-the-art code generators employ various high-level optimizations, like eliminating local variables. However, they overlook the compatibility between code and the low-level processor architecture, especially the instruction pipeline. Consequently, instruction pipeline stalls occur frequently, leading to additional delays in instruction execution, as well as limited efficiency for deployed the embedded software. In this article, we propose Mercury, an instruction pipeline aware code generator for Simulink models which utilizes data dependencies between actors to decrease the instruction pipeline stalls of the generated code. First, Mercury collects data dependencies through model dataflow traversal and records the property of each actor. Then, Mercury approximately estimates the execution latency of required instructions fetched from corresponding actors and uses a topology-based method to obtain candidate actors for code synthesis. Finally, Mercury adopts the least penalty priority to iteratively select the most suitable actor for code synthesis and releases data dependencies with its subsequent actors. We implemented and evaluated Mercury on benchmark Simulink models (Su et al., 2021) as well as a real industrial model. Compared to the official tool Simulink Embedded Coder and the state-of-the-art academic tool DFSynth, Mercury outperformed them by 9.7%-33.4% and 9.2%-59.4% in terms of the execution time of the generated code across different architectures, respectively. The statistics also demonstrate that the generated code of Mercury increases utilization of pipeline slots by 11.0%-37.1% and 10.6%-50.0%, respectively.
引用
收藏
页码:4504 / 4515
页数:12
相关论文
共 26 条
[1]   Slicing UML-based Models of Real-time Embedded Systems [J].
Ahmadi, Reza ;
Posse, Ernesto ;
Dingel, Juergen .
21ST ACM/IEEE INTERNATIONAL CONFERENCE ON MODEL DRIVEN ENGINEERING LANGUAGES AND SYSTEMS (MODELS 2018), 2018, :346-356
[2]  
[Anonymous], DaVinci Developer
[3]  
[Anonymous], SIMULINK MATLAB SIMU
[4]  
[Anonymous], 2014, System design, modeling, and simulation: using Ptolemy II
[5]   Applying Model Driven Engineering Techniques to the Development of Contiki-based IoT Systems [J].
Asici, Tansu Zafer ;
Karaduman, Burak ;
Eslampanah, Raheleh ;
Challenger, Moharram ;
Denil, Joachim ;
Vangheluwe, Hans .
2019 IEEE/ACM 1ST INTERNATIONAL WORKSHOP ON SOFTWARE ENGINEERING RESEARCH & PRACTICES FOR THE INTERNET OF THINGS (SERP4IOT 2019), 2019, :25-32
[6]  
Atkinson K. E., 2008, An introduction to numerical analysis
[7]  
Babikian A. A., 2020, P 23 ACM IEEE INT C, P1
[8]   SCADE: Synchronous design and validation of embedded control software [J].
Berry, Gerard .
NEXT GENERATION DESIGN AND VERIFICATION METHODOLOGIES FOR DISTRIBUTED EMBEDDED CONTROL SYSTEMS, 2007, :19-33
[9]  
Bourezk H., 2020, PRELIMINARY RESULTS, P1
[10]  
Buck J., 2002, Readings in Hardware/Software Co-Design (Systems on Silicon), P527