首页|基于QEMU的RISC-V程序性能分析

基于QEMU的RISC-V程序性能分析

扫码查看
开源指令集规范RISC-V具有模块化、高可定制的特点,可根据特定应用或需求定制指令集,从而优化性能、节约能耗,提高芯片的应用适配性.为了分析目标场景的需求以优化指令集设计,往往需要基于模拟器深入分析目标应用的特点.为此,本文面向RISC-V,提出了一种基于QEMU模拟器的程序性能分析技术,以动态二进制插桩的方式收集程序的运行信息,并结合调试信息进行基本块级和函数级的热点标注.相比于传统的性能分析技术(如Gprof等),本技术具有以下优势:一是不受硬件平台和操作系统的限制,适用于早期的指令集设计阶段;二是考虑了模拟器与真实芯片之间执行指令的差异,引入指令预估代价模型对结果进行修正.此外,本文提出的性能分析技术也可用于指导程序性能优化以及编译优化等.
RISC-V Program Profiling with QEMU
The open-source instruction set specification RISC-V has modular and highly customizable features,which ena-bles customized instruction sets to be designed according to specific applications or requirements,thereby optimizing perform-ance,saving energy consumption and improving the application adaptability of chips.In order to analyze the requirements of the target scenario and optimize the instruction set design,it is often necessary to analyze the characteristics of the target application in depth based on a simulator.In light of this,the current study proposes a program profiling technique based on the QEMU simu-lator for RISC-V,which collects the program's running information dynamically by binary instrumentation,and combines it with debugging information to mark hotspots at the basic block and function levels.Compared with traditional profiling techniques such as GProf,this technique has the following advantages:firstly,it is independent of hardware platform and operating system,and suitable for the early stage of instruction set design;secondly,it considers the difference between the execution of instructions on the simulator and the real chip,and introduces an instruction estimation cost model to correct the results.In addition,the per-formance analysis technique proposed in this study can also be used to guide program performance optimization and compilation optimization,etc.

Program profilingRISC-VQEMU

秦宵宵、徐学政、杨德亨、崔焱旭、王涛

展开 >

军事科学院国防科技创新研究院,北京 100071

性能分析 RISC-V QEMU

2024

智能安全
军事科学院国防科技创新研究院

智能安全

ISSN:2097-2075
年,卷(期):2024.3(1)
  • 18