X86GPUTLB.py revision 13892
112697Santhony.gutierrez@amd.com# Copyright (c) 2011-2015 Advanced Micro Devices, Inc. 212697Santhony.gutierrez@amd.com# All rights reserved. 311308Santhony.gutierrez@amd.com# 412697Santhony.gutierrez@amd.com# For use for simulation and test purposes only 511308Santhony.gutierrez@amd.com# 612697Santhony.gutierrez@amd.com# Redistribution and use in source and binary forms, with or without 712697Santhony.gutierrez@amd.com# modification, are permitted provided that the following conditions are met: 811308Santhony.gutierrez@amd.com# 912697Santhony.gutierrez@amd.com# 1. Redistributions of source code must retain the above copyright notice, 1012697Santhony.gutierrez@amd.com# this list of conditions and the following disclaimer. 1111308Santhony.gutierrez@amd.com# 1212697Santhony.gutierrez@amd.com# 2. Redistributions in binary form must reproduce the above copyright notice, 1312697Santhony.gutierrez@amd.com# this list of conditions and the following disclaimer in the documentation 1412697Santhony.gutierrez@amd.com# and/or other materials provided with the distribution. 1511308Santhony.gutierrez@amd.com# 1612697Santhony.gutierrez@amd.com# 3. Neither the name of the copyright holder nor the names of its 1712697Santhony.gutierrez@amd.com# contributors may be used to endorse or promote products derived from this 1812697Santhony.gutierrez@amd.com# software without specific prior written permission. 1911308Santhony.gutierrez@amd.com# 2012697Santhony.gutierrez@amd.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2112697Santhony.gutierrez@amd.com# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2212697Santhony.gutierrez@amd.com# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2312697Santhony.gutierrez@amd.com# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 2412697Santhony.gutierrez@amd.com# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2512697Santhony.gutierrez@amd.com# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2612697Santhony.gutierrez@amd.com# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2712697Santhony.gutierrez@amd.com# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2812697Santhony.gutierrez@amd.com# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2912697Santhony.gutierrez@amd.com# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3012697Santhony.gutierrez@amd.com# POSSIBILITY OF SUCH DAMAGE. 3111308Santhony.gutierrez@amd.com# 3212697Santhony.gutierrez@amd.com# Authors: Lisa Hsu 3311308Santhony.gutierrez@amd.com 3411308Santhony.gutierrez@amd.comfrom m5.defines import buildEnv 3511308Santhony.gutierrez@amd.comfrom m5.params import * 3611308Santhony.gutierrez@amd.comfrom m5.proxy import * 3711308Santhony.gutierrez@amd.com 3813892Sgabeblack@google.comfrom m5.objects.ClockedObject import ClockedObject 3913892Sgabeblack@google.comfrom m5.SimObject import SimObject 4011308Santhony.gutierrez@amd.com 4111308Santhony.gutierrez@amd.comif buildEnv['FULL_SYSTEM']: 4213892Sgabeblack@google.com class X86PagetableWalker(SimObject): 4311308Santhony.gutierrez@amd.com type = 'X86PagetableWalker' 4411308Santhony.gutierrez@amd.com cxx_class = 'X86ISA::Walker' 4511308Santhony.gutierrez@amd.com port = SlavePort("Port for the hardware table walker") 4611308Santhony.gutierrez@amd.com system = Param.System(Parent.any, "system object") 4711308Santhony.gutierrez@amd.com 4813892Sgabeblack@google.comclass X86GPUTLB(ClockedObject): 4911308Santhony.gutierrez@amd.com type = 'X86GPUTLB' 5011308Santhony.gutierrez@amd.com cxx_class = 'X86ISA::GpuTLB' 5111308Santhony.gutierrez@amd.com cxx_header = 'gpu-compute/gpu_tlb.hh' 5211308Santhony.gutierrez@amd.com size = Param.Int(64, "TLB size (number of entries)") 5311308Santhony.gutierrez@amd.com assoc = Param.Int(64, "TLB associativity") 5411308Santhony.gutierrez@amd.com 5511308Santhony.gutierrez@amd.com if buildEnv['FULL_SYSTEM']: 5611308Santhony.gutierrez@amd.com walker = Param.X86PagetableWalker(X86PagetableWalker(), 5711308Santhony.gutierrez@amd.com "page table walker") 5811308Santhony.gutierrez@amd.com 5911308Santhony.gutierrez@amd.com hitLatency = Param.Int(2, "Latency of a TLB hit") 6011308Santhony.gutierrez@amd.com missLatency1 = Param.Int(5, "Latency #1 of a TLB miss") 6111308Santhony.gutierrez@amd.com missLatency2 = Param.Int(100, "Latency #2 of a TLB miss") 6211308Santhony.gutierrez@amd.com maxOutstandingReqs = Param.Int(64, "# of maximum outstanding requests") 6311308Santhony.gutierrez@amd.com slave = VectorSlavePort("Port on side closer to CPU/CU") 6411308Santhony.gutierrez@amd.com master = VectorMasterPort("Port on side closer to memory") 6511308Santhony.gutierrez@amd.com allocationPolicy = Param.Bool(True, "Allocate on an access") 6611308Santhony.gutierrez@amd.com accessDistance = Param.Bool(False, "print accessDistance stats") 6711308Santhony.gutierrez@amd.com 6813892Sgabeblack@google.comclass TLBCoalescer(ClockedObject): 6911308Santhony.gutierrez@amd.com type = 'TLBCoalescer' 7011308Santhony.gutierrez@amd.com cxx_class = 'TLBCoalescer' 7111308Santhony.gutierrez@amd.com cxx_header = 'gpu-compute/tlb_coalescer.hh' 7211308Santhony.gutierrez@amd.com probesPerCycle = Param.Int(2, "Number of TLB probes per cycle") 7311308Santhony.gutierrez@amd.com coalescingWindow = Param.Int(1, "Permit coalescing across that many ticks") 7411308Santhony.gutierrez@amd.com slave = VectorSlavePort("Port on side closer to CPU/CU") 7511308Santhony.gutierrez@amd.com master = VectorMasterPort("Port on side closer to memory") 7611308Santhony.gutierrez@amd.com disableCoalescing = Param.Bool(False,"Dispable Coalescing") 77