Skip to content

Describe simulation of BP and BTB pipelines #997

Open
pavelkryukov opened this issue May 2, 2019 · 18 comments
Open

Describe simulation of BP and BTB pipelines #997

pavelkryukov opened this issue May 2, 2019 · 18 comments
Labels
3 Features of medium complexity or infrastructure enhancements documentations Adds a new manual to Wiki. S1 — Branch prediction To solve the issue, you need knowledge about branch prediction

Comments

@pavelkryukov
Copy link
Member

We have a detailed description of BPU model, but it does not cover interaction with pipeline and process of flush.

New manual should answer these questions:

  1. What are the 3 branch types?
  2. What prediction should be made for the each of branch type?
  3. What are the stages where prediction may be verified?
  4. What is performed on branch misprediction?
  5. What signals are distributed between stages to maintain the behavior?
@pavelkryukov pavelkryukov added documentations Adds a new manual to Wiki. 4 Features of medium complexity which usually require infrastructure enhancements. S1 — Branch prediction To solve the issue, you need knowledge about branch prediction 3 Features of medium complexity or infrastructure enhancements and removed 4 Features of medium complexity which usually require infrastructure enhancements. labels May 2, 2019
@beanefit beanefit self-assigned this May 5, 2019
@pavelkryukov
Copy link
Member Author

@beanefit Disclaimer: you have 10 points already in this term. Any additional work will not affect your your course result (however, in the contribution score table all the points will be mentioned) .

@beanefit
Copy link
Contributor

beanefit commented May 5, 2019

@beanefit Disclaimer: you have 10 points already in this term. Any additional work will not affect your your course result (however, in the contribution score table all the points will be mentioned) .

Thank you for the disclaimer. I just want to try myself in explaining some things to others, that's why I've assigned this issue.

@beanefit
Copy link
Contributor

beanefit commented May 6, 2019

I've attempted to explain some basics of this simulation. Here it is.

@pavelkryukov
Copy link
Member Author

Your manual requires a lot of pictures,

@pavelkryukov
Copy link
Member Author

@pavelkryukov
Copy link
Member Author

pavelkryukov commented May 6, 2019

  1. Have you read this: https://github.com/MIPT-ILab/mipt-mips/wiki/How-to-write-Wiki-manuals ?
  2. It's very hard to read about all 3 types of branchex mixed. Can we process type by type?
    • Each section for each branch should start with the topology — 5 stages and wires used.
    • Then you put examples for each case: correct prediction, incorrect prediction etc.
  3. What do these pentagons mean?
  4. What should I understand from that picture? https://github.com/MIPT-ILab/mipt-mips/wiki/Interaction-between-BPU-and-pipeline-pictures/pic_1.png
  5. You should not copy-paste C++ code — if we wanted to read C++ code, we would go to the repository. You should explain what it does and, more imporantly, why it does it.
  6. Introduction section does not introduce to anywhere — it just says that BPU is a BPU. There is no logical connection to the next paragraph!
  7. https://github.com/MIPT-ILab/mipt-mips/wiki/Interaction-between-BPU-and-pipeline#fetch-stage — why should I know all that information? Shall it be actual if we add one more source of target?

@beanefit
Copy link
Contributor

beanefit commented May 7, 2019

I've begun refactoring. Will finish this evening. Could you please have a quick look at it just to notice some general mistakes?

@pavelkryukov
Copy link
Member Author

I've begun refactoring. Will finish this evening.

Please do not rush — write permission won't disappear after the deadline.

@beanefit
Copy link
Contributor

beanefit commented May 7, 2019

I've begun refactoring. Will finish this evening.

Please do not rush — write permission won't disappear after the deadline.

No, I mean I'll continue working on it this evening.

@pavelkryukov
Copy link
Member Author

See my comments inlined on the Wiki page:
https://github.com/MIPT-ILab/mipt-mips/wiki/Branch-prediction-pipelines

I suggest to stop writing the manual now. Please provide the structure of your story instead — the lack of the skeleton would make refactoring infinite.

@beanefit
Copy link
Contributor

beanefit commented May 7, 2019

I've attempted to shortly introduce my view of structure. Pictures and formatting are ignored for now.

@pavelkryukov
Copy link
Member Author

Pipeline modeling

That should actually be an introduction.
I advise to put a simple picture for these three stages without any branch prediction data, like it is in our slides: fetch (and multiplexer between PC + 4 and target), decode (mentioning that it is reads target from branch encoding) and execution.

Then I suggest to write about branches performance problem — that you have to multiplex on Fetch, but control signal is ready only on late stages.

Then branch prediction is naturally introduced, we explain here why we need it. Why we need a direction prediction? Why we need a target prediction?

I've chosen the idea of deductive method of explanation, i.e., I'll describe pipeline from tail to head. In my opinion, this will be clearer for readers.

Please no. You need to have Tarantino's talent to shoot Pulp Fiction.

I advise to start with indirect jumps. They are the simplest — predict target, calculate target, check target.

Then should go direct jumps — predict target, decode target, check target.

Then should go branches — predict direction, predict target (if branch is predicted taken), check target (if branch is predicted taken), calculate direction, check direction.

@beanefit
Copy link
Contributor

Hello. I didn't forget about this task. I just want to take a several days break, because I have some stuff to complete till the end of this term.

@pavelkryukov
Copy link
Member Author

Sure.

Just a reminder — you wanted to clean up that code:

/* sending valid PC to fetch stage */
if ( !from_stall)
{
wp_flush_target->write( instr.get_actual_decoded_target(), cycle);
sout << "\nmisprediction on ";
}

@pavelkryukov
Copy link
Member Author

@beanefit The manual is still actual for us. Could you please spend some time to complete it?

@beanefit
Copy link
Contributor

@beanefit The manual is still actual for us. Could you please spend some time to complete it?

Hello, just saw this reply and it reminded me of this manual. Sorry for inconveniences, will refresh the work soon

@pavelkryukov
Copy link
Member Author

Should we expect this or it's better to put it back to the pool of tasks?

@beanefit
Copy link
Contributor

beanefit commented Dec 5, 2019

Should we expect this or it's better to put it back to the pool of tasks?

If there is someone who wants to take this task, then it's ok to put it back to the pool. Nevertheless, I will have much more time in the end of January. That was awkward, sorry :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3 Features of medium complexity or infrastructure enhancements documentations Adds a new manual to Wiki. S1 — Branch prediction To solve the issue, you need knowledge about branch prediction
Projects
None yet
Development

No branches or pull requests

2 participants