-
Notifications
You must be signed in to change notification settings - Fork 73
Sc test align #852
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
base: xs-dev
Are you sure you want to change the base?
Sc test align #852
Changes from all commits
56c96f0
0ad83c5
4b8bcab
44ea6ae
fc42281
0809aa0
f56da4a
65f9222
847b2e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -432,15 +432,15 @@ BTBMGSC::generateSinglePrediction(const BTBEntry &btb_entry, const Addr &startPC | |||||||||||||||||
| bool use_sc_pred = forceUseSC; // Force use SC if configured | ||||||||||||||||||
| if (!use_sc_pred) { | ||||||||||||||||||
| if (tage_info.tage_pred_conf_high) { | ||||||||||||||||||
| if (abs(total_sum) > total_thres / 2) { | ||||||||||||||||||
| if (abs(total_sum) > total_thres) { | ||||||||||||||||||
| use_sc_pred = true; | ||||||||||||||||||
| } | ||||||||||||||||||
| } else if (tage_info.tage_pred_conf_mid) { | ||||||||||||||||||
| if (abs(total_sum) > total_thres / 4) { | ||||||||||||||||||
| if (abs(total_sum) > total_thres / 2) { | ||||||||||||||||||
| use_sc_pred = true; | ||||||||||||||||||
| } | ||||||||||||||||||
| } else if (tage_info.tage_pred_conf_low) { | ||||||||||||||||||
| if (abs(total_sum) > total_thres / 8) { | ||||||||||||||||||
| if (abs(total_sum) > total_thres / 4) { | ||||||||||||||||||
| use_sc_pred = true; | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
@@ -792,8 +792,8 @@ BTBMGSC::updateSinglePredictor(const BTBEntry &entry, bool actual_taken, const M | |||||||||||||||||
| #ifndef UNIT_TEST | ||||||||||||||||||
| // Write trace record | ||||||||||||||||||
| if (enableDB && (focusBranchPC == 0 || entry.pc == focusBranchPC)) { | ||||||||||||||||||
| auto effective_gate = pred.tage_conf_high ? (total_thres / 2) | ||||||||||||||||||
| : (pred.tage_conf_mid ? (total_thres / 4) : (total_thres / 8)); | ||||||||||||||||||
| auto effective_gate = pred.tage_conf_high ? total_thres | ||||||||||||||||||
| : (pred.tage_conf_mid ? (total_thres / 2) : (total_thres / 4)); | ||||||||||||||||||
| auto margin = std::abs(total_sum) - effective_gate; | ||||||||||||||||||
|
Comment on lines
+795
to
797
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The ternary chain falls through to 🐛 Proposed fix — mirror the prediction-side `if/else if` structure- auto effective_gate = pred.tage_conf_high ? total_thres
- : (pred.tage_conf_mid ? (total_thres / 2) : (total_thres / 4));
+ auto effective_gate = pred.tage_conf_high ? total_thres
+ : pred.tage_conf_mid ? (total_thres / 2)
+ : pred.tage_conf_low ? (total_thres / 4)
+ : 0; // no confidence tier active (e.g. forceUseSC); gate is irrelevant📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| auto foldIndexSig = [](const std::vector<unsigned> &indices) -> uint64_t { | ||||||||||||||||||
| uint64_t sig = 0xcbf29ce484222325ULL; | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the unchanged
BTBMGSCTest.GateHighConfUsesSCWhenStrongvector,total_sumis 18 and the defaulttotal_thresis 35. After this threshold bump, high-confidence predictions require18 > 35, souse_mgscstays false and the prediction falls back to TAGE/not-taken instead of the test's expected SC/taken result; please update the unit test inputs/expectations along with the new gate semantics so the MGSC test suite does not fail.Useful? React with 👍 / 👎.