[论文解读] Computation of WCET using Program Slicing and Real-Time Model-Checking
本文提出了一种完全自动化的方法,用于使用程序切片和Uppaal中的实时模型检测计算最坏情况执行时间(WCET)。该方法从二进制代码构建控制流图,并将硬件(如ARM920T)建模为定时自动机,将其与程序同步,将WCET分析简化为可达性问题,在真实硬件测量中实现了相对误差低于5%的高精度。
Computing accurate WCET on modern complex architectures is a challenging task. This problem has been devoted a lot of attention in the last decade but there are still some open issues. First, the control flow graph (CFG) of a binary program is needed to compute the WCET and this CFG is built using some internal knowledge of the compiler that generated the binary code; moreover once constructed the CFG has to be manually annotated with loop bounds. Second, the algorithms to compute the WCET (combining Abstract Interpretation and Integer Linear Programming) are tailored for specific architectures: changing the architecture (e.g. replacing an ARM7 by an ARM9) requires the design of a new ad hoc algorithm. Third, the tightness of the computed results (obtained using the available tools) are not compared to actual execution times measured on the real hardware. In this paper we address the above mentioned problems. We first describe a fully automatic method to compute a CFG based solely on the binary program to analyse. Second, we describe the model of the hardware as a product of timed automata, and this model is independent from the program description. The model of a program running on a hardware is obtained by synchronizing (the automaton of) the program with the (timed automata) model of the hardware. Computing the WCET is reduced to a reachability problem on the synchronised model and solved using the model-checker UPPAAL. Finally, we present a rigorous methodology that enables us to compare our computed results to actual execution times measured on a real platform, the ARM920T.
研究动机与目标
- 为解决现代嵌入式系统(如具有流水线和缓存等复杂架构)的精确WCET计算挑战。
- 通过从二进制代码自动推导控制流图,消除手动构建CFG和循环边界注释的需求。
- 通过使用处理器的模块化定时自动机模型,将硬件建模与程序分析解耦。
- 通过将计算结果与真实平台上的实际执行时间进行比较,实现精确的WCET估计。
- 通过仅更改硬件模型而非分析算法,实现灵活的硬件移植支持。
提出的方法
- 通过程序切片从二进制代码自动推断控制流图(CFG),无需源代码或编译器内部信息。
- 将目标硬件(如ARM920T)建模为定时自动机的乘积,捕捉流水线阶段、缓存行为和内存访问时间。
- 将程序的执行模型与硬件模型同步,形成表示程序在该硬件上执行的复合定时自动机。
- 将WCET计算简化为Uppaal中的可达性查询,其中最长路径对应最坏情况执行时间。
- 使用符号执行和模型检测高效探索所有可行的程序路径,即使在数据依赖指令定时复杂的情况下亦可。
- 采用严格的实验协议,在真实ARM920T硬件上测量实际执行时间以进行验证。
实验结果
研究问题
- RQ1是否能够通过完全自动化的方法在无需手动构建CFG或循环边界注释的情况下计算出精确的WCET?
- RQ2是否能够独立建模特定硬件的定时行为(如流水线、缓存),并将其与程序模型组合,以实现精确的WCET分析?
- RQ3通过模型检测计算出的WCET与在真实硬件上测量的实际执行时间相比如何?
- RQ4是否能够通过仅修改硬件模型,轻松将该方法适配到不同处理器?
- RQ5在具有数据依赖指令定时的复杂程序上,使用符号模型检测可实现的WCET边界紧致程度如何?
主要发现
- 该方法能从二进制代码自动构建控制流图,消除了对手动注释或特定编译器知识的需求。
- 在18个程序中,计算出的WCET与实测WCET之间的平均相对误差为2.4%,最高误差为matmult-O2的5.4%。
- 对于单路径程序,相对误差范围为0.42%至3.8%,表明在可预测执行场景中具有高精度。
- 对于多路径程序(如insertsort-O0和ns-O0),相对误差分别为0.8%和0.8%,表明其在复杂控制流场景下仍具可扩展性。
- 通过简单替换硬件模型,该框架支持硬件移植,如在不同优化级别下对ARM920T的稳定结果所示。
- 模型检测方法成功计算了状态数超过1000万的状态空间(如matmult-O0具有1050万状态),表明其可扩展至大规模状态空间。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。