摘要
嵌入式控制系统通常都有模式,比如启动模式、正常工作模式以及紧急模式等。程序模式是由其输入变量值范围组合构成的输入变量约束表达式表示的。基于源程序,获取其模式,不仅能够验证实现的模式与设计是否一致,还能够更加精确地计算程序的WCET。在对源程序进行分析的基础上,提出了一种自动获取程序模式的新方法。该方法基于C语言源程序,针对程序控制流程图,通过调整循环中节点流向以及去除与输入变量无关的节点,获得输入变量相关控制流程图ICFG,通过对ICFG每条路径建立线性规划问题并求解,获得每一个潜在的程序模式及其输入变量约束表达式。对基准程序的实验结果,表明了该方法的可行性和有效性。
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.
出处
《计算机工程与科学》
CSCD
北大核心
2017年第7期1338-1345,共8页
Computer Engineering & Science
基金
河南省基础与前沿技术研究计划(152300410115)
河南省科技厅计划(162102310474)
关键词
嵌入式控制系统
程序模式
程序分析
控制流程图
embedded control systems
program mode
program analysis
control flow graph