• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学

• 论文 • 上一篇    下一篇

嵌入式控制系统程序模式的自动分析方法

姬孟洛1,舒云星1,黄辰林2,高翔1,陶荣1   

  1. (洛阳理工学院计算机与信息工程学院,河南 洛阳 471023;国防科技大学计算机学院,湖南 长沙 410073)
  • 收稿日期:2015-12-31 修回日期:2016-05-10 出版日期:2017-07-25 发布日期:2017-07-25
  • 基金资助:

    河南省基础与前沿技术研究计划(152300410115);河南省科技厅计划(162102310474)

An automatic program mode analysis
approach for embedded control systems
 

JI Meng-luo1,SHU Yun-xing1,HUANG Chen-lin2,GAO Xiang1,TAO Rong1   

  1. (1.Department of Computer and Information Engineering,Luoyang Institute of Science and Technology,Luoyang 471023;
    2.College of Computer,National University of Defense Technology,Changsha 410073,China)
     
  • Received:2015-12-31 Revised:2016-05-10 Online:2017-07-25 Published:2017-07-25

摘要:

嵌入式控制系统通常都有模式,比如启动模式、正常工作模式以及紧急模式等。程序模式是由其输入变量值范围组合构成的输入变量约束表达式表示的。基于源程序,获取其模式,不仅能够验证实现的模式与设计是否一致,还能够更加精确地计算程序的WCET。在对源程序进行分析的基础上,提出了一种自动获取程序模式的新方法。该方法基于C语言源程序,针对程序控制流程图,通过调整循环中节点流向以及去除与输入变量无关的节点,获得输入变量相关控制流程图ICFG,通过对ICFG每条路径建立线性规划问题并求解,获得每一个潜在的程序模式及其输入变量约束表达式。对基准程序的实验结果,表明了该方法的可行性和有效性。

 

关键词: 嵌入式控制系统, 程序模式, 程序分析, 控制流程图

Abstract:

Embedded control systems normally have modes such as startup mode, normal mode and emergency mode. Program modes are expressed by the combination of value ranges of input parameters, which are input parameter expressions. Deriving program modes from code cannot only verify the consistency between the design and implementation, but also improve the accuracy of WCET estimation. Based on the analysis of source code, we propose a new method which can automatically analyze program modes. We achieve an input-dependent control flow graph (ICFG) by working on the control flow graph of the source code, then redirecting the control flows of nodes in loops and deleting input variables independent nodes. We construct a linear programming problem for each path of the ICFG and gain an input parameter expression for a potential mode if the problem has a solution. Expression results for a benchmark program show that the method is feasible and effective.
 

Key words: embedded control systems, program mode, program analysis, control flow graph