BranchPredictor.py (13626:d6a6358aa6db) | BranchPredictor.py (13627:ec1395943cd2) |
---|---|
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; --- 131 unchanged lines hidden (view full) --- 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 | 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; --- 131 unchanged lines hidden (view full) --- 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 |
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" | 148class LoopPredictor(SimObject): 149 type = 'LoopPredictor' 150 cxx_class = 'LoopPredictor' 151 cxx_header = 'cpu/pred/loop_predictor.hh' |
156 | 152 |
157 tage = LTAGE_TAGE() 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") 166 logLoopTableAssoc = Param.Unsigned(2, "Log loop predictor associativity") 167 168 # Parameters for enabling modifications to the loop predictor | 153 logSizeLoopPred = Param.Unsigned(8, "Log size of the loop predictor") 154 withLoopBits = Param.Unsigned(7, "Size of the WITHLOOP counter") 155 loopTableAgeBits = Param.Unsigned(8, "Number of age bits per loop entry") 156 loopTableConfidenceBits = Param.Unsigned(2, 157 "Number of confidence bits per loop entry") 158 loopTableTagBits = Param.Unsigned(14, "Number of tag bits per loop entry") 159 loopTableIterBits = Param.Unsigned(14, "Nuber of iteration bits per loop") 160 logLoopTableAssoc = Param.Unsigned(2, "Log loop predictor associativity") 161 162 # Parameters for enabling modifications to the loop predictor |
169 # They have been copied from ISL-TAGE 170 # (https://www.jilp.org/jwac-2/program/03_seznec.tgz) | 163 # They have been copied from TAGE-GSC-IMLI 164 # (http://www.irisa.fr/alf/downloads/seznec/TAGE-GSC-IMLI.tar) |
171 # 172 # All of them should be disabled to match the original LTAGE implementation 173 # (http://hpca23.cse.tamu.edu/taco/camino/cbp2/cbp-src/realistic-seznec.h) 174 175 # Add speculation 176 useSpeculation = Param.Bool(False, "Use speculation") 177 178 # Add hashing for calculating the loop table index 179 useHashing = Param.Bool(False, "Use hashing") 180 181 # Add a direction bit to the loop table entries 182 useDirectionBit = Param.Bool(False, "Use direction info") 183 | 165 # 166 # All of them should be disabled to match the original LTAGE implementation 167 # (http://hpca23.cse.tamu.edu/taco/camino/cbp2/cbp-src/realistic-seznec.h) 168 169 # Add speculation 170 useSpeculation = Param.Bool(False, "Use speculation") 171 172 # Add hashing for calculating the loop table index 173 useHashing = Param.Bool(False, "Use hashing") 174 175 # Add a direction bit to the loop table entries 176 useDirectionBit = Param.Bool(False, "Use direction info") 177 |
178 # If true, use random to decide whether to allocate or not, and only try 179 # with one entry 180 restrictAllocation = Param.Bool(False, 181 "Restrict the allocation conditions") 182 183 initialLoopIter = Param.Unsigned(1, "Initial iteration number") 184 initialLoopAge = Param.Unsigned(255, "Initial age value") 185 optionalAgeReset = Param.Bool(True, 186 "Reset age bits optionally in some cases") 187 188 189# LTAGE branch predictor as described in 190# https://www.irisa.fr/caps/people/seznec/L-TAGE.pdf 191# It is basically a TAGE predictor plus a loop predictor 192# The differnt TAGE sizes are updated according to the paper values (256 Kbits) 193class LTAGE(TAGE): 194 type = 'LTAGE' 195 cxx_class = 'LTAGE' 196 cxx_header = "cpu/pred/ltage.hh" 197 198 tage = LTAGE_TAGE() 199 loop_predictor = Param.LoopPredictor(LoopPredictor(), "Loop predictor") |
|