Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic implement for estride value predictor #201

Open
wants to merge 6 commits into
base: xs-dev
Choose a base branch
from

Conversation

zybzzz
Copy link
Contributor

@zybzzz zybzzz commented Nov 7, 2024

related roadmap: #188

This PR is solely intended to track code related to value prediction and does not currently need to be merged into xs-dev.

Implemented features in the current code:

  1. Modified the o3 CPU architecture to support value prediction.
  2. Designed a basic interface for the value predictor and implemented a simple Estride value predictor.
  3. Configured related parameters for Estride, including the number of bits saved for stride and the size of the inflight window, allowing for basic design space exploration.

Known issues:

  1. The current Estride update strategy is still very basic. A new update strategy based on instruction execution time is needed, aligning with the original Estride design.
  2. when entry size <= 16 will raising fault.

spec benchmark scoring is still ongoing.

This flag may later be used by the value predictor

Change-Id: Ib15eaf4cb488b4458ace63a336cd4a761807dc88
Change-Id: I4a7d33e6c46503d9a08e0ec678e08665ce7f04d8
Change-Id: I8b3ca27605e921edaaea779a1f0ff32462d4a62d
@@ -1251,6 +1251,10 @@ CPU::instDone(ThreadID tid, const DynInstPtr &inst)
thread[tid]->threadStats.numInsts++;
cpuStats.committedInsts[tid]++;

if (thread[tid]->numInst % 10000 == 0) {
fprintf(stderr, "commit %lu insts\n", thread[tid]->numInst);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We always prefer DPRINTF rather than fprintf in GEM5

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed the problem with this part of the code and I'll start running the scores after I get issue1 finished.

for (size_t i = 0; i < indexEachWays.size(); i++) {
indexEachWays[i] = pcHashToWayIndex(esPredMetaData->pc, i);
indexMarker += std::to_string(indexEachWays[i]);
indexMarker += " ";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how such string operation affect performance. If performance is degraded, I suggest to put strong operations into if block like if (debug::xxx) {indexMarker =

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed the problem with this part of the code and I'll start running the scores after I get issue1 finished.

@shinezyy
Copy link
Contributor

shinezyy commented Nov 8, 2024

  • Did you provide some method to turn off the value predictor?
  • If possible, you can provide a preliminary result.

@zybzzz
Copy link
Contributor Author

zybzzz commented Nov 8, 2024

  • Did you provide some method to turn off the value predictor?
  • If possible, you can provide a preliminary result.

I don't have a way to turn off the value predictor yet, the only way to turn off the value predictor right now is to checkout to xs-dev and turn off the value predictor by changing the branch to cancel the value predictor related changes.

I think eventually I'll implement turning off the value predictor in code.

Change-Id: Ice141526e5a67c61149cb95b42e289c3d0b6eae8
also fixed the value predictor's handling of fault.

Change-Id: I288b6fd358f67ff1e381bbe46b03a64775597bf4
Change-Id: I9384405f20f999c0baaeaca458429c48a420eb6d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants