• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2024, Vol. 46 ›› Issue (05): 785-793.

• 高性能计算 • 上一篇    下一篇

基于蜂鸟E203的多级动态分支预测器

魏一1,杨智杰2,铁俊波1,石伟1,周理1,王耀1,王蕾2,徐炜遐1   

  1. (1.国防科技大学计算机学院,湖南 长沙 410073;2.军事科学院国防科技创新研究院,北京 100091)
  • 收稿日期:2023-09-12 修回日期:2023-10-23 接受日期:2024-05-25 出版日期:2024-05-25 发布日期:2024-05-30
  • 基金资助:
    国家自然科学基金(62032001);科技部科技创新2030课题(编号2020AAA0104602)

A multistage  dynamic  branch  predictor  based  on  Hummingbird E203

WEI Yi1,YANG Zhi-jie2,TIE Jun-bo1,SHI Wei1,ZHOU Li1,WANG Yao1,WANG Lei2,XU Wei-xia1   

  1. (1.College of Computer Science and Technology,National University of Defense Technology,Changsha 410073;
    2.Defense Innovation Institute,AMS,Beijing 100091,China)
  • Received:2023-09-12 Revised:2023-10-23 Accepted:2024-05-25 Online:2024-05-25 Published:2024-05-30

摘要: 近年来,以蜂鸟E203为代表的开源RISC-V微处理器由于功耗低、性能好等优势,受到了学术界和工业界的广泛关注和应用。为提高微处理器性能,降低分支指令造成的流水线停顿,指令分支预测技术成为现代微处理器中广泛应用的重要技术之一。然而,蜂鸟E203现采用的分支预测器是轻量级的静态分支预测器,面临分支预测准确率较低的挑战。由于使用预测准确率较高的动态分支预测器,可以进一步降低由于预测错误导致的重定向取指所产生的开销,因此,针对上述挑战,在原微架构的基础上探索了多种动态分支预测器的实现,提高了分支预测精度并且兼顾了资源开销。实验结果表明,多种动态分支预测器中获得最优结果的是使用静态分支预测结合基于分支历史寄存器BHR的自适应动态分支预测器,在Dhrystone基准测试程序上其分支预测精度可从原来的84.6%最高提升至94.8%,分数从原来的1.296 463提高到1.314 418,在Coremark基准测试程序上其分支预测精度可从原来的67%提升至78.7%,分数从原来的2.120 000提升至2.138 008。

关键词: 动态分支预测, 蜂鸟E203, RISC-V, 流水线, 微架构

Abstract: In recent years, open-source RISC-V microprocessors represented by Hummingbird E203 have received widespread attention and application in both academia and industry due to their low power consumption and good performance. To improve the performance of microprocessors and reduce pipeline stalls caused by branch instructions, branch prediction technology has become one of the important techniques widely used in modern microprocessors. However, the branch predictor currently used in the Hummingbird E203 is a lightweight static branch predictor, facing the challenge of low branch prediction accuracy. Since using a dynamic branch predictor with higher prediction accuracy can further reduce the overhead caused by mispredictions leading to redirecting fetching, various implementations of dynamic branch predictors have been explored based on the original microarchitecture to improve branch prediction accuracy while considering resource overhead. Experimental results show that among various dynamic branch predictors, the one achieving the best results is the adaptive dynamic branch predictor combining static branch prediction with Branch History Register (BHR). On the Dhrystone benchmark program, its branch prediction accuracy can be increased from the original 84.6% to 94.8%, and the score from 1.296 463 to 1.314 418. On the Coremark benchmark program, its branch prediction accuracy can be increased from the original 67% to 78.7%, and the score from 2.120 000   to 2.138 008.

Key words: dynamic branch prediction, Hummingbird E203, RISC-V, pipeline, microarchitecture