Review Board 2.0.15


Add Global-Global (gAG) branch predictor

Review Request #1865 - Created May 10, 2013 and updated

Information
Taylor Lloyd
gem5
Reviewers
Default
This patch adds a global-global (gAG) branch predictor, used by specifying the "global" predType.
From BranchPredictor, it uses the following variables for configuration: 
 - globalPredictorSize
 - globalCtrBits
 - globalHistoryBits

As such, it may conflict with the ongoing effort to factor out the redundant variable in the predictors.
Prior to submission, this was tested by building build/ARM/gem5.debug, and run against a subset of the SPEC CPU2006 benchmarks. Statistics generated seem valid, and it caused no execution errors.

Issue Summary

19 12 7 0
Description From Last Updated Status
Is this right? Andreas Hansson July 15, 2013, 2:16 p.m. Open
Pardon me for asking something that perhaps is very obvious, but why do we use a void* and not something ... Andreas Hansson July 15, 2013, 2:16 p.m. Open
Same as above Andreas Hansson July 15, 2013, 2:16 p.m. Open
base/intmath has log2 if that helps... Andreas Hansson July 15, 2013, 2:16 p.m. Open
Why not just globalCtrs(globalPredictorSize) in the initialization list? Andreas Hansson July 15, 2013, 2:16 p.m. Open
Whitespace Andreas Hansson July 15, 2013, 2:16 p.m. Open
Whitespace Andreas Hansson July 15, 2013, 2:16 p.m. Open
A comment here elaborating on when/where this is deleted would be fantastic Andreas Hansson July 15, 2013, 2:16 p.m. Open
Same as above. A comment on when/where it's deleted would be great Andreas Hansson July 15, 2013, 2:16 p.m. Open
if _space_ ( Also whitespace at end of line Andreas Hansson July 15, 2013, 2:16 p.m. Open
NULL please :-) Andreas Hansson July 15, 2013, 2:16 p.m. Open
Whitespace Andreas Hansson July 15, 2013, 2:16 p.m. Open
Review request changed
Updated (July 15, 2013, 11:34 a.m.)

Change Summary:

Resolved all issues raised to date. 
    - Reformatted source to match guidelines
    - No longer respects globalHistoryBits, but rather calculates them from globalPredictorSize

Diff:

Revision 2 (+295 -1)

Show changes

Posted (July 15, 2013, 2:17 p.m.)



  
src/cpu/pred/global.hh (Diff revision 2)
 
 
Is this right?
src/cpu/pred/global.hh (Diff revision 2)
 
 
Pardon me for asking something that perhaps is very obvious, but why do we use a void* and not something more...useful?

src/cpu/pred/global.cc (Diff revision 2)
 
 
Same as above
src/cpu/pred/global.cc (Diff revision 2)
 
 
base/intmath has log2 if that helps...
src/cpu/pred/global.cc (Diff revision 2)
 
 
Why not just globalCtrs(globalPredictorSize) in the initialization list?
src/cpu/pred/global.cc (Diff revision 2)
 
 
Whitespace
src/cpu/pred/global.cc (Diff revision 2)
 
 
Whitespace
src/cpu/pred/global.cc (Diff revision 2)
 
 
A comment here elaborating on when/where this is deleted would be fantastic
src/cpu/pred/global.cc (Diff revision 2)
 
 
Same as above. A comment on when/where it's deleted would be great
src/cpu/pred/global.cc (Diff revision 2)
 
 
if _space_ (

Also whitespace at end of line
src/cpu/pred/global.cc (Diff revision 2)
 
 
NULL please :-)
src/cpu/pred/global.cc (Diff revision 2)
 
 
Whitespace
Thanks a million for the changes. It would be great if the last little bit of formatting can be fixed up, and then I'd say it's all ready to go.
Posted (July 16, 2013, 2:12 a.m.)
There are some utility functions that would make this code slightly more readable. I'm just comparing to tournament.cc

Otherwise, I think it's good.
src/cpu/pred/global.cc (Diff revisions 1 - 2)
 
 
It might be easier to do globalHistoryBits=ceilLog2(globalPredictorSize);
src/cpu/pred/global.cc (Diff revision 1)
 
 
could do globalHistoryMask = mask(globalHistoryBits); (will need to include "base/bitfield.hh")