BranchPredictor.py revision 14081
19480Snilay@cs.wisc.edu# Copyright (c) 2012 Mark D. Hill and David A. Wood 210785Sgope@wisc.edu# Copyright (c) 2015 The University of Wisconsin 39480Snilay@cs.wisc.edu# All rights reserved. 49480Snilay@cs.wisc.edu# 59480Snilay@cs.wisc.edu# Redistribution and use in source and binary forms, with or without 69480Snilay@cs.wisc.edu# modification, are permitted provided that the following conditions are 79480Snilay@cs.wisc.edu# met: redistributions of source code must retain the above copyright 89480Snilay@cs.wisc.edu# notice, this list of conditions and the following disclaimer; 99480Snilay@cs.wisc.edu# redistributions in binary form must reproduce the above copyright 109480Snilay@cs.wisc.edu# notice, this list of conditions and the following disclaimer in the 119480Snilay@cs.wisc.edu# documentation and/or other materials provided with the distribution; 129480Snilay@cs.wisc.edu# neither the name of the copyright holders nor the names of its 139480Snilay@cs.wisc.edu# contributors may be used to endorse or promote products derived from 149480Snilay@cs.wisc.edu# this software without specific prior written permission. 159480Snilay@cs.wisc.edu# 169480Snilay@cs.wisc.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 179480Snilay@cs.wisc.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 189480Snilay@cs.wisc.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 199480Snilay@cs.wisc.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 209480Snilay@cs.wisc.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 219480Snilay@cs.wisc.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 229480Snilay@cs.wisc.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 239480Snilay@cs.wisc.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 249480Snilay@cs.wisc.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 259480Snilay@cs.wisc.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 269480Snilay@cs.wisc.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 279480Snilay@cs.wisc.edu# 2810785Sgope@wisc.edu# Authors: Nilay Vaish and Dibakar Gope 299480Snilay@cs.wisc.edu 309480Snilay@cs.wisc.edufrom m5.SimObject import SimObject 319480Snilay@cs.wisc.edufrom m5.params import * 3213432Spau.cabre@metempsy.comfrom m5.proxy import * 339480Snilay@cs.wisc.edu 3413957Sjairo.balart@metempsy.comclass IndirectPredictor(SimObject): 3513957Sjairo.balart@metempsy.com type = 'IndirectPredictor' 3613957Sjairo.balart@metempsy.com cxx_class = 'IndirectPredictor' 3713957Sjairo.balart@metempsy.com cxx_header = "cpu/pred/indirect.hh" 3813957Sjairo.balart@metempsy.com abstract = True 3913957Sjairo.balart@metempsy.com 4013957Sjairo.balart@metempsy.com numThreads = Param.Unsigned(Parent.numThreads, "Number of threads") 4113957Sjairo.balart@metempsy.com 4213957Sjairo.balart@metempsy.comclass SimpleIndirectPredictor(IndirectPredictor): 4313957Sjairo.balart@metempsy.com type = 'SimpleIndirectPredictor' 4413957Sjairo.balart@metempsy.com cxx_class = 'SimpleIndirectPredictor' 4513957Sjairo.balart@metempsy.com cxx_header = "cpu/pred/simple_indirect.hh" 4613957Sjairo.balart@metempsy.com 4713957Sjairo.balart@metempsy.com indirectHashGHR = Param.Bool(True, "Hash branch predictor GHR") 4813957Sjairo.balart@metempsy.com indirectHashTargets = Param.Bool(True, "Hash path history targets") 4913957Sjairo.balart@metempsy.com indirectSets = Param.Unsigned(256, "Cache sets for indirect predictor") 5013957Sjairo.balart@metempsy.com indirectWays = Param.Unsigned(2, "Ways for indirect predictor") 5113957Sjairo.balart@metempsy.com indirectTagSize = Param.Unsigned(16, "Indirect target cache tag bits") 5213957Sjairo.balart@metempsy.com indirectPathLength = Param.Unsigned(3, 5313957Sjairo.balart@metempsy.com "Previous indirect targets to use for path history") 5413957Sjairo.balart@metempsy.com indirectGHRBits = Param.Unsigned(13, "Indirect GHR number of bits") 5513957Sjairo.balart@metempsy.com instShiftAmt = Param.Unsigned(2, "Number of bits to shift instructions by") 5613957Sjairo.balart@metempsy.com 579480Snilay@cs.wisc.educlass BranchPredictor(SimObject): 589480Snilay@cs.wisc.edu type = 'BranchPredictor' 599480Snilay@cs.wisc.edu cxx_class = 'BPredUnit' 609480Snilay@cs.wisc.edu cxx_header = "cpu/pred/bpred_unit.hh" 6110785Sgope@wisc.edu abstract = True 629480Snilay@cs.wisc.edu 6313432Spau.cabre@metempsy.com numThreads = Param.Unsigned(Parent.numThreads, "Number of threads") 6410785Sgope@wisc.edu BTBEntries = Param.Unsigned(4096, "Number of BTB entries") 6510785Sgope@wisc.edu BTBTagSize = Param.Unsigned(16, "Size of the BTB tags, in bits") 6610785Sgope@wisc.edu RASSize = Param.Unsigned(16, "RAS size") 6710785Sgope@wisc.edu instShiftAmt = Param.Unsigned(2, "Number of bits to shift instructions by") 6810785Sgope@wisc.edu 6913957Sjairo.balart@metempsy.com indirectBranchPred = Param.IndirectPredictor(SimpleIndirectPredictor(), 7013957Sjairo.balart@metempsy.com "Indirect branch predictor, set to NULL to disable indirect predictions") 7110785Sgope@wisc.edu 7210785Sgope@wisc.educlass LocalBP(BranchPredictor): 7310785Sgope@wisc.edu type = 'LocalBP' 7410785Sgope@wisc.edu cxx_class = 'LocalBP' 7510785Sgope@wisc.edu cxx_header = "cpu/pred/2bit_local.hh" 7610785Sgope@wisc.edu 779480Snilay@cs.wisc.edu localPredictorSize = Param.Unsigned(2048, "Size of local predictor") 789480Snilay@cs.wisc.edu localCtrBits = Param.Unsigned(2, "Bits per counter") 7910785Sgope@wisc.edu 8010785Sgope@wisc.edu 8110785Sgope@wisc.educlass TournamentBP(BranchPredictor): 8210785Sgope@wisc.edu type = 'TournamentBP' 8310785Sgope@wisc.edu cxx_class = 'TournamentBP' 8410785Sgope@wisc.edu cxx_header = "cpu/pred/tournament.hh" 8510785Sgope@wisc.edu 8610785Sgope@wisc.edu localPredictorSize = Param.Unsigned(2048, "Size of local predictor") 8710785Sgope@wisc.edu localCtrBits = Param.Unsigned(2, "Bits per counter") 8810785Sgope@wisc.edu localHistoryTableSize = Param.Unsigned(2048, "size of local history table") 899480Snilay@cs.wisc.edu globalPredictorSize = Param.Unsigned(8192, "Size of global predictor") 909480Snilay@cs.wisc.edu globalCtrBits = Param.Unsigned(2, "Bits per counter") 919480Snilay@cs.wisc.edu choicePredictorSize = Param.Unsigned(8192, "Size of choice predictor") 929480Snilay@cs.wisc.edu choiceCtrBits = Param.Unsigned(2, "Bits of choice counters") 939480Snilay@cs.wisc.edu 949480Snilay@cs.wisc.edu 9510785Sgope@wisc.educlass BiModeBP(BranchPredictor): 9610785Sgope@wisc.edu type = 'BiModeBP' 9710785Sgope@wisc.edu cxx_class = 'BiModeBP' 9810785Sgope@wisc.edu cxx_header = "cpu/pred/bi_mode.hh" 9910785Sgope@wisc.edu 10010785Sgope@wisc.edu globalPredictorSize = Param.Unsigned(8192, "Size of global predictor") 10110785Sgope@wisc.edu globalCtrBits = Param.Unsigned(2, "Bits per counter") 10210785Sgope@wisc.edu choicePredictorSize = Param.Unsigned(8192, "Size of choice predictor") 10310785Sgope@wisc.edu choiceCtrBits = Param.Unsigned(2, "Bits of choice counters") 10410785Sgope@wisc.edu 10513626Sjairo.balart@metempsy.comclass TAGEBase(SimObject): 10613626Sjairo.balart@metempsy.com type = 'TAGEBase' 10713626Sjairo.balart@metempsy.com cxx_class = 'TAGEBase' 10813626Sjairo.balart@metempsy.com cxx_header = "cpu/pred/tage_base.hh" 10913626Sjairo.balart@metempsy.com 11013626Sjairo.balart@metempsy.com numThreads = Param.Unsigned(Parent.numThreads, "Number of threads") 11113626Sjairo.balart@metempsy.com instShiftAmt = Param.Unsigned(Parent.instShiftAmt, 11213626Sjairo.balart@metempsy.com "Number of bits to shift instructions by") 11313454Spau.cabre@metempsy.com 11413454Spau.cabre@metempsy.com nHistoryTables = Param.Unsigned(7, "Number of history tables") 11513494Spau.cabre@metempsy.com minHist = Param.Unsigned(5, "Minimum history size of TAGE") 11613494Spau.cabre@metempsy.com maxHist = Param.Unsigned(130, "Maximum history size of TAGE") 11713454Spau.cabre@metempsy.com 11813454Spau.cabre@metempsy.com tagTableTagWidths = VectorParam.Unsigned( 11913454Spau.cabre@metempsy.com [0, 9, 9, 10, 10, 11, 11, 12], "Tag size in TAGE tag tables") 12013454Spau.cabre@metempsy.com logTagTableSizes = VectorParam.Int( 12113454Spau.cabre@metempsy.com [13, 9, 9, 9, 9, 9, 9, 9], "Log2 of TAGE table sizes") 12213454Spau.cabre@metempsy.com logRatioBiModalHystEntries = Param.Unsigned(2, 12313454Spau.cabre@metempsy.com "Log num of prediction entries for a shared hysteresis bit " \ 12413454Spau.cabre@metempsy.com "for the Bimodal") 12513454Spau.cabre@metempsy.com 12613454Spau.cabre@metempsy.com tagTableCounterBits = Param.Unsigned(3, "Number of tag table counter bits") 12713454Spau.cabre@metempsy.com tagTableUBits = Param.Unsigned(2, "Number of tag table u bits") 12813454Spau.cabre@metempsy.com 12913454Spau.cabre@metempsy.com histBufferSize = Param.Unsigned(2097152, 13013454Spau.cabre@metempsy.com "A large number to track all branch histories(2MEntries default)") 13113454Spau.cabre@metempsy.com 13213454Spau.cabre@metempsy.com pathHistBits = Param.Unsigned(16, "Path history size") 13313454Spau.cabre@metempsy.com logUResetPeriod = Param.Unsigned(18, 13413454Spau.cabre@metempsy.com "Log period in number of branches to reset TAGE useful counters") 13513626Sjairo.balart@metempsy.com numUseAltOnNa = Param.Unsigned(1, "Number of USE_ALT_ON_NA counters") 13614081Sjavier.bueno@metempsy.com initialTCounterValue = Param.Int(1 << 17, "Initial value of tCounter") 13713685Sjavier.bueno@metempsy.com useAltOnNaBits = Param.Unsigned(4, "Size of the USE_ALT_ON_NA counter(s)") 13813454Spau.cabre@metempsy.com 13913626Sjairo.balart@metempsy.com maxNumAlloc = Param.Unsigned(1, 14013626Sjairo.balart@metempsy.com "Max number of TAGE entries allocted on mispredict") 14113626Sjairo.balart@metempsy.com 14213626Sjairo.balart@metempsy.com # List of enabled TAGE tables. If empty, all are enabled 14313626Sjairo.balart@metempsy.com noSkip = VectorParam.Bool([], "Vector of enabled TAGE tables") 14413626Sjairo.balart@metempsy.com 14513626Sjairo.balart@metempsy.com speculativeHistUpdate = Param.Bool(True, 14613626Sjairo.balart@metempsy.com "Use speculative update for histories") 14713626Sjairo.balart@metempsy.com 14813626Sjairo.balart@metempsy.com# TAGE branch predictor as described in https://www.jilp.org/vol8/v8paper1.pdf 14913626Sjairo.balart@metempsy.com# The default sizes below are for the 8C-TAGE configuration (63.5 Kbits) 15013626Sjairo.balart@metempsy.comclass TAGE(BranchPredictor): 15113626Sjairo.balart@metempsy.com type = 'TAGE' 15213626Sjairo.balart@metempsy.com cxx_class = 'TAGE' 15313626Sjairo.balart@metempsy.com cxx_header = "cpu/pred/tage.hh" 15413626Sjairo.balart@metempsy.com tage = Param.TAGEBase(TAGEBase(), "Tage object") 15513626Sjairo.balart@metempsy.com 15613626Sjairo.balart@metempsy.comclass LTAGE_TAGE(TAGEBase): 15713626Sjairo.balart@metempsy.com nHistoryTables = 12 15813626Sjairo.balart@metempsy.com minHist = 4 15913626Sjairo.balart@metempsy.com maxHist = 640 16013626Sjairo.balart@metempsy.com tagTableTagWidths = [0, 7, 7, 8, 8, 9, 10, 11, 12, 12, 13, 14, 15] 16113626Sjairo.balart@metempsy.com logTagTableSizes = [14, 10, 10, 11, 11, 11, 11, 10, 10, 10, 10, 9, 9] 16213626Sjairo.balart@metempsy.com logUResetPeriod = 19 16313454Spau.cabre@metempsy.com 16413627Sjavier.bueno@metempsy.comclass LoopPredictor(SimObject): 16513627Sjavier.bueno@metempsy.com type = 'LoopPredictor' 16613627Sjavier.bueno@metempsy.com cxx_class = 'LoopPredictor' 16713627Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/loop_predictor.hh' 16813454Spau.cabre@metempsy.com 16911784Sarthur.perais@inria.fr logSizeLoopPred = Param.Unsigned(8, "Log size of the loop predictor") 17013444Spau.cabre@metempsy.com withLoopBits = Param.Unsigned(7, "Size of the WITHLOOP counter") 17113442Spau.cabre@metempsy.com loopTableAgeBits = Param.Unsigned(8, "Number of age bits per loop entry") 17213442Spau.cabre@metempsy.com loopTableConfidenceBits = Param.Unsigned(2, 17313442Spau.cabre@metempsy.com "Number of confidence bits per loop entry") 17413442Spau.cabre@metempsy.com loopTableTagBits = Param.Unsigned(14, "Number of tag bits per loop entry") 17513442Spau.cabre@metempsy.com loopTableIterBits = Param.Unsigned(14, "Nuber of iteration bits per loop") 17613444Spau.cabre@metempsy.com logLoopTableAssoc = Param.Unsigned(2, "Log loop predictor associativity") 17713442Spau.cabre@metempsy.com 17813493Spau.cabre@metempsy.com # Parameters for enabling modifications to the loop predictor 17913627Sjavier.bueno@metempsy.com # They have been copied from TAGE-GSC-IMLI 18013627Sjavier.bueno@metempsy.com # (http://www.irisa.fr/alf/downloads/seznec/TAGE-GSC-IMLI.tar) 18113493Spau.cabre@metempsy.com # 18213493Spau.cabre@metempsy.com # All of them should be disabled to match the original LTAGE implementation 18313493Spau.cabre@metempsy.com # (http://hpca23.cse.tamu.edu/taco/camino/cbp2/cbp-src/realistic-seznec.h) 18413493Spau.cabre@metempsy.com 18513493Spau.cabre@metempsy.com # Add speculation 18613493Spau.cabre@metempsy.com useSpeculation = Param.Bool(False, "Use speculation") 18713493Spau.cabre@metempsy.com 18813493Spau.cabre@metempsy.com # Add hashing for calculating the loop table index 18913493Spau.cabre@metempsy.com useHashing = Param.Bool(False, "Use hashing") 19013493Spau.cabre@metempsy.com 19113493Spau.cabre@metempsy.com # Add a direction bit to the loop table entries 19213493Spau.cabre@metempsy.com useDirectionBit = Param.Bool(False, "Use direction info") 19313493Spau.cabre@metempsy.com 19413627Sjavier.bueno@metempsy.com # If true, use random to decide whether to allocate or not, and only try 19513627Sjavier.bueno@metempsy.com # with one entry 19613627Sjavier.bueno@metempsy.com restrictAllocation = Param.Bool(False, 19713627Sjavier.bueno@metempsy.com "Restrict the allocation conditions") 19813627Sjavier.bueno@metempsy.com 19913627Sjavier.bueno@metempsy.com initialLoopIter = Param.Unsigned(1, "Initial iteration number") 20013627Sjavier.bueno@metempsy.com initialLoopAge = Param.Unsigned(255, "Initial age value") 20113627Sjavier.bueno@metempsy.com optionalAgeReset = Param.Bool(True, 20213627Sjavier.bueno@metempsy.com "Reset age bits optionally in some cases") 20313627Sjavier.bueno@metempsy.com 20413685Sjavier.bueno@metempsy.comclass TAGE_SC_L_TAGE(TAGEBase): 20513685Sjavier.bueno@metempsy.com type = 'TAGE_SC_L_TAGE' 20613685Sjavier.bueno@metempsy.com cxx_class = 'TAGE_SC_L_TAGE' 20713685Sjavier.bueno@metempsy.com cxx_header = "cpu/pred/tage_sc_l.hh" 20813685Sjavier.bueno@metempsy.com abstract = True 20913685Sjavier.bueno@metempsy.com tagTableTagWidths = [0] 21013685Sjavier.bueno@metempsy.com numUseAltOnNa = 16 21113685Sjavier.bueno@metempsy.com pathHistBits = 27 21213685Sjavier.bueno@metempsy.com maxNumAlloc = 2 21313685Sjavier.bueno@metempsy.com logUResetPeriod = 10 21414081Sjavier.bueno@metempsy.com initialTCounterValue = 1 << 9 21513685Sjavier.bueno@metempsy.com useAltOnNaBits = 5 21613685Sjavier.bueno@metempsy.com # TODO No speculation implemented as of now 21713685Sjavier.bueno@metempsy.com speculativeHistUpdate = False 21813685Sjavier.bueno@metempsy.com 21913685Sjavier.bueno@metempsy.com # This size does not set the final sizes of the tables (it is just used 22013685Sjavier.bueno@metempsy.com # for some calculations) 22113685Sjavier.bueno@metempsy.com # Instead, the number of TAGE entries comes from shortTagsTageEntries and 22213685Sjavier.bueno@metempsy.com # longTagsTageEntries 22313685Sjavier.bueno@metempsy.com logTagTableSize = Param.Unsigned("Log size of each tag table") 22413685Sjavier.bueno@metempsy.com 22513685Sjavier.bueno@metempsy.com shortTagsTageFactor = Param.Unsigned( 22613685Sjavier.bueno@metempsy.com "Factor for calculating the total number of short tags TAGE entries") 22713685Sjavier.bueno@metempsy.com 22813685Sjavier.bueno@metempsy.com longTagsTageFactor = Param.Unsigned( 22913685Sjavier.bueno@metempsy.com "Factor for calculating the total number of long tags TAGE entries") 23013685Sjavier.bueno@metempsy.com 23113685Sjavier.bueno@metempsy.com shortTagsSize = Param.Unsigned(8, "Size of the short tags") 23213685Sjavier.bueno@metempsy.com 23313685Sjavier.bueno@metempsy.com longTagsSize = Param.Unsigned("Size of the long tags") 23413685Sjavier.bueno@metempsy.com 23513685Sjavier.bueno@metempsy.com firstLongTagTable = Param.Unsigned("First table with long tags") 23613685Sjavier.bueno@metempsy.com 23713685Sjavier.bueno@metempsy.com truncatePathHist = Param.Bool(True, 23813685Sjavier.bueno@metempsy.com "Truncate the path history to its configured size") 23913685Sjavier.bueno@metempsy.com 24013685Sjavier.bueno@metempsy.com 24113685Sjavier.bueno@metempsy.comclass TAGE_SC_L_TAGE_64KB(TAGE_SC_L_TAGE): 24213685Sjavier.bueno@metempsy.com type = 'TAGE_SC_L_TAGE_64KB' 24313685Sjavier.bueno@metempsy.com cxx_class = 'TAGE_SC_L_TAGE_64KB' 24413685Sjavier.bueno@metempsy.com cxx_header = "cpu/pred/tage_sc_l_64KB.hh" 24513685Sjavier.bueno@metempsy.com nHistoryTables = 36 24613685Sjavier.bueno@metempsy.com 24713685Sjavier.bueno@metempsy.com minHist = 6 24813685Sjavier.bueno@metempsy.com maxHist = 3000 24913685Sjavier.bueno@metempsy.com 25013685Sjavier.bueno@metempsy.com tagTableUBits = 1 25113685Sjavier.bueno@metempsy.com 25213685Sjavier.bueno@metempsy.com logTagTableSizes = [13] 25313685Sjavier.bueno@metempsy.com 25413685Sjavier.bueno@metempsy.com # This is used to handle the 2-way associativity 25513685Sjavier.bueno@metempsy.com # (all odd entries are set to one, and if the corresponding even entry 25613685Sjavier.bueno@metempsy.com # is set to one, then there is a 2-way associativity for this pair) 25713685Sjavier.bueno@metempsy.com # Entry 0 is for the bimodal and it is ignored 25813685Sjavier.bueno@metempsy.com # Note: For this implementation, some odd entries are also set to 0 to save 25913685Sjavier.bueno@metempsy.com # some bits 26013685Sjavier.bueno@metempsy.com noSkip = [0,0,1,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1, 26113685Sjavier.bueno@metempsy.com 1,1,1,1,0,1,0,1,0,1,0,0,0,1,0,0,0,1] 26213685Sjavier.bueno@metempsy.com 26313685Sjavier.bueno@metempsy.com logTagTableSize = 10 26413685Sjavier.bueno@metempsy.com shortTagsTageFactor = 10 26513685Sjavier.bueno@metempsy.com longTagsTageFactor = 20 26613685Sjavier.bueno@metempsy.com 26713685Sjavier.bueno@metempsy.com longTagsSize = 12 26813685Sjavier.bueno@metempsy.com 26913685Sjavier.bueno@metempsy.com firstLongTagTable = 13 27013685Sjavier.bueno@metempsy.com 27113685Sjavier.bueno@metempsy.comclass TAGE_SC_L_TAGE_8KB(TAGE_SC_L_TAGE): 27213685Sjavier.bueno@metempsy.com type = 'TAGE_SC_L_TAGE_8KB' 27313685Sjavier.bueno@metempsy.com cxx_class = 'TAGE_SC_L_TAGE_8KB' 27413685Sjavier.bueno@metempsy.com cxx_header = "cpu/pred/tage_sc_l_8KB.hh" 27513685Sjavier.bueno@metempsy.com 27613685Sjavier.bueno@metempsy.com nHistoryTables = 30 27713685Sjavier.bueno@metempsy.com 27813685Sjavier.bueno@metempsy.com minHist = 4 27913685Sjavier.bueno@metempsy.com maxHist = 1000 28013685Sjavier.bueno@metempsy.com 28113685Sjavier.bueno@metempsy.com logTagTableSize = 7 28213685Sjavier.bueno@metempsy.com shortTagsTageFactor = 9 28313685Sjavier.bueno@metempsy.com longTagsTageFactor = 17 28413685Sjavier.bueno@metempsy.com longTagsSize = 12 28513685Sjavier.bueno@metempsy.com 28613685Sjavier.bueno@metempsy.com logTagTableSizes = [12] 28713685Sjavier.bueno@metempsy.com 28813685Sjavier.bueno@metempsy.com firstLongTagTable = 11 28913685Sjavier.bueno@metempsy.com 29013685Sjavier.bueno@metempsy.com truncatePathHist = False 29113685Sjavier.bueno@metempsy.com 29213685Sjavier.bueno@metempsy.com noSkip = [0,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1] 29313685Sjavier.bueno@metempsy.com 29413685Sjavier.bueno@metempsy.com tagTableUBits = 2 29513627Sjavier.bueno@metempsy.com 29613627Sjavier.bueno@metempsy.com# LTAGE branch predictor as described in 29713627Sjavier.bueno@metempsy.com# https://www.irisa.fr/caps/people/seznec/L-TAGE.pdf 29813627Sjavier.bueno@metempsy.com# It is basically a TAGE predictor plus a loop predictor 29913627Sjavier.bueno@metempsy.com# The differnt TAGE sizes are updated according to the paper values (256 Kbits) 30013627Sjavier.bueno@metempsy.comclass LTAGE(TAGE): 30113627Sjavier.bueno@metempsy.com type = 'LTAGE' 30213627Sjavier.bueno@metempsy.com cxx_class = 'LTAGE' 30313627Sjavier.bueno@metempsy.com cxx_header = "cpu/pred/ltage.hh" 30413627Sjavier.bueno@metempsy.com 30513627Sjavier.bueno@metempsy.com tage = LTAGE_TAGE() 30613685Sjavier.bueno@metempsy.com 30713627Sjavier.bueno@metempsy.com loop_predictor = Param.LoopPredictor(LoopPredictor(), "Loop predictor") 30813685Sjavier.bueno@metempsy.com 30913685Sjavier.bueno@metempsy.comclass TAGE_SC_L_LoopPredictor(LoopPredictor): 31013685Sjavier.bueno@metempsy.com type = 'TAGE_SC_L_LoopPredictor' 31113685Sjavier.bueno@metempsy.com cxx_class = 'TAGE_SC_L_LoopPredictor' 31213685Sjavier.bueno@metempsy.com cxx_header = "cpu/pred/tage_sc_l.hh" 31313685Sjavier.bueno@metempsy.com loopTableAgeBits = 4 31413685Sjavier.bueno@metempsy.com loopTableConfidenceBits = 4 31513685Sjavier.bueno@metempsy.com loopTableTagBits = 10 31613685Sjavier.bueno@metempsy.com loopTableIterBits = 10 31713685Sjavier.bueno@metempsy.com useSpeculation = False 31813685Sjavier.bueno@metempsy.com useHashing = True 31913685Sjavier.bueno@metempsy.com useDirectionBit = True 32013685Sjavier.bueno@metempsy.com restrictAllocation = True 32113685Sjavier.bueno@metempsy.com initialLoopIter = 0 32213685Sjavier.bueno@metempsy.com initialLoopAge = 7 32313685Sjavier.bueno@metempsy.com optionalAgeReset = False 32413685Sjavier.bueno@metempsy.com 32513685Sjavier.bueno@metempsy.comclass StatisticalCorrector(SimObject): 32613685Sjavier.bueno@metempsy.com type = 'StatisticalCorrector' 32713685Sjavier.bueno@metempsy.com cxx_class = 'StatisticalCorrector' 32813685Sjavier.bueno@metempsy.com cxx_header = "cpu/pred/statistical_corrector.hh" 32913685Sjavier.bueno@metempsy.com abstract = True 33013685Sjavier.bueno@metempsy.com 33113685Sjavier.bueno@metempsy.com # Statistical corrector parameters 33213685Sjavier.bueno@metempsy.com 33313685Sjavier.bueno@metempsy.com numEntriesFirstLocalHistories = Param.Unsigned( 33413685Sjavier.bueno@metempsy.com "Number of entries for first local histories") 33513685Sjavier.bueno@metempsy.com 33613685Sjavier.bueno@metempsy.com bwnb = Param.Unsigned("Num global backward branch GEHL lengths") 33713685Sjavier.bueno@metempsy.com bwm = VectorParam.Int("Global backward branch GEHL lengths") 33813685Sjavier.bueno@metempsy.com logBwnb = Param.Unsigned("Log num of global backward branch GEHL entries") 33914081Sjavier.bueno@metempsy.com bwWeightInitValue = Param.Int( 34014081Sjavier.bueno@metempsy.com "Initial value of the weights of the global backward branch GEHL entries") 34113685Sjavier.bueno@metempsy.com 34213685Sjavier.bueno@metempsy.com lnb = Param.Unsigned("Num first local history GEHL lenghts") 34313685Sjavier.bueno@metempsy.com lm = VectorParam.Int("First local history GEHL lengths") 34413685Sjavier.bueno@metempsy.com logLnb = Param.Unsigned("Log number of first local history GEHL entries") 34514081Sjavier.bueno@metempsy.com lWeightInitValue = Param.Int( 34614081Sjavier.bueno@metempsy.com "Initial value of the weights of the first local history GEHL entries") 34713685Sjavier.bueno@metempsy.com 34813685Sjavier.bueno@metempsy.com inb = Param.Unsigned(1, "Num IMLI GEHL lenghts") 34913685Sjavier.bueno@metempsy.com im = VectorParam.Int([8], "IMLI history GEHL lengths") 35013685Sjavier.bueno@metempsy.com logInb = Param.Unsigned("Log number of IMLI GEHL entries") 35114081Sjavier.bueno@metempsy.com iWeightInitValue = Param.Int( 35214081Sjavier.bueno@metempsy.com "Initial value of the weights of the IMLI history GEHL entries") 35313685Sjavier.bueno@metempsy.com 35413685Sjavier.bueno@metempsy.com logBias = Param.Unsigned("Log size of Bias tables") 35513685Sjavier.bueno@metempsy.com 35613685Sjavier.bueno@metempsy.com logSizeUp = Param.Unsigned(6, 35713685Sjavier.bueno@metempsy.com "Log size of update threshold counters tables") 35813685Sjavier.bueno@metempsy.com 35913685Sjavier.bueno@metempsy.com chooserConfWidth = Param.Unsigned(7, 36013685Sjavier.bueno@metempsy.com "Number of bits for the chooser counters") 36113685Sjavier.bueno@metempsy.com 36213685Sjavier.bueno@metempsy.com updateThresholdWidth = Param.Unsigned(12, 36313685Sjavier.bueno@metempsy.com "Number of bits for the update threshold counter") 36413685Sjavier.bueno@metempsy.com 36513685Sjavier.bueno@metempsy.com pUpdateThresholdWidth = Param.Unsigned(8, 36613685Sjavier.bueno@metempsy.com "Number of bits for the pUpdate threshold counters") 36713685Sjavier.bueno@metempsy.com 36813685Sjavier.bueno@metempsy.com extraWeightsWidth = Param.Unsigned(6, 36913685Sjavier.bueno@metempsy.com "Number of bits for the extra weights") 37013685Sjavier.bueno@metempsy.com 37113685Sjavier.bueno@metempsy.com scCountersWidth = Param.Unsigned(6, "Statistical corrector counters width") 37213685Sjavier.bueno@metempsy.com 37314081Sjavier.bueno@metempsy.com initialUpdateThresholdValue = Param.Int(0, 37414081Sjavier.bueno@metempsy.com "Initial pUpdate threshold counter value") 37514081Sjavier.bueno@metempsy.com 37613685Sjavier.bueno@metempsy.com# TAGE-SC-L branch predictor as desribed in 37713685Sjavier.bueno@metempsy.com# https://www.jilp.org/cbp2016/paper/AndreSeznecLimited.pdf 37813685Sjavier.bueno@metempsy.com# It is a modified LTAGE predictor plus a statistical corrector predictor 37913685Sjavier.bueno@metempsy.com# The TAGE modifications include bank interleaving and partial associativity 38013685Sjavier.bueno@metempsy.com# Two different sizes are proposed in the paper: 38113685Sjavier.bueno@metempsy.com# 8KB => See TAGE_SC_L_8KB below 38213685Sjavier.bueno@metempsy.com# 64KB => See TAGE_SC_L_64KB below 38313685Sjavier.bueno@metempsy.com# The TAGE_SC_L_8KB and TAGE_SC_L_64KB classes differ not only on the values 38413685Sjavier.bueno@metempsy.com# of some parameters, but also in some implementation details 38513685Sjavier.bueno@metempsy.com# Given this, the TAGE_SC_L class is left abstract 38613685Sjavier.bueno@metempsy.com# Note that as it is now, this branch predictor does not handle any type 38713685Sjavier.bueno@metempsy.com# of speculation: All the structures/histories are updated at commit time 38813685Sjavier.bueno@metempsy.comclass TAGE_SC_L(LTAGE): 38913685Sjavier.bueno@metempsy.com type = 'TAGE_SC_L' 39013685Sjavier.bueno@metempsy.com cxx_class = 'TAGE_SC_L' 39113685Sjavier.bueno@metempsy.com cxx_header = "cpu/pred/tage_sc_l.hh" 39213685Sjavier.bueno@metempsy.com abstract = True 39313685Sjavier.bueno@metempsy.com 39413685Sjavier.bueno@metempsy.com statistical_corrector = Param.StatisticalCorrector( 39513685Sjavier.bueno@metempsy.com "Statistical Corrector") 39613685Sjavier.bueno@metempsy.com 39713685Sjavier.bueno@metempsy.comclass TAGE_SC_L_64KB_LoopPredictor(TAGE_SC_L_LoopPredictor): 39813685Sjavier.bueno@metempsy.com logSizeLoopPred = 5 39913685Sjavier.bueno@metempsy.com 40013685Sjavier.bueno@metempsy.comclass TAGE_SC_L_8KB_LoopPredictor(TAGE_SC_L_LoopPredictor): 40113685Sjavier.bueno@metempsy.com logSizeLoopPred = 3 40213685Sjavier.bueno@metempsy.com 40313685Sjavier.bueno@metempsy.comclass TAGE_SC_L_64KB_StatisticalCorrector(StatisticalCorrector): 40413685Sjavier.bueno@metempsy.com type = 'TAGE_SC_L_64KB_StatisticalCorrector' 40513685Sjavier.bueno@metempsy.com cxx_class = 'TAGE_SC_L_64KB_StatisticalCorrector' 40613685Sjavier.bueno@metempsy.com cxx_header = "cpu/pred/tage_sc_l_64KB.hh" 40713685Sjavier.bueno@metempsy.com 40813685Sjavier.bueno@metempsy.com pnb = Param.Unsigned(3, "Num variation global branch GEHL lengths") 40913685Sjavier.bueno@metempsy.com pm = VectorParam.Int([25, 16, 9], "Variation global branch GEHL lengths") 41013685Sjavier.bueno@metempsy.com logPnb = Param.Unsigned(9, 41113685Sjavier.bueno@metempsy.com "Log number of variation global branch GEHL entries") 41213685Sjavier.bueno@metempsy.com 41313685Sjavier.bueno@metempsy.com snb = Param.Unsigned(3, "Num second local history GEHL lenghts") 41413685Sjavier.bueno@metempsy.com sm = VectorParam.Int([16, 11, 6], "Second local history GEHL lengths") 41513685Sjavier.bueno@metempsy.com logSnb = Param.Unsigned(9, 41613685Sjavier.bueno@metempsy.com "Log number of second local history GEHL entries") 41713685Sjavier.bueno@metempsy.com 41813685Sjavier.bueno@metempsy.com tnb = Param.Unsigned(2, "Num third local history GEHL lenghts") 41913685Sjavier.bueno@metempsy.com tm = VectorParam.Int([9, 4], "Third local history GEHL lengths") 42013685Sjavier.bueno@metempsy.com logTnb = Param.Unsigned(10, 42113685Sjavier.bueno@metempsy.com "Log number of third local history GEHL entries") 42213685Sjavier.bueno@metempsy.com 42313685Sjavier.bueno@metempsy.com imnb = Param.Unsigned(2, "Num second IMLI GEHL lenghts") 42413685Sjavier.bueno@metempsy.com imm = VectorParam.Int([10, 4], "Second IMLI history GEHL lengths") 42513685Sjavier.bueno@metempsy.com logImnb = Param.Unsigned(9, "Log number of second IMLI GEHL entries") 42613685Sjavier.bueno@metempsy.com 42713685Sjavier.bueno@metempsy.com numEntriesSecondLocalHistories = Param.Unsigned(16, 42813685Sjavier.bueno@metempsy.com "Number of entries for second local histories") 42913685Sjavier.bueno@metempsy.com numEntriesThirdLocalHistories = Param.Unsigned(16, 43013685Sjavier.bueno@metempsy.com "Number of entries for second local histories") 43113685Sjavier.bueno@metempsy.com 43213685Sjavier.bueno@metempsy.com numEntriesFirstLocalHistories = 256 43313685Sjavier.bueno@metempsy.com 43413685Sjavier.bueno@metempsy.com logBias = 8 43513685Sjavier.bueno@metempsy.com 43613685Sjavier.bueno@metempsy.com bwnb = 3 43713685Sjavier.bueno@metempsy.com bwm = [40, 24, 10] 43813685Sjavier.bueno@metempsy.com logBwnb = 10 43914081Sjavier.bueno@metempsy.com bwWeightInitValue = 7 44013685Sjavier.bueno@metempsy.com 44113685Sjavier.bueno@metempsy.com lnb = 3 44213685Sjavier.bueno@metempsy.com lm = [11, 6, 3] 44313685Sjavier.bueno@metempsy.com logLnb = 10 44414081Sjavier.bueno@metempsy.com lWeightInitValue = 7 44513685Sjavier.bueno@metempsy.com 44613685Sjavier.bueno@metempsy.com logInb = 8 44714081Sjavier.bueno@metempsy.com iWeightInitValue = 7 44813685Sjavier.bueno@metempsy.com 44913685Sjavier.bueno@metempsy.comclass TAGE_SC_L_8KB_StatisticalCorrector(StatisticalCorrector): 45013685Sjavier.bueno@metempsy.com type = 'TAGE_SC_L_8KB_StatisticalCorrector' 45113685Sjavier.bueno@metempsy.com cxx_class = 'TAGE_SC_L_8KB_StatisticalCorrector' 45213685Sjavier.bueno@metempsy.com cxx_header = "cpu/pred/tage_sc_l_8KB.hh" 45313685Sjavier.bueno@metempsy.com gnb = Param.Unsigned(2, "Num global branch GEHL lengths") 45413685Sjavier.bueno@metempsy.com gm = VectorParam.Int([6, 3], "Global branch GEHL lengths") 45513685Sjavier.bueno@metempsy.com logGnb = Param.Unsigned(7, "Log number of global branch GEHL entries") 45613685Sjavier.bueno@metempsy.com 45713685Sjavier.bueno@metempsy.com numEntriesFirstLocalHistories = 64 45813685Sjavier.bueno@metempsy.com 45913685Sjavier.bueno@metempsy.com logBias = 7 46013685Sjavier.bueno@metempsy.com 46113685Sjavier.bueno@metempsy.com bwnb = 2 46213685Sjavier.bueno@metempsy.com logBwnb = 7 46313685Sjavier.bueno@metempsy.com bwm = [16, 8] 46414081Sjavier.bueno@metempsy.com bwWeightInitValue = 7 46513685Sjavier.bueno@metempsy.com 46613685Sjavier.bueno@metempsy.com lnb = 2 46713685Sjavier.bueno@metempsy.com logLnb = 7 46813685Sjavier.bueno@metempsy.com lm = [6, 3] 46914081Sjavier.bueno@metempsy.com lWeightInitValue = 7 47013685Sjavier.bueno@metempsy.com 47113685Sjavier.bueno@metempsy.com logInb = 7 47214081Sjavier.bueno@metempsy.com iWeightInitValue = 7 47313685Sjavier.bueno@metempsy.com 47413685Sjavier.bueno@metempsy.com# 64KB TAGE-SC-L branch predictor as described in 47513685Sjavier.bueno@metempsy.com# http://www.jilp.org/cbp2016/paper/AndreSeznecLimited.pdf 47613685Sjavier.bueno@metempsy.comclass TAGE_SC_L_64KB(TAGE_SC_L): 47713685Sjavier.bueno@metempsy.com type = 'TAGE_SC_L_64KB' 47813685Sjavier.bueno@metempsy.com cxx_class = 'TAGE_SC_L_64KB' 47913685Sjavier.bueno@metempsy.com cxx_header = "cpu/pred/tage_sc_l_64KB.hh" 48013685Sjavier.bueno@metempsy.com 48113685Sjavier.bueno@metempsy.com tage = TAGE_SC_L_TAGE_64KB() 48213685Sjavier.bueno@metempsy.com loop_predictor = TAGE_SC_L_64KB_LoopPredictor() 48313685Sjavier.bueno@metempsy.com statistical_corrector = TAGE_SC_L_64KB_StatisticalCorrector() 48413685Sjavier.bueno@metempsy.com 48513685Sjavier.bueno@metempsy.com# 8KB TAGE-SC-L branch predictor as described in 48613685Sjavier.bueno@metempsy.com# http://www.jilp.org/cbp2016/paper/AndreSeznecLimited.pdf 48713685Sjavier.bueno@metempsy.comclass TAGE_SC_L_8KB(TAGE_SC_L): 48813685Sjavier.bueno@metempsy.com type = 'TAGE_SC_L_8KB' 48913685Sjavier.bueno@metempsy.com cxx_class = 'TAGE_SC_L_8KB' 49013685Sjavier.bueno@metempsy.com cxx_header = "cpu/pred/tage_sc_l_8KB.hh" 49113685Sjavier.bueno@metempsy.com 49213685Sjavier.bueno@metempsy.com tage = TAGE_SC_L_TAGE_8KB() 49313685Sjavier.bueno@metempsy.com loop_predictor = TAGE_SC_L_8KB_LoopPredictor() 49413685Sjavier.bueno@metempsy.com statistical_corrector = TAGE_SC_L_8KB_StatisticalCorrector() 49514034Sjavier.bueno@metempsy.com 49614034Sjavier.bueno@metempsy.comclass MultiperspectivePerceptron(BranchPredictor): 49714034Sjavier.bueno@metempsy.com type = 'MultiperspectivePerceptron' 49814034Sjavier.bueno@metempsy.com cxx_class = 'MultiperspectivePerceptron' 49914034Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron.hh' 50014034Sjavier.bueno@metempsy.com abstract = True 50114034Sjavier.bueno@metempsy.com 50214034Sjavier.bueno@metempsy.com num_filter_entries = Param.Int("Number of filter entries") 50314034Sjavier.bueno@metempsy.com num_local_histories = Param.Int("Number of local history entries") 50414034Sjavier.bueno@metempsy.com local_history_length = Param.Int(11, 50514034Sjavier.bueno@metempsy.com "Length in bits of each history entry") 50614034Sjavier.bueno@metempsy.com 50714034Sjavier.bueno@metempsy.com block_size = Param.Int(21, 50814034Sjavier.bueno@metempsy.com "number of ghist bits in a 'block'; this is the width of an initial " 50914034Sjavier.bueno@metempsy.com "hash of ghist") 51014034Sjavier.bueno@metempsy.com pcshift = Param.Int(-10, "Shift for hashing PC") 51114034Sjavier.bueno@metempsy.com threshold = Param.Int(1, "Threshold for deciding low/high confidence") 51214034Sjavier.bueno@metempsy.com bias0 = Param.Int(-5, 51314034Sjavier.bueno@metempsy.com "Bias perceptron output this much on all-bits-zero local history") 51414034Sjavier.bueno@metempsy.com bias1 = Param.Int(5, 51514034Sjavier.bueno@metempsy.com "Bias perceptron output this much on all-bits-one local history") 51614034Sjavier.bueno@metempsy.com biasmostly0 = Param.Int(-1, 51714034Sjavier.bueno@metempsy.com "Bias perceptron output this much on almost-all-bits-zero local " 51814034Sjavier.bueno@metempsy.com "history") 51914034Sjavier.bueno@metempsy.com biasmostly1 = Param.Int(1, 52014034Sjavier.bueno@metempsy.com "Bias perceptron output this much on almost-all-bits-one local " 52114034Sjavier.bueno@metempsy.com "history") 52214034Sjavier.bueno@metempsy.com nbest = Param.Int(20, 52314034Sjavier.bueno@metempsy.com "Use this many of the top performing tables on a low-confidence " 52414034Sjavier.bueno@metempsy.com "branch") 52514034Sjavier.bueno@metempsy.com tunebits = Param.Int(24, "Number of bits in misprediction counters") 52614034Sjavier.bueno@metempsy.com hshift = Param.Int(-6, 52714034Sjavier.bueno@metempsy.com "How much to shift initial feauture hash before XORing with PC bits") 52814034Sjavier.bueno@metempsy.com imli_mask1 = Param.UInt64( 52914034Sjavier.bueno@metempsy.com "Which tables should have their indices hashed with the first IMLI " 53014034Sjavier.bueno@metempsy.com "counter") 53114034Sjavier.bueno@metempsy.com imli_mask4 = Param.UInt64( 53214034Sjavier.bueno@metempsy.com "Which tables should have their indices hashed with the fourth IMLI " 53314034Sjavier.bueno@metempsy.com "counter") 53414034Sjavier.bueno@metempsy.com recencypos_mask = Param.UInt64( 53514034Sjavier.bueno@metempsy.com "Which tables should have their indices hashed with the recency " 53614034Sjavier.bueno@metempsy.com "position") 53714034Sjavier.bueno@metempsy.com fudge = Param.Float(0.245, "Fudge factor to multiply by perceptron output") 53814034Sjavier.bueno@metempsy.com n_sign_bits = Param.Int(2, "Number of sign bits per magnitude") 53914034Sjavier.bueno@metempsy.com pcbit = Param.Int(2, "Bit from the PC to use for hashing global history") 54014034Sjavier.bueno@metempsy.com decay = Param.Int(0, "Whether and how often to decay a random weight") 54114034Sjavier.bueno@metempsy.com record_mask = Param.Int(191, 54214034Sjavier.bueno@metempsy.com "Which histories are updated with filtered branch outcomes") 54314034Sjavier.bueno@metempsy.com hash_taken = Param.Bool(False, 54414034Sjavier.bueno@metempsy.com "Hash the taken/not taken value with a PC bit") 54514034Sjavier.bueno@metempsy.com tuneonly = Param.Bool(True, 54614034Sjavier.bueno@metempsy.com "If true, only count mispredictions of low-confidence branches") 54714034Sjavier.bueno@metempsy.com extra_rounds = Param.Int(1, 54814034Sjavier.bueno@metempsy.com "Number of extra rounds of training a single weight on a " 54914034Sjavier.bueno@metempsy.com "low-confidence prediction") 55014034Sjavier.bueno@metempsy.com speed = Param.Int(9, "Adaptive theta learning speed") 55114034Sjavier.bueno@metempsy.com initial_theta = Param.Int(10, "Initial theta") 55214034Sjavier.bueno@metempsy.com budgetbits = Param.Int("Hardware budget in bits") 55314034Sjavier.bueno@metempsy.com speculative_update = Param.Bool(False, 55414034Sjavier.bueno@metempsy.com "Use speculative update for histories") 55514034Sjavier.bueno@metempsy.com 55614081Sjavier.bueno@metempsy.com initial_ghist_length = Param.Int(1, "Initial GHist length value") 55714081Sjavier.bueno@metempsy.com ignore_path_size = Param.Bool(False, "Ignore the path storage") 55814081Sjavier.bueno@metempsy.com 55914034Sjavier.bueno@metempsy.comclass MultiperspectivePerceptron8KB(MultiperspectivePerceptron): 56014034Sjavier.bueno@metempsy.com type = 'MultiperspectivePerceptron8KB' 56114034Sjavier.bueno@metempsy.com cxx_class = 'MultiperspectivePerceptron8KB' 56214034Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron_8KB.hh' 56314034Sjavier.bueno@metempsy.com budgetbits = 8192 * 8 + 2048 56414034Sjavier.bueno@metempsy.com num_local_histories = 48 56514034Sjavier.bueno@metempsy.com num_filter_entries = 0 56614034Sjavier.bueno@metempsy.com imli_mask1 = 0x6 56714034Sjavier.bueno@metempsy.com imli_mask4 = 0x4400 56814034Sjavier.bueno@metempsy.com recencypos_mask = 0x100000090 56914034Sjavier.bueno@metempsy.com 57014034Sjavier.bueno@metempsy.comclass MultiperspectivePerceptron64KB(MultiperspectivePerceptron): 57114034Sjavier.bueno@metempsy.com type = 'MultiperspectivePerceptron64KB' 57214034Sjavier.bueno@metempsy.com cxx_class = 'MultiperspectivePerceptron64KB' 57314034Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron_64KB.hh' 57414034Sjavier.bueno@metempsy.com budgetbits = 65536 * 8 + 2048 57514034Sjavier.bueno@metempsy.com num_local_histories = 510 57614034Sjavier.bueno@metempsy.com num_filter_entries = 18025 57714034Sjavier.bueno@metempsy.com imli_mask1 = 0xc1000 57814034Sjavier.bueno@metempsy.com imli_mask4 = 0x80008000 57914034Sjavier.bueno@metempsy.com recencypos_mask = 0x100000090 58014081Sjavier.bueno@metempsy.com 58114081Sjavier.bueno@metempsy.comclass MPP_TAGE(TAGEBase): 58214081Sjavier.bueno@metempsy.com type = 'MPP_TAGE' 58314081Sjavier.bueno@metempsy.com cxx_class = 'MPP_TAGE' 58414081Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron_tage.hh' 58514081Sjavier.bueno@metempsy.com nHistoryTables = 15 58614081Sjavier.bueno@metempsy.com pathHistBits = 27 58714081Sjavier.bueno@metempsy.com instShiftAmt = 0 58814081Sjavier.bueno@metempsy.com histBufferSize = 16384 58914081Sjavier.bueno@metempsy.com maxHist = 4096; 59014081Sjavier.bueno@metempsy.com tagTableTagWidths = [0, 7, 9, 9, 9, 10, 11, 11, 12, 12, 59114081Sjavier.bueno@metempsy.com 12, 13, 14, 15, 15, 15] 59214081Sjavier.bueno@metempsy.com logTagTableSizes = [14, 10, 11, 11, 11, 11, 11, 12, 12, 59314081Sjavier.bueno@metempsy.com 10, 11, 11, 9, 7, 7, 8] 59414081Sjavier.bueno@metempsy.com tunedHistoryLengths = VectorParam.Unsigned([0, 5, 12, 15, 21, 31, 43, 64, 59514081Sjavier.bueno@metempsy.com 93, 137, 200, 292, 424, 612, 877, 1241], "Tuned history lengths") 59614081Sjavier.bueno@metempsy.com 59714081Sjavier.bueno@metempsy.com logUResetPeriod = 10 59814081Sjavier.bueno@metempsy.com initialTCounterValue = 0 59914081Sjavier.bueno@metempsy.com numUseAltOnNa = 512 60014081Sjavier.bueno@metempsy.com speculativeHistUpdate = False 60114081Sjavier.bueno@metempsy.com 60214081Sjavier.bueno@metempsy.comclass MPP_LoopPredictor(LoopPredictor): 60314081Sjavier.bueno@metempsy.com type = 'MPP_LoopPredictor' 60414081Sjavier.bueno@metempsy.com cxx_class = 'MPP_LoopPredictor' 60514081Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron_tage.hh' 60614081Sjavier.bueno@metempsy.com useDirectionBit = True 60714081Sjavier.bueno@metempsy.com useHashing = True 60814081Sjavier.bueno@metempsy.com useSpeculation = False 60914081Sjavier.bueno@metempsy.com loopTableConfidenceBits = 4 61014081Sjavier.bueno@metempsy.com loopTableAgeBits = 4 61114081Sjavier.bueno@metempsy.com initialLoopAge = 7 61214081Sjavier.bueno@metempsy.com initialLoopIter = 0 61314081Sjavier.bueno@metempsy.com loopTableIterBits = 12 61414081Sjavier.bueno@metempsy.com optionalAgeReset = False 61514081Sjavier.bueno@metempsy.com restrictAllocation = True 61614081Sjavier.bueno@metempsy.com logSizeLoopPred = 6 61714081Sjavier.bueno@metempsy.com loopTableTagBits = 10 61814081Sjavier.bueno@metempsy.com 61914081Sjavier.bueno@metempsy.comclass MPP_StatisticalCorrector(StatisticalCorrector): 62014081Sjavier.bueno@metempsy.com type = 'MPP_StatisticalCorrector' 62114081Sjavier.bueno@metempsy.com cxx_class = 'MPP_StatisticalCorrector' 62214081Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron_tage.hh' 62314081Sjavier.bueno@metempsy.com abstract = True 62414081Sjavier.bueno@metempsy.com 62514081Sjavier.bueno@metempsy.com # Unused in this Statistical Corrector 62614081Sjavier.bueno@metempsy.com bwnb = 0 62714081Sjavier.bueno@metempsy.com bwm = [ ] 62814081Sjavier.bueno@metempsy.com logBwnb = 0 62914081Sjavier.bueno@metempsy.com bwWeightInitValue = -1 63014081Sjavier.bueno@metempsy.com 63114081Sjavier.bueno@metempsy.com # Unused in this Statistical Corrector 63214081Sjavier.bueno@metempsy.com logInb = 0 63314081Sjavier.bueno@metempsy.com iWeightInitValue = -1 63414081Sjavier.bueno@metempsy.com 63514081Sjavier.bueno@metempsy.com extraWeightsWidth = 0 63614081Sjavier.bueno@metempsy.com pUpdateThresholdWidth = 10 63714081Sjavier.bueno@metempsy.com initialUpdateThresholdValue = 35 63814081Sjavier.bueno@metempsy.com logSizeUp = 5 63914081Sjavier.bueno@metempsy.com 64014081Sjavier.bueno@metempsy.com lnb = 3 64114081Sjavier.bueno@metempsy.com lm = [11, 6, 3] 64214081Sjavier.bueno@metempsy.com logLnb = 10 64314081Sjavier.bueno@metempsy.com lWeightInitValue = -1 64414081Sjavier.bueno@metempsy.com 64514081Sjavier.bueno@metempsy.com gnb = Param.Unsigned(4, "Num global branch GEHL lengths") 64614081Sjavier.bueno@metempsy.com gm = VectorParam.Int([27, 22, 17, 14], "Global branch GEHL lengths") 64714081Sjavier.bueno@metempsy.com logGnb = Param.Unsigned(10, "Log number of global branch GEHL entries") 64814081Sjavier.bueno@metempsy.com 64914081Sjavier.bueno@metempsy.com pnb = Param.Unsigned(4, "Num variation global branch GEHL lengths") 65014081Sjavier.bueno@metempsy.com pm = VectorParam.Int([16, 11, 6, 3], 65114081Sjavier.bueno@metempsy.com "Variation global branch GEHL lengths") 65214081Sjavier.bueno@metempsy.com logPnb = Param.Unsigned(9, 65314081Sjavier.bueno@metempsy.com "Log number of variation global branch GEHL entries") 65414081Sjavier.bueno@metempsy.com 65514081Sjavier.bueno@metempsy.comclass MultiperspectivePerceptronTAGE(MultiperspectivePerceptron): 65614081Sjavier.bueno@metempsy.com type = 'MultiperspectivePerceptronTAGE' 65714081Sjavier.bueno@metempsy.com cxx_class = 'MultiperspectivePerceptronTAGE' 65814081Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron_tage.hh' 65914081Sjavier.bueno@metempsy.com abstract = True 66014081Sjavier.bueno@metempsy.com instShiftAmt = 4 66114081Sjavier.bueno@metempsy.com 66214081Sjavier.bueno@metempsy.com imli_mask1 = 0x70 66314081Sjavier.bueno@metempsy.com imli_mask4 = 0 66414081Sjavier.bueno@metempsy.com num_filter_entries = 0 66514081Sjavier.bueno@metempsy.com num_local_histories = 0 66614081Sjavier.bueno@metempsy.com recencypos_mask = 0 # Unused 66714081Sjavier.bueno@metempsy.com threshold = -1 66814081Sjavier.bueno@metempsy.com initial_ghist_length = 0 66914081Sjavier.bueno@metempsy.com ignore_path_size = True 67014081Sjavier.bueno@metempsy.com n_sign_bits = 1; 67114081Sjavier.bueno@metempsy.com 67214081Sjavier.bueno@metempsy.com tage = Param.TAGEBase("Tage object") 67314081Sjavier.bueno@metempsy.com loop_predictor = Param.LoopPredictor("Loop predictor") 67414081Sjavier.bueno@metempsy.com statistical_corrector = Param.StatisticalCorrector("Statistical Corrector") 67514081Sjavier.bueno@metempsy.com 67614081Sjavier.bueno@metempsy.comclass MPP_StatisticalCorrector_64KB(MPP_StatisticalCorrector): 67714081Sjavier.bueno@metempsy.com type = 'MPP_StatisticalCorrector_64KB' 67814081Sjavier.bueno@metempsy.com cxx_class = 'MPP_StatisticalCorrector_64KB' 67914081Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron_tage_64KB.hh' 68014081Sjavier.bueno@metempsy.com 68114081Sjavier.bueno@metempsy.com logBias = 8 68214081Sjavier.bueno@metempsy.com 68314081Sjavier.bueno@metempsy.com snb = Param.Unsigned(4, "Num second local history GEHL lenghts") 68414081Sjavier.bueno@metempsy.com sm = VectorParam.Int([16, 11, 6, 3], "Second local history GEHL lengths") 68514081Sjavier.bueno@metempsy.com logSnb = Param.Unsigned(9, 68614081Sjavier.bueno@metempsy.com "Log number of second local history GEHL entries") 68714081Sjavier.bueno@metempsy.com 68814081Sjavier.bueno@metempsy.com tnb = Param.Unsigned(3, "Num third local history GEHL lenghts") 68914081Sjavier.bueno@metempsy.com tm = VectorParam.Int([22, 17, 14], "Third local history GEHL lengths") 69014081Sjavier.bueno@metempsy.com logTnb = Param.Unsigned(9, 69114081Sjavier.bueno@metempsy.com "Log number of third local history GEHL entries") 69214081Sjavier.bueno@metempsy.com 69314081Sjavier.bueno@metempsy.com numEntriesSecondLocalHistories = Param.Unsigned(16, 69414081Sjavier.bueno@metempsy.com "Number of entries for second local histories") 69514081Sjavier.bueno@metempsy.com numEntriesThirdLocalHistories = Param.Unsigned(16, 69614081Sjavier.bueno@metempsy.com "Number of entries for second local histories") 69714081Sjavier.bueno@metempsy.com 69814081Sjavier.bueno@metempsy.com numEntriesFirstLocalHistories = 256 69914081Sjavier.bueno@metempsy.com 70014081Sjavier.bueno@metempsy.comclass MultiperspectivePerceptronTAGE64KB(MultiperspectivePerceptronTAGE): 70114081Sjavier.bueno@metempsy.com type = 'MultiperspectivePerceptronTAGE64KB' 70214081Sjavier.bueno@metempsy.com cxx_class = 'MultiperspectivePerceptronTAGE64KB' 70314081Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron_tage_64KB.hh' 70414081Sjavier.bueno@metempsy.com 70514081Sjavier.bueno@metempsy.com budgetbits = 65536 * 8 + 2048 70614081Sjavier.bueno@metempsy.com 70714081Sjavier.bueno@metempsy.com tage = MPP_TAGE() 70814081Sjavier.bueno@metempsy.com loop_predictor = MPP_LoopPredictor() 70914081Sjavier.bueno@metempsy.com statistical_corrector = MPP_StatisticalCorrector_64KB() 71014081Sjavier.bueno@metempsy.com 71114081Sjavier.bueno@metempsy.comclass MPP_TAGE_8KB(MPP_TAGE): 71214081Sjavier.bueno@metempsy.com type = 'MPP_TAGE_8KB' 71314081Sjavier.bueno@metempsy.com cxx_class = 'MPP_TAGE_8KB' 71414081Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron_tage_8KB.hh' 71514081Sjavier.bueno@metempsy.com nHistoryTables = 10 71614081Sjavier.bueno@metempsy.com tagTableTagWidths = [0, 7, 7, 7, 8, 9, 10, 10, 11, 13, 13] 71714081Sjavier.bueno@metempsy.com logTagTableSizes = [12, 8, 8, 9, 9, 8, 8, 8, 7, 6, 7] 71814081Sjavier.bueno@metempsy.com tunedHistoryLengths = [0, 4, 8, 13, 23, 36, 56, 93, 145, 226, 359] 71914081Sjavier.bueno@metempsy.com 72014081Sjavier.bueno@metempsy.comclass MPP_LoopPredictor_8KB(MPP_LoopPredictor): 72114081Sjavier.bueno@metempsy.com type = 'MPP_LoopPredictor_8KB' 72214081Sjavier.bueno@metempsy.com cxx_class = 'MPP_LoopPredictor_8KB' 72314081Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron_tage_8KB.hh' 72414081Sjavier.bueno@metempsy.com loopTableIterBits = 10 72514081Sjavier.bueno@metempsy.com logSizeLoopPred = 4 72614081Sjavier.bueno@metempsy.com 72714081Sjavier.bueno@metempsy.comclass MPP_StatisticalCorrector_8KB(MPP_StatisticalCorrector): 72814081Sjavier.bueno@metempsy.com type = 'MPP_StatisticalCorrector_8KB' 72914081Sjavier.bueno@metempsy.com cxx_class = 'MPP_StatisticalCorrector_8KB' 73014081Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron_tage_8KB.hh' 73114081Sjavier.bueno@metempsy.com 73214081Sjavier.bueno@metempsy.com logBias = 7 73314081Sjavier.bueno@metempsy.com 73414081Sjavier.bueno@metempsy.com lnb = 2 73514081Sjavier.bueno@metempsy.com lm = [8, 3] 73614081Sjavier.bueno@metempsy.com logLnb = 9 73714081Sjavier.bueno@metempsy.com 73814081Sjavier.bueno@metempsy.com logGnb = 9 73914081Sjavier.bueno@metempsy.com 74014081Sjavier.bueno@metempsy.com logPnb = 7 74114081Sjavier.bueno@metempsy.com 74214081Sjavier.bueno@metempsy.com numEntriesFirstLocalHistories = 64 74314081Sjavier.bueno@metempsy.com 74414081Sjavier.bueno@metempsy.comclass MultiperspectivePerceptronTAGE8KB(MultiperspectivePerceptronTAGE): 74514081Sjavier.bueno@metempsy.com type = 'MultiperspectivePerceptronTAGE8KB' 74614081Sjavier.bueno@metempsy.com cxx_class = 'MultiperspectivePerceptronTAGE8KB' 74714081Sjavier.bueno@metempsy.com cxx_header = 'cpu/pred/multiperspective_perceptron_tage_8KB.hh' 74814081Sjavier.bueno@metempsy.com 74914081Sjavier.bueno@metempsy.com budgetbits = 8192 * 8 + 2048 75014081Sjavier.bueno@metempsy.com 75114081Sjavier.bueno@metempsy.com tage = MPP_TAGE_8KB() 75214081Sjavier.bueno@metempsy.com loop_predictor = MPP_LoopPredictor_8KB() 75314081Sjavier.bueno@metempsy.com statistical_corrector = MPP_StatisticalCorrector_8KB() 754