[PTLsim-devel] Is a perfect branch predictor possible?
Matt T. Yourst
Fri Nov 2 02:51:29 EDT 2007
On Wednesday 31 October 2007 19:19, Krist Sun wrote:
> Hi Matt,
> I am working on a PTLsim LSQ project and the simulation result is very
> frustrating. I believe the branch predictor mistakenly flushed the pipeline
> too often. So I am looking for a way to tackle this issue. Is it possible
> to use a perfect branch predictor in PTLsim?
>
Since PTLsim is an execution simulator, the outcome of a branch is not known
until it's actually executed in the ALU stage, just like a real processor.
There's no easy way to model perfect branch prediction in this design.
If you really need this feature, you could probably write all branch outcomes
passing through the commit stage into a file, then run the simulation again,
but replace the fetch stage's predictions with the branch directions recorded
in that file. It won't be perfect, and it may get out of alignment if you
modify the microarchitecture after doing this. Also remember that things like
load/store aliasing can cause uops to be refetched; the recorded branch
predictions have no way to account for this.
- Matt
-------------------------------------------------------
Matt T. Yourst yourst at peptidal.com
Peptidal Research Inc., Co-Founder and Lead Architect
-------------------------------------------------------
More information about the PTLsim-devel mailing list