cpu: remove local/globalHistoryBits params from branch pred
Review Request #1827 - Created April 17, 2013 and submitted
| Information | |
|---|---|
| Tony Gutierrez | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 9644:decb4c9e987a --------------------------- cpu: remove local/globalHistoryBits params from branch pred having separate params for the local/globalHistoryBits and the local/globalPredictorSize can lead to inconsistencies if they are not carefully set. this patch dervies the number of bits necessary to index into the local/global predictors based on their size. the value of the localHistoryTableSize for the ARM O3 CPU has been increased to 1024 from 64, which is more accurate for an A15 based on some correlation against A15 hardware.
-
src/cpu/pred/tournament.cc (Diff revision 1) -
Can't you just use ceilLog2() from src/base/intmath.hh?
-
src/cpu/pred/tournament.cc (Diff revision 1) -
same here
Description: |
|
||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+20 -12) |
seems good to me.
Ship It!
Overall it looks good, with only some minor things. The only thing I'd like you to change is the keyword. If the list (http://gem5.org/Commit_Access) needs additional items we should kick off a discussion. "The keyword should be one of the following: base, stats, sim, config, ruby, mem, arm, x86, arch, cpu, dev, scons, alpha, mips, power, sparc"
-
src/cpu/pred/tournament.cc (Diff revision 2) -
I would suggest to move the ceilLog2 intialisation here. If not, please initialise them to 0 here to not upset static code analysers :-)
-
src/cpu/pred/tournament.cc (Diff revision 2) -
Remove the commented out line and preferably move the initialisation to the initialiser list
Summary: |
|
|||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+12 -12) |
Ship It!
I'm not sure about either of these changes. See comments. What inconsistencies do you have in mind? I think I was the last one to dig into this bit of code, so if anything is wrong, it's probably my fault. The one confusing thing about the branch predictor is that the tournament and the local use a partially overlapping set of parameters. ATM (i.e. before this patch), localPredictorSize can be defined in the configuration because it's relevant to the local predictor, but it has no effect on the tournament predictor.
-
src/cpu/pred/tournament.cc (Diff revision 3) -
2^localHistoryBits=localPredictorSize, so this is just a cosmetic change. When I set it up so that localHistoryBits was the input to the class, it was because I thought the user would be more interested in setting how many bits of history they want, rather than setting the number of counters and having gem5 calculate the required number of history bits. This also preempts the user from setting a non-power-of-2 predictor size. But if making the predictor size the input and determining the number of history bits from that makes sense to everyone else, so be it.
-
src/cpu/pred/tournament.cc (Diff revision 3) -
This change will cause problems. globalHistoryBits sets the number of bits of global branch history kept. This number is independent from globalPredictorSize, because both the global and the choice predictor use the global history buffer. There is a test further down (~ line 115) to ensure that the globalHistoryBits is large enough, given choicePredictorSize and globalPredictorSize. Alternatively, globalHistoryBits should be max(ceilLog2(globalPredictorSize), ceilLog2(choicePredictorSize)). tournament.hh has lots of comments on what all of these variables do.
Summary: |
|
||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 4 (+16 -12) |
Are they anymore concerns/objections to this?
