Korey,

On 04/19/2010 04:31 PM, Korey Sewell wrote:


On Fri, Apr 16, 2010 at 1:51 PM, Maximilien Breughe <[email protected] <mailto:[email protected]>> wrote:

    Yes, you are right, it's indeed not a general solution..
    We might be able to solve it by adding an extra variable to
    inorder_dyninst. Just a flag that let us check if the branch is
    allready resolved.
    What do you think?

A "isPredicted" flag does seem like it will be necessary.

So on a branch squash, we need to check:
1. If the instruction is a branch (isControl()) and if has been resolved (isPredicted?) -> update prediction 2. If the instruction is a branch (isControl()) and if has been predicted(isExecuted()?) -> update prediction/target
I have some concerns here:
We should introduce an isResolved-flag or use the isExecuted-flag. Both will probably always (in the case of a branch instruction) contain the same information.
Then I would do the following:

1. Branch prediction: If the instruction is a branch (isControl()) and it hasn't been resolved yet (!isResolved) -> do nothing 2. Branch resolution: If the instruction is a branch (isControl()) and it has been resolved (isResolved) -> update prediction/target table

We don't need an isPredicted-flag because we don't have to do anything in the squash-function during prediction time.
The PC already gets updated outside the squash function.
3. If the squash is coming from a non-branch instruction (due to fault or context switch), then -> update/clear(?) prediction
Do we need to update/clear ecause the branch table would get a false-update if something goes wrong? I don't know exactly what happens when a context switch occurs. Do all instructions currently in the pipeline finish? Because if they do, the branch predictor gets updated and we don't need to do anything.

And to that, hopefully the squashing function has an argument for the DynInstPtr object or we will have to give it one.

I verified it and we do have a DynInstPtr argument in the BranchPredictor::squash function ;-)



Max
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to