###
计算机系统应用英文版:2021,30(11):33-40
本文二维码信息
码上扫一扫!
面向RISC-V的汇编程序语义等价性自动化测试系统
(军事科学院 国防科技创新研究院, 北京 100097)
Automatic Testing System for Semantic Equivalence of RISC-V Assembly Programs
(Defense Innovation Institute, Academy of Military Sciences, Beijing 100097, China)
摘要
图/表
参考文献
相似文献
本文已被:浏览 1032次   下载 2123
Received:April 28, 2021    Revised:May 21, 2021
中文摘要: 本文设计并实现了一套面向RISC-V的汇编程序语义等价性自动化测试系统. 在面向RISC-V开发软件时, 尤其是基于扩展指令(例如向量指令)编写高效的程序时, 很难避免以手写汇编的方式编写代码. 例如, 为标准的C函数库编写相应的向量版函数. 与编译器自动生成的代码不同, 手写的汇编代码虽然可以最大限度地提高程序的效率, 但因绕过了编译时对程序的约束(如类型检查、寄存器分配等)而对开发者提出了更高的要求. 能否对新版本与标准版本的汇编程序进行快速地、自动化的语义等价性测试, 将大大影响代码的正确性和软件开发和调试的效率. 已有面向RISC-V的测试框架缺乏对语义等价性测试的支持, 也未考虑程序执行带来的副作用. 本研究基于模拟器的动态测试环境, 设计并实现了一套面向RISC-V的汇编程序语义等价性自动化测试系统. 系统通过跟踪机器状态, 捕获程序执行的副作用, 并结合用户定义的测试目标生成测试报告. 实验表明, 本系统相比已有的测试系统, 能够有效地对RISC-V汇编程序的语义等价性进行测试.
Abstract:In this study, we design and implement an automatic testing system for semantic equivalence of RISC-V assembly programs. While developing RISC-V programs, especially developing efficient programs based on extension instructions (such as vector extension), developers often write assembly code manually. For example, for the standard C function library, we often write the corresponding vector version functions for better performance. Without the compiler, the manually developed assembly code can maximize the efficiency of the program, but it skips many important compilation processes (such as type checking and register allocation), thus putting forward higher requirements for the developers. It will greatly affect the correctness of the code and the efficiency of software development and debugging if we can quickly and automatically test whether the rewritten version is semantically equivalent to the standard version of the program. The existing RISC-V testing framework lacks support for semantic equivalence testing and fails to consider the side effects caused by program executions. Based on the dynamic test environment of a simulator, this research designs and implements an automatic testing system for semantic equivalence of RISC-V assembly programs. It can capture side effects caused by program executions through monitoring machine states and generate testing reports with user-defined testing targets. Experiments show that the system, compared with existing testing systems, can test the semantic equivalence of RISC-V assembly programs.
文章编号:     中图分类号:    文献标志码:
基金项目:国家自然科学基金(61802427)
引用文本:
徐学政,王涛,方健,张光达.面向RISC-V的汇编程序语义等价性自动化测试系统.计算机系统应用,2021,30(11):33-40
XU Xue-Zheng,WANG Tao,FANG Jian,ZHANG Guang-Da.Automatic Testing System for Semantic Equivalence of RISC-V Assembly Programs.COMPUTER SYSTEMS APPLICATIONS,2021,30(11):33-40