自学内容网 自学内容网

ITTAGE 分支预测算法

ITTAGE, Indirect Target TAgged GEometric length predictor

专门用来处理间接跳转分支指令的地址预测,其基本原理和TAGE predictor相同;

ITTAGE predictor principles

其基本原理同TAGE, 预测器通过GHR和PC值,进行相关运算,来索引相应的entry, 从而拿到预测的branch address;

                

如上图,基本原理同TAGE,只是内部的entry,做了一些处理:

  • Target: 预测的,这条间接跳转指令的跳转地址;
  • Tag: 索引到对应的entry后,还要看tag是否能对应上,这个和TAGE是一样的;
  • Ctr: confidence counter;
  • U: useful;

Prediction computation

  • We remarked that when the confidence counter of the matching entry is null, on some traces, the alternate prediction altpred is sometimes more accurate than the "normal" prediction. 
  • This property is global to the application and can be dynamically monitored through a single 4-bit counter (USE_ALT_ON_NA in the simulator). On the distributed benchmark set, this optimization reduces the misprediction number by 2%.
  • Therefore the prediction computation algorithm is as follows:
    • Find the longest matching component and the alternate component;
    • if (the condence counter is non-null or USE ALT ON NAisnegative) then the provider component provides the prediction else the pre diction is provided by the alternate component

Updating the ITTAGE predictor

  • 当预测正确时,将ctr字段加1, 表示信心增强;
  • 当预测错误时:
    • 首先更新provider component entry;
      • 如果ctr非空,则-1;
      • 如果confidence counter为空,则替代target字段为该branch真正的地址;
    • second:
      • 如果provider component不是最长的(i<M),分配多个比i更长的Tk (i<k<M);
      • 由于预测器大小存储预算非常巨大,因此我们最多分配 3 个这样的条目。
      • 对于较小的预测器,人们可以尝试通过分配单个预测器条目来限制应用程序在预测器上的占用空间。
      • 读取 Tj 的uj 有用位,i < j < M。分配算法最多选择四个有用位为空的条目,此外,我们保证这些条目不会分配在连续的表中。
      • 在已分配的条目上,置信度计数器设置为弱,有用位设置为空。
    • 更新useful bit:
      • 每当实际预测正确而替代预测 altpred 不正确时,就会set provider component的有用位 u。
      • 为了避免有用的位永远保持设置状态,我们实施了以下重置策略:
        • 在分配新条目时,我们会在预测错误后尝试分配新条目时动态监控成功和失败的次数;
        • 此监控通过单个 8bit计数器(u=1,递增,u=0 递减)执行。
        • 当更新时遇到的失败次数多于成功次数时,此计数器(模拟器中的变量 TICK)会饱和。那时我们会重置预测器的所有 u 位。
        • 通常,当预测器使用部分的条目平均有一半被设置为有用时,就会发生这种全局重置。
        • 这种简单的策略被发现比之前提出的 TAGE 预测器有用计数器的管理更有效;

一些优化

  • 使用GHR和short path history, 比只是用GHR,更有效;
  • 利用跳转target一般比较密集的特性,将target字段,拆成region pointer和region offset, 可以节约7bit空间;
  • 由于在一些application中,某些table的压力特别大,有些则很小,通过share storage space among tables,可以避免实现真正的多端口table;

原文地址:https://blog.csdn.net/zhangshangjie1/article/details/142817821

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!