面向RISC-V指令集多样性的兼容性感知多层级构建方法
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP311

基金项目:


Compatibility-aware Multi-level Build Method for RISC-V Instruction Set Diversity
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    RISC-V指令集架构凭借其开放性与模块化设计, 推动了芯片架构实现创新与定制化, 但与此同时也引发了严重的软件生态碎片化问题. 传统的跨平台软件构建机制(如现场编译、IFUNC与Multilib)在RISC-V生态中面临兼容性差、维护成本高与优化粒度不足等显著挑战, 亟需新的解决方案. 提出了一种面向RISC-V平台的兼容性感知多层级编译方法——RuyiBuild工具链, 以LLVM IR为中间表示, 结合非侵入式编译流程拦截机制, 实现了对现有软件构建系统的透明适配, 使构建生成的操作系统软件包既具备面向不同RISC-V扩展指令集的兼容性, 又可以面向最终运行平台进行基于扩展指令集的自适应优化, 有效解决了RISC-V指令集多样性背景下, 多指令扩展组合与平台差异下二进制高性能优化与广泛兼容性的双目标统筹实现问题. RuyiBuild工具链围绕LLVM IR的提取与部署、转换与优化设计了一套完整的跨平台软件分发与精细化优化框架, 主要包含4个核心机制: 透明化双路径编译与LLVM IR提取机制、动态链接库LLVM IR合并与链接转换机制、LLVM IR文件部署与发行版RPM自动化集成机制以及客户端与云端LLVM IR动态转换与资源自适应调度机制. 在技术实现方面, RuyiBuild工具链通过封装编译工具与系统命令, 在不修改源码与构建系统的前提下实现LLVM IR的全路径提取与分发, 并在部署阶段支持LLVM IR与传统二进制的同步发布. 同时, 为支持多种目标设备和微架构的性能优化, RuyiBuild支持客户端资源感知的延迟转换、云端面向多架构的适配与LLVM IR动态转换. 实验结果表明, RuyiBuild能够面向多种RISC-V指令集扩展与微架构组合实现对目标程序的部署, 并在性能、兼容性、构建开销与部署复杂度方面取得较好平衡, 解决了硬件兼容性与硬件性能充分发挥之间的矛盾. 为RISC-V生态中的软件构建、部署与适配提供了新的解决思路, 具备良好的学术价值与实践推广潜力.

    Abstract:

    The RISC-V instruction set architecture, characterized by its openness and modular design, promotes innovation and customization in processor architecture, while simultaneously introducing severe software ecosystem fragmentation. Traditional cross-platform software build mechanisms, such as on-site compilation, IFUNC, and Multilib, encounter significant challenges in the RISC-V ecosystem, including limited compatibility, high maintenance overhead, and insufficient optimization granularity, which highlights the need for new solutions. To address these issues, this study proposes a compatibility-aware multi-level compilation method for the RISC-V platform—RuyiBuild toolchain. By adopting LLVM IR as the intermediate representation and integrating a non-intrusive compilation interception mechanism, transparent adaptation to existing software build systems is achieved. As a result, the generated operating system software packages simultaneously support compatibility across heterogeneous combinations of RISC-V extension instruction sets and adaptive, extension-aware optimizations tailored to target execution platforms. This approach systematically resolves the dual-objective challenge of achieving both high-performance binary optimization and broad compatibility under diverse instruction set extensions and platform variations inherent in the RISC-V ecosystem. Centered on the extraction, deployment, transformation, and optimization of LLVM IR, RuyiBuild establishes a comprehensive framework for cross-platform software distribution and fine-grained optimization. The framework consists of four core mechanisms: a transparent dual-path compilation and LLVM IR extraction mechanism; a dynamic library LLVM IR aggregation and link-time transformation mechanism; an LLVM IR deployment and automated RPM integration mechanism; a client-cloud collaborative LLVM IR dynamic transformation and resource-adaptive scheduling mechanism. From an implementation perspective, the RuyiBuild toolchain encapsulates compilation tools and system commands, enabling full-path LLVM IR extraction and distribution without modifying source code or existing build systems. During deployment, synchronized distribution of LLVM IR and traditional binaries is supported. Furthermore, to facilitate performance optimization across various target devices and microarchitectures, client-side resource-aware deferred transformation and cloud-side multi-architecture adaptation with dynamic LLVM IR transformation are provided. Experimental results show that RuyiBuild supports deployment across a wide range of RISC-V instruction set extensions and microarchitecture combinations, while achieving a favorable balance among performance, compatibility, build overhead, and deployment complexity. Consequently, this study provides a novel and effective solution for software build, deployment, and adaptation in the RISC-V ecosystem, offering both academic value and practical potential.

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

屈晟,苏运强,林哲远,燕言言,冯洋,赵琛.面向RISC-V指令集多样性的兼容性感知多层级构建方法.软件学报,2026,37(6):2346-2369

复制
相关视频

分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2025-09-08
  • 最后修改日期:2025-10-20
  • 录用日期:
  • 在线发布日期: 2025-12-26
  • 出版日期: 2026-06-06
文章二维码
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号