Skip to content

Conversation

@jensen-yan
Copy link
Collaborator

  • Fix non-decoupled fetch path in O3:

    • Always call lookupAndUpdateNextPC() to update next_pc and run the predictor in both modes. This replaces the pc.branching() shortcut that left next_pc stale with non-decoupled BPs.
    • For non-decoupled frontend, issue a new I-cache request when the current PC falls outside the fetch buffer window or the buffer is invalid. Keep the FTQ-based path unchanged for decoupled frontends.
  • Instantiate non-decoupled BP classes in configs:

    • configs/example/xiangshan.py, configs/example/fs.py: use bpClass = ObjectList.bp_list.get(...); branchPred = bpClass() instead of assigning the class object directly. Before this change:
  • TournamentBP/LocalBP failed under Xiangshan: difftest PC mismatch at start and eventual commit stall (>40k cycles). Fetch logs showed PC repeatedly outside [startPC, startPC+fetchBufferSize) without issuing new I-cache requests.

  • Also hit TypeError when branchPred was set to the class object. After this change:

  • Non-decoupled BPs (TournamentBP, LocalBP, TAGE, etc.) run correctly with Xiangshan configs; decoupled predictors remain unaffected.

Change-Id: I808f3ed6301a3104a46a32e4848f5d56791d7511

- Fix non-decoupled fetch path in O3:
    - Always call lookupAndUpdateNextPC() to update next_pc and run the
      predictor in both modes. This replaces the pc.branching() shortcut  that left next_pc stale with non-decoupled BPs.
    - For non-decoupled frontend, issue a new I-cache request when the
      current PC falls outside the fetch buffer window or the buffer is
 invalid. Keep the FTQ-based path unchanged for decoupled frontends.

- Instantiate non-decoupled BP classes in configs:
    - configs/example/xiangshan.py, configs/example/fs.py:
      use bpClass = ObjectList.bp_list.get(...); branchPred = bpClass()
      instead of assigning the class object directly.
Before this change:
- TournamentBP/LocalBP failed under Xiangshan: difftest PC mismatch at
  start and eventual commit stall (>40k cycles). Fetch logs showed PC
  repeatedly outside [startPC, startPC+fetchBufferSize) without issuing
  new I-cache requests.
- Also hit TypeError when branchPred was set to the class object.
After this change:
- Non-decoupled BPs (TournamentBP, LocalBP, TAGE, etc.) run correctly
  with Xiangshan configs; decoupled predictors remain unaffected.

Change-Id: I808f3ed6301a3104a46a32e4848f5d56791d7511
@XiangShanRobot
Copy link

[Generated by GEM5 Performance Robot]
commit: a8e2fcc
workflow: gem5 Ideal BTB Performance Test

Ideal BTB Performance

Overall Score

PR Master Diff(%)
Score 19.75 19.75 -0.02 🔴

@XiangShanRobot
Copy link

[Generated by GEM5 Performance Robot]
commit: a8e2fcc
workflow: gem5 Performance Test

Standard Performance

Overall Score

PR Master Diff(%)
Score 16.26 16.26 0.00

@XiangShanRobot
Copy link

[Generated by GEM5 Performance Robot]
commit: a8e2fcc
workflow: gem5 Ideal BTB Performance Test (no SC)

Ideal BTB Performance

Overall Score

PR Master Diff(%)
Score 19.27 19.27 0.00

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