Next: , Previous: Hybrid Branch Predictor, Up: Path Predictor


4.2 Profiled Hybrid Branch Predictor

The profiled hybrid branch predictor uses information collected from an earlier run to determine, for each branch, whether to use a bimodal or gshare predictor to make a prediction. (In hindsight this is a really bad idea. The code might be changed to a more elaborate predictor that relies on profile-collected data.)

To use the profiled hybrid a profiling run must first be performed using hybrid-pro-write as the branch predictor and with trace mode on. During this run the performance of bimodal and gshare predictors on each branch will be collected and written to the profile file. On a subsequent run using hybrid-pro the profile file will be read and the better predictor, called the choice, for each branch will be determined. The choices (along with the counters for the bimodal predictor) are stored in the BAC entry. For each branch the chosen predictor is used, and only that predictor is updated. It is assumed that the choice is stashed in or near the branch and so it is always available when making a prediction.

The GHR and PHT sizes are set using bp_size_lg. The choice table entries are kept with other block information, so choice table size is effectively controlled by mbp_bac_lg. See Path Predictor RTIs. Profile files will be placed in a directory named bp-hybrid-pro. See Profiling for more about profile naming and placement.

The following RTI settings might be used for a profiling run (to collect data).

     bp_method hybrid-pro-write
     trace_mode 1
     bp_size_lg 18
     mbp_bac_lg 17

In the settings above the GHR and BAC tables were set to large values because the profile code looks at gshare and bimodal predictors up to the size specified. Information on all sizes are written to the profile.

With the RTI settings below profiled hybrid will be used. Note that the GHR length is 16, the profile file has results for GHR lengths 1 to 18, the simulator will look at data for 16.

     bp_method hybrid-pro
     trace_mode 0
     bp_size_lg 16
     mbp_bac_lg 15