BranchPredictor.py (13494:ed4ed5351b16) BranchPredictor.py (13626:d6a6358aa6db)
1# Copyright (c) 2012 Mark D. Hill and David A. Wood
2# Copyright (c) 2015 The University of Wisconsin
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 73 unchanged lines hidden (view full) ---

82 cxx_class = 'BiModeBP'
83 cxx_header = "cpu/pred/bi_mode.hh"
84
85 globalPredictorSize = Param.Unsigned(8192, "Size of global predictor")
86 globalCtrBits = Param.Unsigned(2, "Bits per counter")
87 choicePredictorSize = Param.Unsigned(8192, "Size of choice predictor")
88 choiceCtrBits = Param.Unsigned(2, "Bits of choice counters")
89
1# Copyright (c) 2012 Mark D. Hill and David A. Wood
2# Copyright (c) 2015 The University of Wisconsin
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 73 unchanged lines hidden (view full) ---

82 cxx_class = 'BiModeBP'
83 cxx_header = "cpu/pred/bi_mode.hh"
84
85 globalPredictorSize = Param.Unsigned(8192, "Size of global predictor")
86 globalCtrBits = Param.Unsigned(2, "Bits per counter")
87 choicePredictorSize = Param.Unsigned(8192, "Size of choice predictor")
88 choiceCtrBits = Param.Unsigned(2, "Bits of choice counters")
89
90# TAGE branch predictor as described in https://www.jilp.org/vol8/v8paper1.pdf
91# The default sizes below are for the 8C-TAGE configuration (63.5 Kbits)
92class TAGE(BranchPredictor):
93 type = 'TAGE'
94 cxx_class = 'TAGE'
95 cxx_header = "cpu/pred/tage.hh"
90class TAGEBase(SimObject):
91 type = 'TAGEBase'
92 cxx_class = 'TAGEBase'
93 cxx_header = "cpu/pred/tage_base.hh"
96
94
95 numThreads = Param.Unsigned(Parent.numThreads, "Number of threads")
96 instShiftAmt = Param.Unsigned(Parent.instShiftAmt,
97 "Number of bits to shift instructions by")
98
97 nHistoryTables = Param.Unsigned(7, "Number of history tables")
98 minHist = Param.Unsigned(5, "Minimum history size of TAGE")
99 maxHist = Param.Unsigned(130, "Maximum history size of TAGE")
100
101 tagTableTagWidths = VectorParam.Unsigned(
102 [0, 9, 9, 10, 10, 11, 11, 12], "Tag size in TAGE tag tables")
103 logTagTableSizes = VectorParam.Int(
104 [13, 9, 9, 9, 9, 9, 9, 9], "Log2 of TAGE table sizes")

--- 5 unchanged lines hidden (view full) ---

110 tagTableUBits = Param.Unsigned(2, "Number of tag table u bits")
111
112 histBufferSize = Param.Unsigned(2097152,
113 "A large number to track all branch histories(2MEntries default)")
114
115 pathHistBits = Param.Unsigned(16, "Path history size")
116 logUResetPeriod = Param.Unsigned(18,
117 "Log period in number of branches to reset TAGE useful counters")
99 nHistoryTables = Param.Unsigned(7, "Number of history tables")
100 minHist = Param.Unsigned(5, "Minimum history size of TAGE")
101 maxHist = Param.Unsigned(130, "Maximum history size of TAGE")
102
103 tagTableTagWidths = VectorParam.Unsigned(
104 [0, 9, 9, 10, 10, 11, 11, 12], "Tag size in TAGE tag tables")
105 logTagTableSizes = VectorParam.Int(
106 [13, 9, 9, 9, 9, 9, 9, 9], "Log2 of TAGE table sizes")

--- 5 unchanged lines hidden (view full) ---

112 tagTableUBits = Param.Unsigned(2, "Number of tag table u bits")
113
114 histBufferSize = Param.Unsigned(2097152,
115 "A large number to track all branch histories(2MEntries default)")
116
117 pathHistBits = Param.Unsigned(16, "Path history size")
118 logUResetPeriod = Param.Unsigned(18,
119 "Log period in number of branches to reset TAGE useful counters")
120 numUseAltOnNa = Param.Unsigned(1, "Number of USE_ALT_ON_NA counters")
118 useAltOnNaBits = Param.Unsigned(4, "Size of the USE_ALT_ON_NA counter")
119
121 useAltOnNaBits = Param.Unsigned(4, "Size of the USE_ALT_ON_NA counter")
122
123 maxNumAlloc = Param.Unsigned(1,
124 "Max number of TAGE entries allocted on mispredict")
120
125
126 # List of enabled TAGE tables. If empty, all are enabled
127 noSkip = VectorParam.Bool([], "Vector of enabled TAGE tables")
128
129 speculativeHistUpdate = Param.Bool(True,
130 "Use speculative update for histories")
131
132# TAGE branch predictor as described in https://www.jilp.org/vol8/v8paper1.pdf
133# The default sizes below are for the 8C-TAGE configuration (63.5 Kbits)
134class TAGE(BranchPredictor):
135 type = 'TAGE'
136 cxx_class = 'TAGE'
137 cxx_header = "cpu/pred/tage.hh"
138 tage = Param.TAGEBase(TAGEBase(), "Tage object")
139
140class LTAGE_TAGE(TAGEBase):
141 nHistoryTables = 12
142 minHist = 4
143 maxHist = 640
144 tagTableTagWidths = [0, 7, 7, 8, 8, 9, 10, 11, 12, 12, 13, 14, 15]
145 logTagTableSizes = [14, 10, 10, 11, 11, 11, 11, 10, 10, 10, 10, 9, 9]
146 logUResetPeriod = 19
147
121# LTAGE branch predictor as described in
122# https://www.irisa.fr/caps/people/seznec/L-TAGE.pdf
123# It is basically a TAGE predictor plus a loop predictor
124# The differnt TAGE sizes are updated according to the paper values (256 Kbits)
125class LTAGE(TAGE):
126 type = 'LTAGE'
127 cxx_class = 'LTAGE'
128 cxx_header = "cpu/pred/ltage.hh"
129
148# LTAGE branch predictor as described in
149# https://www.irisa.fr/caps/people/seznec/L-TAGE.pdf
150# It is basically a TAGE predictor plus a loop predictor
151# The differnt TAGE sizes are updated according to the paper values (256 Kbits)
152class LTAGE(TAGE):
153 type = 'LTAGE'
154 cxx_class = 'LTAGE'
155 cxx_header = "cpu/pred/ltage.hh"
156
130 nHistoryTables = 12
131 minHist = 4
132 maxHist = 640
133 tagTableTagWidths = [0, 7, 7, 8, 8, 9, 10, 11, 12, 12, 13, 14, 15]
134 logTagTableSizes = [14, 10, 10, 11, 11, 11, 11, 10, 10, 10, 10, 9, 9]
135 logUResetPeriod = 19
157 tage = LTAGE_TAGE()
136
137 logSizeLoopPred = Param.Unsigned(8, "Log size of the loop predictor")
138 withLoopBits = Param.Unsigned(7, "Size of the WITHLOOP counter")
139 loopTableAgeBits = Param.Unsigned(8, "Number of age bits per loop entry")
140 loopTableConfidenceBits = Param.Unsigned(2,
141 "Number of confidence bits per loop entry")
142 loopTableTagBits = Param.Unsigned(14, "Number of tag bits per loop entry")
143 loopTableIterBits = Param.Unsigned(14, "Nuber of iteration bits per loop")

--- 18 unchanged lines hidden ---
158
159 logSizeLoopPred = Param.Unsigned(8, "Log size of the loop predictor")
160 withLoopBits = Param.Unsigned(7, "Size of the WITHLOOP counter")
161 loopTableAgeBits = Param.Unsigned(8, "Number of age bits per loop entry")
162 loopTableConfidenceBits = Param.Unsigned(2,
163 "Number of confidence bits per loop entry")
164 loopTableTagBits = Param.Unsigned(14, "Number of tag bits per loop entry")
165 loopTableIterBits = Param.Unsigned(14, "Nuber of iteration bits per loop")

--- 18 unchanged lines hidden ---