面向RISC-V的汇编程序语义等价性自动化测试系统
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

基金项目:

国家自然科学基金(61802427)


Automatic Testing System for Semantic Equivalence of RISC-V Assembly Programs
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 增强出版
  • |
  • 文章评论
    摘要:

    本文设计并实现了一套面向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.

    参考文献
    相似文献
    引证文献
引用本文

徐学政,王涛,方健,张光达.面向RISC-V的汇编程序语义等价性自动化测试系统.计算机系统应用,2021,30(11):33-40

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2021-04-28
  • 最后修改日期:2021-05-21
  • 录用日期:
  • 在线发布日期: 2021-10-22
  • 出版日期:
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京海淀区中关村南四街4号 中科院软件园区 7号楼305房间,邮政编码:100190
电话:010-62661041 传真: Email:csa (a) iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号