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
Posted (May 11, 2013, 12:04 a.m.)
Hi Taylor, It looks quite good and is very well documented. Thanks! There are a couple of gem5 style things that we need to correct. If you want to take care of them that is great, if not whomever commits the code can do it. I've commented on an instance of these below. Thanks again, Ali
-
src/cpu/pred/global.cc (Diff revision 1) -
please put authors on a separate line
-
src/cpu/pred/global.cc (Diff revision 1) -
please put the type on a separate line from the method name.
-
src/cpu/pred/global.cc (Diff revision 1) -
the indenting here should be fixed
-
src/cpu/pred/global.cc (Diff revision 1) -
please put a space between if and (taken)
Posted (May 15, 2013, 9:29 p.m.)
Looks like a very useful patch. I think it just needs the predictor size redundancy removed.
-
src/cpu/pred/global.cc (Diff revision 1) -
It looks like 2^globalHistoryBits = globalPredictorSize. Since globalHistoryBits was recently removed from the tournament predictor, it might be better to remove it as a parameter here as well and determine it from globalPredictorSize. Alternatively, the relationship between the two parameters must be enforced to avoid seg faults.
-
src/cpu/pred/global.cc (Diff revision 1) -
This could walk off the array (see above comment).
-
src/cpu/pred/global.cc (Diff revision 1) -
These updates can also walk off the array (see above).
Posted (July 15, 2013, 7:06 a.m.)
Taylor, Do you think it could spend a few minutes addressing the issues in these reviews? It would be great to get this committed. Thanks, Ali
Posted (July 15, 2013, 7:07 a.m.)
Taylor, Do you think it could spend a few minutes addressing the issues in these reviews? It would be great to get this committed. Thanks, Ali
Posted (July 15, 2013, 7:07 a.m.)
Taylor, Do you think it could spend a few minutes addressing the issues in these reviews? It would be great to get this committed. Thanks, Ali
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) |
|---|
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")
