Skip to content

Extract BranchMispredictDetection unit out of Mem module to a separate module #724

Closed
pavelkryukov opened this issue Nov 27, 2018 · 2 comments
Assignees
Labels
3 Features of medium complexity or infrastructure enhancements code Enhances infrastructure or refines, Requires almost no knowledge in CPU microarchitecture. S1 — Branch prediction To solve the issue, you need knowledge about branch prediction

Comments

@pavelkryukov
Copy link
Member

Currently Mem module handles two operations:

  1. Loads and stores to/from data memory
  2. Branch conditions check.

Actually mem should check only the first one, while the second one should be handled in a separate module.

@pavelkryukov pavelkryukov added code Enhances infrastructure or refines, Requires almost no knowledge in CPU microarchitecture. 3 Features of medium complexity or infrastructure enhancements S1 — Branch prediction To solve the issue, you need knowledge about branch prediction labels Nov 27, 2018
@vodogrey2012 vodogrey2012 self-assigned this Nov 28, 2018
@pavelkryukov pavelkryukov changed the title Extract BrandMispredictDetection unit out of Mem module to a separate module Extract BranchMispredictDetection unit out of Mem module to a separate module Nov 28, 2018
@vodogrey2012
Copy link
Contributor

Hello. I am going to try to solve this issue at the closest weekend. But now I have any common questions:

  1. As I understand, I need to create new method. It means, I need to make new header file, wich contains one function branch_predictor and its cpp-file with realisation?
  2. This header must be uncluded in mem module and brunc_predictor must be called in clock function, is it?
  3. How can I test this modul?
    Thank you.

@pavelkryukov
Copy link
Member Author

As I understand, I need to create new method.

No, it should be a separate class. Currently we have 6 modules located in simulator/modules:

  • core (includes other modules)
  • fetch
  • decode
  • execute
  • mem
  • writeback

The new module should be the 7th one. I advise you to start with copying Mem module and removing everything unrelated.

This header must be uncluded in mem module and brunc_predictor must be called in clock function, is it?

As the module is same-rank as mem, it should be called from core module clock:

template<typename ISA>
void PerfSim<ISA>::clock_tree( Cycle cycle)
{
writeback.clock( cycle);
fetch.clock( cycle);
decode.clock( cycle);
execute.clock( cycle);
mem.clock( cycle);
}

How can I test this modul?

Run your bubble sort trace, for instance — it should demonstrate performance about 0.6 IPC if everything is correct. Additionally, you may create unit tests, but that's tricky with ports at the moment.

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 code Enhances infrastructure or refines, Requires almost no knowledge in CPU microarchitecture. S1 — Branch prediction To solve the issue, you need knowledge about branch prediction
Projects
None yet
Development

No branches or pull requests

2 participants