O3CPU.py revision 8727:b3995530319f
111988Sandreas.sandberg@arm.com# Copyright (c) 2005-2007 The Regents of The University of Michigan 28839Sandreas.hansson@arm.com# All rights reserved. 38839Sandreas.hansson@arm.com# 48839Sandreas.hansson@arm.com# Redistribution and use in source and binary forms, with or without 58839Sandreas.hansson@arm.com# modification, are permitted provided that the following conditions are 68839Sandreas.hansson@arm.com# met: redistributions of source code must retain the above copyright 78839Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer; 88839Sandreas.hansson@arm.com# redistributions in binary form must reproduce the above copyright 98839Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer in the 108839Sandreas.hansson@arm.com# documentation and/or other materials provided with the distribution; 118839Sandreas.hansson@arm.com# neither the name of the copyright holders nor the names of its 128839Sandreas.hansson@arm.com# contributors may be used to endorse or promote products derived from 133101Sstever@eecs.umich.edu# this software without specific prior written permission. 148579Ssteve.reinhardt@amd.com# 153101Sstever@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 163101Sstever@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 173101Sstever@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 183101Sstever@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 193101Sstever@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 203101Sstever@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 213101Sstever@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 223101Sstever@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 233101Sstever@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 243101Sstever@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 253101Sstever@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 263101Sstever@eecs.umich.edu# 273101Sstever@eecs.umich.edu# Authors: Kevin Lim 283101Sstever@eecs.umich.edu 293101Sstever@eecs.umich.edufrom m5.defines import buildEnv 303101Sstever@eecs.umich.edufrom m5.params import * 313101Sstever@eecs.umich.edufrom m5.proxy import * 323101Sstever@eecs.umich.edufrom BaseCPU import BaseCPU 333101Sstever@eecs.umich.edufrom FUPool import * 343101Sstever@eecs.umich.edu 353101Sstever@eecs.umich.eduif buildEnv['USE_CHECKER']: 363101Sstever@eecs.umich.edu from O3Checker import O3Checker 373101Sstever@eecs.umich.edu 383101Sstever@eecs.umich.educlass DerivO3CPU(BaseCPU): 393101Sstever@eecs.umich.edu type = 'DerivO3CPU' 403101Sstever@eecs.umich.edu activity = Param.Unsigned(0, "Initial count") 413101Sstever@eecs.umich.edu 427778Sgblack@eecs.umich.edu if buildEnv['USE_CHECKER']: 438839Sandreas.hansson@arm.com if not buildEnv['FULL_SYSTEM']: 443101Sstever@eecs.umich.edu checker = Param.BaseCPU(O3Checker(workload=Parent.workload, 453101Sstever@eecs.umich.edu exitOnError=False, 463101Sstever@eecs.umich.edu updateOnError=True, 473101Sstever@eecs.umich.edu warnOnlyOnLoadError=False), 483101Sstever@eecs.umich.edu "checker") 493101Sstever@eecs.umich.edu else: 503101Sstever@eecs.umich.edu checker = Param.BaseCPU(O3Checker(exitOnError=False, updateOnError=True, 513101Sstever@eecs.umich.edu warnOnlyOnLoadError=False), "checker") 523101Sstever@eecs.umich.edu checker.itb = Parent.itb 533101Sstever@eecs.umich.edu checker.dtb = Parent.dtb 543101Sstever@eecs.umich.edu 553101Sstever@eecs.umich.edu cachePorts = Param.Unsigned(200, "Cache Ports") 563101Sstever@eecs.umich.edu 573101Sstever@eecs.umich.edu decodeToFetchDelay = Param.Unsigned(1, "Decode to fetch delay") 583101Sstever@eecs.umich.edu renameToFetchDelay = Param.Unsigned(1 ,"Rename to fetch delay") 593101Sstever@eecs.umich.edu iewToFetchDelay = Param.Unsigned(1, "Issue/Execute/Writeback to fetch " 603101Sstever@eecs.umich.edu "delay") 613101Sstever@eecs.umich.edu commitToFetchDelay = Param.Unsigned(1, "Commit to fetch delay") 6212563Sgabeblack@google.com fetchWidth = Param.Unsigned(8, "Fetch width") 6312563Sgabeblack@google.com 643885Sbinkertn@umich.edu renameToDecodeDelay = Param.Unsigned(1, "Rename to decode delay") 653885Sbinkertn@umich.edu iewToDecodeDelay = Param.Unsigned(1, "Issue/Execute/Writeback to decode " 664762Snate@binkert.org "delay") 673885Sbinkertn@umich.edu commitToDecodeDelay = Param.Unsigned(1, "Commit to decode delay") 683885Sbinkertn@umich.edu fetchToDecodeDelay = Param.Unsigned(1, "Fetch to decode delay") 697528Ssteve.reinhardt@amd.com decodeWidth = Param.Unsigned(8, "Decode width") 703885Sbinkertn@umich.edu 714380Sbinkertn@umich.edu iewToRenameDelay = Param.Unsigned(1, "Issue/Execute/Writeback to rename " 724167Sbinkertn@umich.edu "delay") 733102Sstever@eecs.umich.edu commitToRenameDelay = Param.Unsigned(1, "Commit to rename delay") 743101Sstever@eecs.umich.edu decodeToRenameDelay = Param.Unsigned(1, "Decode to rename delay") 754762Snate@binkert.org renameWidth = Param.Unsigned(8, "Rename width") 764762Snate@binkert.org 774762Snate@binkert.org commitToIEWDelay = Param.Unsigned(1, "Commit to " 784762Snate@binkert.org "Issue/Execute/Writeback delay") 794762Snate@binkert.org renameToIEWDelay = Param.Unsigned(2, "Rename to " 804762Snate@binkert.org "Issue/Execute/Writeback delay") 814762Snate@binkert.org issueToExecuteDelay = Param.Unsigned(1, "Issue to execute delay (internal " 824762Snate@binkert.org "to the IEW stage)") 834762Snate@binkert.org dispatchWidth = Param.Unsigned(8, "Dispatch width") 845033Smilesck@eecs.umich.edu issueWidth = Param.Unsigned(8, "Issue width") 855033Smilesck@eecs.umich.edu wbWidth = Param.Unsigned(8, "Writeback width") 865033Smilesck@eecs.umich.edu wbDepth = Param.Unsigned(1, "Writeback depth") 875033Smilesck@eecs.umich.edu fuPool = Param.FUPool(DefaultFUPool(), "Functional Unit pool") 885033Smilesck@eecs.umich.edu 895033Smilesck@eecs.umich.edu iewToCommitDelay = Param.Unsigned(1, "Issue/Execute/Writeback to commit " 905033Smilesck@eecs.umich.edu "delay") 915033Smilesck@eecs.umich.edu renameToROBDelay = Param.Unsigned(1, "Rename to reorder buffer delay") 925033Smilesck@eecs.umich.edu commitWidth = Param.Unsigned(8, "Commit width") 935033Smilesck@eecs.umich.edu squashWidth = Param.Unsigned(8, "Squash width") 943101Sstever@eecs.umich.edu trapLatency = Param.Tick(13, "Trap latency") 953101Sstever@eecs.umich.edu fetchTrapLatency = Param.Tick(1, "Fetch trap latency") 963101Sstever@eecs.umich.edu 975033Smilesck@eecs.umich.edu backComSize = Param.Unsigned(5, "Time buffer size for backwards communication") 9810267SGeoffrey.Blake@arm.com forwardComSize = Param.Unsigned(5, "Time buffer size for forward communication") 998596Ssteve.reinhardt@amd.com 1008596Ssteve.reinhardt@amd.com predType = Param.String("tournament", "Branch predictor type ('local', 'tournament')") 1018596Ssteve.reinhardt@amd.com localPredictorSize = Param.Unsigned(2048, "Size of local predictor") 1028596Ssteve.reinhardt@amd.com localCtrBits = Param.Unsigned(2, "Bits per counter") 1037673Snate@binkert.org localHistoryTableSize = Param.Unsigned(2048, "Size of local history table") 1047673Snate@binkert.org localHistoryBits = Param.Unsigned(11, "Bits for the local history") 1057673Snate@binkert.org globalPredictorSize = Param.Unsigned(8192, "Size of global predictor") 1067673Snate@binkert.org globalCtrBits = Param.Unsigned(2, "Bits per counter") 10711988Sandreas.sandberg@arm.com globalHistoryBits = Param.Unsigned(13, "Bits of history") 10811988Sandreas.sandberg@arm.com choicePredictorSize = Param.Unsigned(8192, "Size of choice predictor") 10911988Sandreas.sandberg@arm.com choiceCtrBits = Param.Unsigned(2, "Bits of choice counters") 11011988Sandreas.sandberg@arm.com 1113101Sstever@eecs.umich.edu BTBEntries = Param.Unsigned(4096, "Number of BTB entries") 1123101Sstever@eecs.umich.edu BTBTagSize = Param.Unsigned(16, "Size of the BTB tags, in bits") 1133101Sstever@eecs.umich.edu 1143101Sstever@eecs.umich.edu RASSize = Param.Unsigned(16, "RAS size") 1153101Sstever@eecs.umich.edu 11610380SAndrew.Bardsley@arm.com LQEntries = Param.Unsigned(32, "Number of load queue entries") 11710380SAndrew.Bardsley@arm.com SQEntries = Param.Unsigned(32, "Number of store queue entries") 11810380SAndrew.Bardsley@arm.com LSQDepCheckShift = Param.Unsigned(4, "Number of places to shift addr before check") 11910380SAndrew.Bardsley@arm.com LSQCheckLoads = Param.Bool(True, 12010380SAndrew.Bardsley@arm.com "Should dependency violations be checked for loads & stores or just stores") 12110380SAndrew.Bardsley@arm.com store_set_clear_period = Param.Unsigned(250000, 12210458Sandreas.hansson@arm.com "Number of load/store insts before the dep predictor should be invalidated") 12310458Sandreas.hansson@arm.com LFSTSize = Param.Unsigned(1024, "Last fetched store table size") 12410458Sandreas.hansson@arm.com SSITSize = Param.Unsigned(1024, "Store set ID table size") 12510458Sandreas.hansson@arm.com 12610458Sandreas.hansson@arm.com numRobs = Param.Unsigned(1, "Number of Reorder Buffers"); 12710458Sandreas.hansson@arm.com 12810458Sandreas.hansson@arm.com numPhysIntRegs = Param.Unsigned(256, "Number of physical integer registers") 12910458Sandreas.hansson@arm.com numPhysFloatRegs = Param.Unsigned(256, "Number of physical floating point " 13010458Sandreas.hansson@arm.com "registers") 13110458Sandreas.hansson@arm.com numIQEntries = Param.Unsigned(64, "Number of instruction queue entries") 13210458Sandreas.hansson@arm.com numROBEntries = Param.Unsigned(192, "Number of reorder buffer entries") 13310458Sandreas.hansson@arm.com 1343101Sstever@eecs.umich.edu instShiftAmt = Param.Unsigned(2, "Number of bits to shift instructions by") 1353101Sstever@eecs.umich.edu 1363101Sstever@eecs.umich.edu smtNumFetchingThreads = Param.Unsigned(1, "SMT Number of Fetching Threads") 1373101Sstever@eecs.umich.edu smtFetchPolicy = Param.String('SingleThread', "SMT Fetch policy") 1383101Sstever@eecs.umich.edu smtLSQPolicy = Param.String('Partitioned', "SMT LSQ Sharing Policy") 13910267SGeoffrey.Blake@arm.com smtLSQThreshold = Param.Int(100, "SMT LSQ Threshold Sharing Parameter") 14010267SGeoffrey.Blake@arm.com smtIQPolicy = Param.String('Partitioned', "SMT IQ Sharing Policy") 14110267SGeoffrey.Blake@arm.com smtIQThreshold = Param.Int(100, "SMT IQ Threshold Sharing Parameter") 14210267SGeoffrey.Blake@arm.com smtROBPolicy = Param.String('Partitioned', "SMT ROB Sharing Policy") 1433101Sstever@eecs.umich.edu smtROBThreshold = Param.Int(100, "SMT ROB Threshold Sharing Parameter") 1443101Sstever@eecs.umich.edu smtCommitPolicy = Param.String('RoundRobin', "SMT Commit Policy") 1453101Sstever@eecs.umich.edu 1463101Sstever@eecs.umich.edu needsTSO = Param.Bool(buildEnv['TARGET_ISA'] == 'x86', 1473101Sstever@eecs.umich.edu "Enable TSO Memory model") 1483101Sstever@eecs.umich.edu