RISC-V Porting Wiki
  • RVPortingTools
  • RVSmartPorting
  • 简体中文
  • English (US)
View on Gitee
  • RVPortingTools
  • RVSmartPorting
  • 简体中文
  • English (US)
View on Gitee
  • Welcome
    • Contributing Guideline
  • Introduction
    • Memory Consistency Model of RISC-V
    • Difference between RV Dev Boards
    • Modules of RISC-V ISA
  • Common Adjustment
    • Check Whether Project is Ready for Multi-arch
    • File Structure Adjustment
    • Directory Structure Adjustment
    • Testcase Adjustment
  • C/C++ Program
    • Inline ASM
    • Macro Definition and Directive
    • Hex Constant
    • Intrinsic Function
    • Function Multiversioning
  • Configuration File
    • rpmbuild
    • Makefile
    • CMake
    • Autoconf
    • QMake
    • Others
  • Other Programming Language
    • Rust
    • Go
    • Python
    • Others

Common Adjustment

The ultimate goal of this guideline is to help Porting rather than just Migrating software to the RISC-V architecture. Therefore, changes made by developers to the source code of software should be incremental and adaptable.

Ideally, the source code of a software that fully adapted RISC-V architecture should meet the following requirements.

  1. The source code of the software can be compiled and run properly with the RISC-V architecture as the target platform
  2. The software remains consistent on features with the original architecture in the RISC-V architecture
  3. The same source code can be compiled and run without additional modifications when the original supported architecture(s) is set as the target platform.

Tips

Note: When only the first two points are met, we say that the software has been successfully ported to a RISC-V hardware architecture platform.

Project Resturcting

In order to meet the above requirements, the project structure needs to be adapted to support different hardware architectures under the same version of source code before formally starting to modify the source code.

Project restructuring can be divided into the following steps.

  • Is Project Ready for Multi Arch: Mainly refers to checking whether the project is ready for multi-arch.
  • File Structure Adjustment: It mainly refers to writing the architecture-related parts of the software source code in separate files according to the target architecture.
  • Directory Structure Adjustment: Mainly means to store the architecture-related parts of the software source code in different folders according to the target architecture.
  • Testcase adjustment: Mainly refers to modifying or masking the architecture-related testcases in the software source code according to the specific situation.
Edit this page
Last Updated:
Contributors: LightningRS
Prev
Introduction
Next
C/C++ Program

This knowledge base is licensed under a Mulan OWL BY-SA v1.0

Copyright © 2025 RVSmartPorting. | 京ICP备20005262号 | beian京公网安备11010802043677号