From 56c96f07f0d1af3dbea1c4a2cfb69b70b6df1005 Mon Sep 17 00:00:00 2001 From: Yan Yue <1131531947@qq.com> Date: Thu, 7 May 2026 17:49:03 +0800 Subject: [PATCH 1/9] configs: Disable MGSC tables for CI ablation Change-Id: Ie2b38fd880551def364b0b3f0a56ba115dc14a7c --- configs/example/kmhv3.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configs/example/kmhv3.py b/configs/example/kmhv3.py index 48bbe80b75..dd2bcaac3a 100644 --- a/configs/example/kmhv3.py +++ b/configs/example/kmhv3.py @@ -111,6 +111,13 @@ def setKmhV3Params(args, system): cpu.branchPred.tage.enabled = True cpu.branchPred.ittage.enabled = True cpu.branchPred.mgsc.enabled = True + # SC table ablation config for gcc15 slice CI. + cpu.branchPred.mgsc.enableBwTable = False + cpu.branchPred.mgsc.enableLTable = False + cpu.branchPred.mgsc.enableITable = False + cpu.branchPred.mgsc.enableGTable = False + cpu.branchPred.mgsc.enablePTable = False + cpu.branchPred.mgsc.enableBiasTable = False cpu.branchPred.ras.enabled = True # l1 cache per core From 0ad83c54fd6e07d0043ba2bb664c13a498dc4f02 Mon Sep 17 00:00:00 2001 From: Yan Yue <1131531947@qq.com> Date: Thu, 7 May 2026 17:49:48 +0800 Subject: [PATCH 2/9] configs: Enable only MGSC global table Change-Id: Ic34c0efd1c02cbb88bd4c27e248012eee11bd09d --- configs/example/kmhv3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/example/kmhv3.py b/configs/example/kmhv3.py index dd2bcaac3a..66a4fc4bf9 100644 --- a/configs/example/kmhv3.py +++ b/configs/example/kmhv3.py @@ -115,7 +115,7 @@ def setKmhV3Params(args, system): cpu.branchPred.mgsc.enableBwTable = False cpu.branchPred.mgsc.enableLTable = False cpu.branchPred.mgsc.enableITable = False - cpu.branchPred.mgsc.enableGTable = False + cpu.branchPred.mgsc.enableGTable = True cpu.branchPred.mgsc.enablePTable = False cpu.branchPred.mgsc.enableBiasTable = False cpu.branchPred.ras.enabled = True From 4b8bcabcf54082518c541304561350df8d549dda Mon Sep 17 00:00:00 2001 From: Yan Yue <1131531947@qq.com> Date: Thu, 7 May 2026 17:50:19 +0800 Subject: [PATCH 3/9] configs: Enable only MGSC local table Change-Id: I6d9d8fb3aae8aa28b4848ca6e0d62f5196e9e140 --- configs/example/kmhv3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/example/kmhv3.py b/configs/example/kmhv3.py index 66a4fc4bf9..b3ada3c523 100644 --- a/configs/example/kmhv3.py +++ b/configs/example/kmhv3.py @@ -113,9 +113,9 @@ def setKmhV3Params(args, system): cpu.branchPred.mgsc.enabled = True # SC table ablation config for gcc15 slice CI. cpu.branchPred.mgsc.enableBwTable = False - cpu.branchPred.mgsc.enableLTable = False + cpu.branchPred.mgsc.enableLTable = True cpu.branchPred.mgsc.enableITable = False - cpu.branchPred.mgsc.enableGTable = True + cpu.branchPred.mgsc.enableGTable = False cpu.branchPred.mgsc.enablePTable = False cpu.branchPred.mgsc.enableBiasTable = False cpu.branchPred.ras.enabled = True From 44ea6ae8ae0e82e3f474c5c89b52831f0276e22d Mon Sep 17 00:00:00 2001 From: Yan Yue <1131531947@qq.com> Date: Thu, 7 May 2026 17:50:52 +0800 Subject: [PATCH 4/9] configs: Enable only MGSC IMLI table Change-Id: I2e585ec892473c4b83747f05018cf2464a0d5f52 --- configs/example/kmhv3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/example/kmhv3.py b/configs/example/kmhv3.py index b3ada3c523..2fe3c6dc5a 100644 --- a/configs/example/kmhv3.py +++ b/configs/example/kmhv3.py @@ -113,8 +113,8 @@ def setKmhV3Params(args, system): cpu.branchPred.mgsc.enabled = True # SC table ablation config for gcc15 slice CI. cpu.branchPred.mgsc.enableBwTable = False - cpu.branchPred.mgsc.enableLTable = True - cpu.branchPred.mgsc.enableITable = False + cpu.branchPred.mgsc.enableLTable = False + cpu.branchPred.mgsc.enableITable = True cpu.branchPred.mgsc.enableGTable = False cpu.branchPred.mgsc.enablePTable = False cpu.branchPred.mgsc.enableBiasTable = False From fc4228139aef25a5a683796602381ef6b50648a6 Mon Sep 17 00:00:00 2001 From: Yan Yue <1131531947@qq.com> Date: Thu, 7 May 2026 17:51:21 +0800 Subject: [PATCH 5/9] configs: Enable only MGSC backward table Change-Id: Ib9c372a0183349af7d106f6f60cfaac9f02d1905 --- configs/example/kmhv3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/example/kmhv3.py b/configs/example/kmhv3.py index 2fe3c6dc5a..ab07458384 100644 --- a/configs/example/kmhv3.py +++ b/configs/example/kmhv3.py @@ -112,9 +112,9 @@ def setKmhV3Params(args, system): cpu.branchPred.ittage.enabled = True cpu.branchPred.mgsc.enabled = True # SC table ablation config for gcc15 slice CI. - cpu.branchPred.mgsc.enableBwTable = False + cpu.branchPred.mgsc.enableBwTable = True cpu.branchPred.mgsc.enableLTable = False - cpu.branchPred.mgsc.enableITable = True + cpu.branchPred.mgsc.enableITable = False cpu.branchPred.mgsc.enableGTable = False cpu.branchPred.mgsc.enablePTable = False cpu.branchPred.mgsc.enableBiasTable = False From 0809aa0a1c0edb9e47002637853d9964c593cb1f Mon Sep 17 00:00:00 2001 From: Yan Yue <1131531947@qq.com> Date: Thu, 7 May 2026 17:52:00 +0800 Subject: [PATCH 6/9] configs: Enable only MGSC path table Change-Id: I060cbdf18dc7c0dbf75df01faf88538cb1be7f9c --- configs/example/kmhv3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/example/kmhv3.py b/configs/example/kmhv3.py index ab07458384..314fbe8ca8 100644 --- a/configs/example/kmhv3.py +++ b/configs/example/kmhv3.py @@ -112,11 +112,11 @@ def setKmhV3Params(args, system): cpu.branchPred.ittage.enabled = True cpu.branchPred.mgsc.enabled = True # SC table ablation config for gcc15 slice CI. - cpu.branchPred.mgsc.enableBwTable = True + cpu.branchPred.mgsc.enableBwTable = False cpu.branchPred.mgsc.enableLTable = False cpu.branchPred.mgsc.enableITable = False cpu.branchPred.mgsc.enableGTable = False - cpu.branchPred.mgsc.enablePTable = False + cpu.branchPred.mgsc.enablePTable = True cpu.branchPred.mgsc.enableBiasTable = False cpu.branchPred.ras.enabled = True From f56da4ab671692b5888c09744436d6e21dd40d31 Mon Sep 17 00:00:00 2001 From: Yan Yue <1131531947@qq.com> Date: Thu, 7 May 2026 17:52:33 +0800 Subject: [PATCH 7/9] configs: Enable only MGSC bias table Change-Id: I89179c4c5b1e5b7b30001d9ea535c43c84dc8eb4 --- configs/example/kmhv3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/example/kmhv3.py b/configs/example/kmhv3.py index 314fbe8ca8..ba9365ca76 100644 --- a/configs/example/kmhv3.py +++ b/configs/example/kmhv3.py @@ -116,8 +116,8 @@ def setKmhV3Params(args, system): cpu.branchPred.mgsc.enableLTable = False cpu.branchPred.mgsc.enableITable = False cpu.branchPred.mgsc.enableGTable = False - cpu.branchPred.mgsc.enablePTable = True - cpu.branchPred.mgsc.enableBiasTable = False + cpu.branchPred.mgsc.enablePTable = False + cpu.branchPred.mgsc.enableBiasTable = True cpu.branchPred.ras.enabled = True # l1 cache per core From 65f9222d4e263cda731694052f0bccf196d6ceb8 Mon Sep 17 00:00:00 2001 From: Yan Yue <1131531947@qq.com> Date: Fri, 8 May 2026 12:23:01 +0800 Subject: [PATCH 8/9] bpu: Tighten MGSC override gating Change-Id: Id1906f09efc28fe566bf1223a765e8b57576b917 --- configs/example/kmhv3.py | 8 +------- src/cpu/pred/btb/btb_mgsc.cc | 10 +++++----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/configs/example/kmhv3.py b/configs/example/kmhv3.py index ba9365ca76..47e308a327 100644 --- a/configs/example/kmhv3.py +++ b/configs/example/kmhv3.py @@ -111,13 +111,7 @@ def setKmhV3Params(args, system): cpu.branchPred.tage.enabled = True cpu.branchPred.ittage.enabled = True cpu.branchPred.mgsc.enabled = True - # SC table ablation config for gcc15 slice CI. - cpu.branchPred.mgsc.enableBwTable = False - cpu.branchPred.mgsc.enableLTable = False - cpu.branchPred.mgsc.enableITable = False - cpu.branchPred.mgsc.enableGTable = False - cpu.branchPred.mgsc.enablePTable = False - cpu.branchPred.mgsc.enableBiasTable = True + cpu.branchPred.mgsc.enablePCThreshold = True cpu.branchPred.ras.enabled = True # l1 cache per core diff --git a/src/cpu/pred/btb/btb_mgsc.cc b/src/cpu/pred/btb/btb_mgsc.cc index b2b7726a5f..72e845bb3b 100755 --- a/src/cpu/pred/btb/btb_mgsc.cc +++ b/src/cpu/pred/btb/btb_mgsc.cc @@ -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; auto foldIndexSig = [](const std::vector &indices) -> uint64_t { uint64_t sig = 0xcbf29ce484222325ULL; From 847b2e4d5a8cf409a50571f44fcec4c15180db57 Mon Sep 17 00:00:00 2001 From: Yan Yue <1131531947@qq.com> Date: Fri, 8 May 2026 14:41:16 +0800 Subject: [PATCH 9/9] configs: Enable only MGSC global table Change-Id: Ia9832e1fd0d060625391939ef0de4ba5e54549cc --- configs/example/kmhv3.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configs/example/kmhv3.py b/configs/example/kmhv3.py index 47e308a327..993a475b9f 100644 --- a/configs/example/kmhv3.py +++ b/configs/example/kmhv3.py @@ -111,6 +111,12 @@ def setKmhV3Params(args, system): cpu.branchPred.tage.enabled = True cpu.branchPred.ittage.enabled = True cpu.branchPred.mgsc.enabled = True + cpu.branchPred.mgsc.enableBwTable = False + cpu.branchPred.mgsc.enableLTable = False + cpu.branchPred.mgsc.enableITable = False + cpu.branchPred.mgsc.enableGTable = True + cpu.branchPred.mgsc.enablePTable = False + cpu.branchPred.mgsc.enableBiasTable = False cpu.branchPred.mgsc.enablePCThreshold = True cpu.branchPred.ras.enabled = True