From 70d0ca3049ef9f2782689f52299ad1c71744f0e7 Mon Sep 17 00:00:00 2001 From: Cao Jiaming Date: Thu, 19 Mar 2026 17:44:07 +0800 Subject: [PATCH 01/11] cpu-o3: change tage T2 way to 4 Change-Id: I7ecf06a54cd1183e3200549ee79cb14ff1920636 --- src/cpu/pred/BranchPredictor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index 0dc9570a15..ff7c861b28 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -1052,7 +1052,7 @@ class BTBTAGE(TimedBaseBTBPredictor): histLengths = VectorParam.Unsigned([4, 9, 17, 29, 56, 109, 211,397],"the BTB TAGE T0~Tn history length") maxHistLen = Param.Unsigned(970, "The length of history passed from DBP") numTablesToAlloc = Param.Unsigned(1,"The number of table to allocated each time") - numWays = VectorParam.Unsigned([2] * 8,"the T0~Tn number of ways per set") + numWays = VectorParam.Unsigned([2,2,4,2,2,2,2,2],"the T0~Tn number of ways per set") maxBranchPositions = Param.Unsigned(32, "Maximum branch positions per 64-byte block") useAltOnNaSize = Param.Unsigned(128, "Size of the useAltOnNa table") useAltOnNaWidth = Param.Unsigned(7, "Width of the useAltOnNa table") From f9e128f238a76f258fd49b3ef1c4564518bcc6f2 Mon Sep 17 00:00:00 2001 From: Cao Jiaming Date: Thu, 19 Mar 2026 17:46:41 +0800 Subject: [PATCH 02/11] cpu-o3: tage T3 table change to 4 Change-Id: If809499441e415303b9fec9705de69bab83390a1 --- src/cpu/pred/BranchPredictor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index ff7c861b28..04cb187ea2 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -1052,7 +1052,7 @@ class BTBTAGE(TimedBaseBTBPredictor): histLengths = VectorParam.Unsigned([4, 9, 17, 29, 56, 109, 211,397],"the BTB TAGE T0~Tn history length") maxHistLen = Param.Unsigned(970, "The length of history passed from DBP") numTablesToAlloc = Param.Unsigned(1,"The number of table to allocated each time") - numWays = VectorParam.Unsigned([2,2,4,2,2,2,2,2],"the T0~Tn number of ways per set") + numWays = VectorParam.Unsigned([2,2,2,4,2,2,2,2],"the T0~Tn number of ways per set") maxBranchPositions = Param.Unsigned(32, "Maximum branch positions per 64-byte block") useAltOnNaSize = Param.Unsigned(128, "Size of the useAltOnNa table") useAltOnNaWidth = Param.Unsigned(7, "Width of the useAltOnNa table") From 8bdbac99c7c91b3203be078fa66887b67e1bd805 Mon Sep 17 00:00:00 2001 From: Cao Jiaming Date: Fri, 20 Mar 2026 10:19:13 +0800 Subject: [PATCH 03/11] cpu-o3: tage T1 table 4way Change-Id: I65bbdac579a8804658788c94de1a69f747ac59d2 --- src/cpu/pred/BranchPredictor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index 04cb187ea2..a9fdc93182 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -1052,7 +1052,7 @@ class BTBTAGE(TimedBaseBTBPredictor): histLengths = VectorParam.Unsigned([4, 9, 17, 29, 56, 109, 211,397],"the BTB TAGE T0~Tn history length") maxHistLen = Param.Unsigned(970, "The length of history passed from DBP") numTablesToAlloc = Param.Unsigned(1,"The number of table to allocated each time") - numWays = VectorParam.Unsigned([2,2,2,4,2,2,2,2],"the T0~Tn number of ways per set") + numWays = VectorParam.Unsigned([2,4,2,2,2,2,2,2],"the T0~Tn number of ways per set") maxBranchPositions = Param.Unsigned(32, "Maximum branch positions per 64-byte block") useAltOnNaSize = Param.Unsigned(128, "Size of the useAltOnNa table") useAltOnNaWidth = Param.Unsigned(7, "Width of the useAltOnNa table") From c113f1cdc146a737a9d7353de23b4d24e55ee881 Mon Sep 17 00:00:00 2001 From: Cao Jiaming Date: Fri, 20 Mar 2026 11:44:49 +0800 Subject: [PATCH 04/11] cpu-o3: tage 8way 8k Change-Id: Id2cda6131f2d6f09993aca591506c3d515b9b15e --- src/cpu/pred/BranchPredictor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index a9fdc93182..03fba17c04 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -1044,7 +1044,7 @@ class BTBTAGE(TimedBaseBTBPredictor): enableSC = Param.Bool(False, "Enable SC or not") # TODO: BTBTAGE doesn't support SC updateOnRead = Param.Bool(True, "Enable update on read, no need to save tage meta in FTQ") numPredictors = Param.Unsigned(8, "Number of TAGE predictors") - tableSizes = VectorParam.Unsigned([2048, 2048, 2048, 2048, 2048, 2048, 2048,2048],"the TAGE T0~Tn length") + tableSizes = VectorParam.Unsigned([8192] * 8, "the TAGE T0~Tn length") TTagBitSizes = VectorParam.Unsigned([13] * 8, "the T0~Tn entry's tag bit size") TTagPcShifts = VectorParam.Unsigned([1] * 8, "when the T0~Tn entry's tag generating, PC right shift") blockSize = 32 # tage index function uses 32B aligned block address @@ -1052,7 +1052,7 @@ class BTBTAGE(TimedBaseBTBPredictor): histLengths = VectorParam.Unsigned([4, 9, 17, 29, 56, 109, 211,397],"the BTB TAGE T0~Tn history length") maxHistLen = Param.Unsigned(970, "The length of history passed from DBP") numTablesToAlloc = Param.Unsigned(1,"The number of table to allocated each time") - numWays = VectorParam.Unsigned([2,4,2,2,2,2,2,2],"the T0~Tn number of ways per set") + numWays = VectorParam.Unsigned([8] * 8, "the T0~Tn number of ways per set") maxBranchPositions = Param.Unsigned(32, "Maximum branch positions per 64-byte block") useAltOnNaSize = Param.Unsigned(128, "Size of the useAltOnNa table") useAltOnNaWidth = Param.Unsigned(7, "Width of the useAltOnNa table") From ac20e3f428a0a7bd6f15a057d0749400706b3c6d Mon Sep 17 00:00:00 2001 From: Cao Jiaming Date: Mon, 23 Mar 2026 10:05:51 +0800 Subject: [PATCH 05/11] cpu-o3: update TAGE table sizes and number of ways for BTBTAGE Change-Id: I9f60824f734da0061ae1609d250a0dae22d24fd6 --- src/cpu/pred/BranchPredictor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index 03fba17c04..69a912ae2f 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -1044,7 +1044,7 @@ class BTBTAGE(TimedBaseBTBPredictor): enableSC = Param.Bool(False, "Enable SC or not") # TODO: BTBTAGE doesn't support SC updateOnRead = Param.Bool(True, "Enable update on read, no need to save tage meta in FTQ") numPredictors = Param.Unsigned(8, "Number of TAGE predictors") - tableSizes = VectorParam.Unsigned([8192] * 8, "the TAGE T0~Tn length") + tableSizes = VectorParam.Unsigned([2048, 2048, 8192, 2048, 2048, 8192, 8192, 2048], "the TAGE T0~Tn length") TTagBitSizes = VectorParam.Unsigned([13] * 8, "the T0~Tn entry's tag bit size") TTagPcShifts = VectorParam.Unsigned([1] * 8, "when the T0~Tn entry's tag generating, PC right shift") blockSize = 32 # tage index function uses 32B aligned block address @@ -1052,7 +1052,7 @@ class BTBTAGE(TimedBaseBTBPredictor): histLengths = VectorParam.Unsigned([4, 9, 17, 29, 56, 109, 211,397],"the BTB TAGE T0~Tn history length") maxHistLen = Param.Unsigned(970, "The length of history passed from DBP") numTablesToAlloc = Param.Unsigned(1,"The number of table to allocated each time") - numWays = VectorParam.Unsigned([8] * 8, "the T0~Tn number of ways per set") + numWays = VectorParam.Unsigned([4, 2, 4, 8, 4, 2, 4, 2], "the T0~Tn number of ways per set") maxBranchPositions = Param.Unsigned(32, "Maximum branch positions per 64-byte block") useAltOnNaSize = Param.Unsigned(128, "Size of the useAltOnNa table") useAltOnNaWidth = Param.Unsigned(7, "Width of the useAltOnNa table") From 0c52707da8468684b7afea5d5e35f4c141aac06a Mon Sep 17 00:00:00 2001 From: Cao Jiaming Date: Mon, 23 Mar 2026 13:37:58 +0800 Subject: [PATCH 06/11] cpu-o3: update numWays configuration for BTBTAGE predictor Change-Id: Ib7ef90c0e9b136aaf96a787a303a2b52819aa6e5 --- src/cpu/pred/BranchPredictor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index 69a912ae2f..db45acfb88 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -1052,7 +1052,7 @@ class BTBTAGE(TimedBaseBTBPredictor): histLengths = VectorParam.Unsigned([4, 9, 17, 29, 56, 109, 211,397],"the BTB TAGE T0~Tn history length") maxHistLen = Param.Unsigned(970, "The length of history passed from DBP") numTablesToAlloc = Param.Unsigned(1,"The number of table to allocated each time") - numWays = VectorParam.Unsigned([4, 2, 4, 8, 4, 2, 4, 2], "the T0~Tn number of ways per set") + numWays = VectorParam.Unsigned([2, 2, 4, 4, 4, 2, 2, 2], "the T0~Tn number of ways per set") maxBranchPositions = Param.Unsigned(32, "Maximum branch positions per 64-byte block") useAltOnNaSize = Param.Unsigned(128, "Size of the useAltOnNa table") useAltOnNaWidth = Param.Unsigned(7, "Width of the useAltOnNa table") From 3058ef037d7ecf1522850f8929a5c3b7173d0ce2 Mon Sep 17 00:00:00 2001 From: Cao Jiaming Date: Tue, 24 Mar 2026 10:00:35 +0800 Subject: [PATCH 07/11] cpu: Tune BTBTAGE default tables and ways Change-Id: I42c0e9c23582ef5c5cc4d7970c6679637076a727 --- src/cpu/pred/BranchPredictor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index db45acfb88..dd74939e0b 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -1044,7 +1044,7 @@ class BTBTAGE(TimedBaseBTBPredictor): enableSC = Param.Bool(False, "Enable SC or not") # TODO: BTBTAGE doesn't support SC updateOnRead = Param.Bool(True, "Enable update on read, no need to save tage meta in FTQ") numPredictors = Param.Unsigned(8, "Number of TAGE predictors") - tableSizes = VectorParam.Unsigned([2048, 2048, 8192, 2048, 2048, 8192, 8192, 2048], "the TAGE T0~Tn length") + tableSizes = VectorParam.Unsigned([2048, 2048, 8192, 8192, 4096, 4096, 2048, 2048], "the TAGE T0~Tn length") TTagBitSizes = VectorParam.Unsigned([13] * 8, "the T0~Tn entry's tag bit size") TTagPcShifts = VectorParam.Unsigned([1] * 8, "when the T0~Tn entry's tag generating, PC right shift") blockSize = 32 # tage index function uses 32B aligned block address @@ -1052,7 +1052,7 @@ class BTBTAGE(TimedBaseBTBPredictor): histLengths = VectorParam.Unsigned([4, 9, 17, 29, 56, 109, 211,397],"the BTB TAGE T0~Tn history length") maxHistLen = Param.Unsigned(970, "The length of history passed from DBP") numTablesToAlloc = Param.Unsigned(1,"The number of table to allocated each time") - numWays = VectorParam.Unsigned([2, 2, 4, 4, 4, 2, 2, 2], "the T0~Tn number of ways per set") + numWays = VectorParam.Unsigned([2, 2, 4, 2, 2, 2, 2, 2], "the T0~Tn number of ways per set") maxBranchPositions = Param.Unsigned(32, "Maximum branch positions per 64-byte block") useAltOnNaSize = Param.Unsigned(128, "Size of the useAltOnNa table") useAltOnNaWidth = Param.Unsigned(7, "Width of the useAltOnNa table") From 2d970fc44d52f2801323e21195398bab0c9ca74f Mon Sep 17 00:00:00 2001 From: Cao Jiaming Date: Tue, 24 Mar 2026 10:18:57 +0800 Subject: [PATCH 08/11] cpu: Set BTBTAGE defaults to round21 config Change-Id: Ibc7b47fdb35d501dacf20c28d52ce25e8a15da70 --- src/cpu/pred/BranchPredictor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index dd74939e0b..5d3f2de746 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -1044,7 +1044,7 @@ class BTBTAGE(TimedBaseBTBPredictor): enableSC = Param.Bool(False, "Enable SC or not") # TODO: BTBTAGE doesn't support SC updateOnRead = Param.Bool(True, "Enable update on read, no need to save tage meta in FTQ") numPredictors = Param.Unsigned(8, "Number of TAGE predictors") - tableSizes = VectorParam.Unsigned([2048, 2048, 8192, 8192, 4096, 4096, 2048, 2048], "the TAGE T0~Tn length") + tableSizes = VectorParam.Unsigned([2048, 2048, 8192, 8192, 8192, 8192, 8192, 2048], "the TAGE T0~Tn length") TTagBitSizes = VectorParam.Unsigned([13] * 8, "the T0~Tn entry's tag bit size") TTagPcShifts = VectorParam.Unsigned([1] * 8, "when the T0~Tn entry's tag generating, PC right shift") blockSize = 32 # tage index function uses 32B aligned block address From fe5af391a51b4c3cc72d751dc5282369d84d3eac Mon Sep 17 00:00:00 2001 From: Cao Jiaming Date: Mon, 30 Mar 2026 09:44:09 +0800 Subject: [PATCH 09/11] cpu-o3: tage 512 1 0.7 Change-Id: I7076f353aa472dc6303438d690b988e6d458d2c9 --- src/cpu/pred/BranchPredictor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index 5d3f2de746..91b176967f 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -1044,7 +1044,7 @@ class BTBTAGE(TimedBaseBTBPredictor): enableSC = Param.Bool(False, "Enable SC or not") # TODO: BTBTAGE doesn't support SC updateOnRead = Param.Bool(True, "Enable update on read, no need to save tage meta in FTQ") numPredictors = Param.Unsigned(8, "Number of TAGE predictors") - tableSizes = VectorParam.Unsigned([2048, 2048, 8192, 8192, 8192, 8192, 8192, 2048], "the TAGE T0~Tn length") + tableSizes = VectorParam.Unsigned([512, 512, 8192, 2048, 1024, 512, 512, 512], "the TAGE T0~Tn length") TTagBitSizes = VectorParam.Unsigned([13] * 8, "the T0~Tn entry's tag bit size") TTagPcShifts = VectorParam.Unsigned([1] * 8, "when the T0~Tn entry's tag generating, PC right shift") blockSize = 32 # tage index function uses 32B aligned block address @@ -1052,7 +1052,7 @@ class BTBTAGE(TimedBaseBTBPredictor): histLengths = VectorParam.Unsigned([4, 9, 17, 29, 56, 109, 211,397],"the BTB TAGE T0~Tn history length") maxHistLen = Param.Unsigned(970, "The length of history passed from DBP") numTablesToAlloc = Param.Unsigned(1,"The number of table to allocated each time") - numWays = VectorParam.Unsigned([2, 2, 4, 2, 2, 2, 2, 2], "the T0~Tn number of ways per set") + numWays = VectorParam.Unsigned([1, 1, 4, 4, 1, 1, 1, 1], "the T0~Tn number of ways per set") maxBranchPositions = Param.Unsigned(32, "Maximum branch positions per 64-byte block") useAltOnNaSize = Param.Unsigned(128, "Size of the useAltOnNa table") useAltOnNaWidth = Param.Unsigned(7, "Width of the useAltOnNa table") From f2266fed649bffb39ec5763e79217569525b9a7c Mon Sep 17 00:00:00 2001 From: Cao Jiaming Date: Thu, 2 Apr 2026 17:15:45 +0800 Subject: [PATCH 10/11] cpu-o3: update BTBTAGE table sizes and number of ways Change-Id: Ie34c43f5b3917b34ac578d3ca3d06bf7a71f9cb4 --- src/cpu/pred/BranchPredictor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index 91b176967f..5e325be65f 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -1044,7 +1044,7 @@ class BTBTAGE(TimedBaseBTBPredictor): enableSC = Param.Bool(False, "Enable SC or not") # TODO: BTBTAGE doesn't support SC updateOnRead = Param.Bool(True, "Enable update on read, no need to save tage meta in FTQ") numPredictors = Param.Unsigned(8, "Number of TAGE predictors") - tableSizes = VectorParam.Unsigned([512, 512, 8192, 2048, 1024, 512, 512, 512], "the TAGE T0~Tn length") + tableSizes = VectorParam.Unsigned([2048, 2048, 4096, 4096, 4096, 2048, 2048, 2048], "the TAGE T0~Tn length") TTagBitSizes = VectorParam.Unsigned([13] * 8, "the T0~Tn entry's tag bit size") TTagPcShifts = VectorParam.Unsigned([1] * 8, "when the T0~Tn entry's tag generating, PC right shift") blockSize = 32 # tage index function uses 32B aligned block address @@ -1052,7 +1052,7 @@ class BTBTAGE(TimedBaseBTBPredictor): histLengths = VectorParam.Unsigned([4, 9, 17, 29, 56, 109, 211,397],"the BTB TAGE T0~Tn history length") maxHistLen = Param.Unsigned(970, "The length of history passed from DBP") numTablesToAlloc = Param.Unsigned(1,"The number of table to allocated each time") - numWays = VectorParam.Unsigned([1, 1, 4, 4, 1, 1, 1, 1], "the T0~Tn number of ways per set") + numWays = VectorParam.Unsigned([2,2,2,2,2,2,2,2], "the T0~Tn number of ways per set") maxBranchPositions = Param.Unsigned(32, "Maximum branch positions per 64-byte block") useAltOnNaSize = Param.Unsigned(128, "Size of the useAltOnNa table") useAltOnNaWidth = Param.Unsigned(7, "Width of the useAltOnNa table") From 0f712f299beaa35aa8220363b9ebe050b2bdfc0f Mon Sep 17 00:00:00 2001 From: Cao Jiaming Date: Thu, 2 Apr 2026 18:22:18 +0800 Subject: [PATCH 11/11] cpu-o3: update BTBTAGE table sizes for improved performance Change-Id: I462095d6e59782a1865d9fec4d4b5ed892005c58 --- src/cpu/pred/BranchPredictor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index 5e325be65f..18ddd16a1b 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -1044,7 +1044,7 @@ class BTBTAGE(TimedBaseBTBPredictor): enableSC = Param.Bool(False, "Enable SC or not") # TODO: BTBTAGE doesn't support SC updateOnRead = Param.Bool(True, "Enable update on read, no need to save tage meta in FTQ") numPredictors = Param.Unsigned(8, "Number of TAGE predictors") - tableSizes = VectorParam.Unsigned([2048, 2048, 4096, 4096, 4096, 2048, 2048, 2048], "the TAGE T0~Tn length") + tableSizes = VectorParam.Unsigned([2048, 2048, 4096, 4096, 4096, 4096, 2048, 2048], "the TAGE T0~Tn length") TTagBitSizes = VectorParam.Unsigned([13] * 8, "the T0~Tn entry's tag bit size") TTagPcShifts = VectorParam.Unsigned([1] * 8, "when the T0~Tn entry's tag generating, PC right shift") blockSize = 32 # tage index function uses 32B aligned block address