X86TLB.py revision 6654
14202Sbinkertn@umich.edu# Copyright (c) 2007 The Hewlett-Packard Development Company
24202Sbinkertn@umich.edu# All rights reserved.
34202Sbinkertn@umich.edu#
44202Sbinkertn@umich.edu# Redistribution and use of this software in source and binary forms,
54202Sbinkertn@umich.edu# with or without modification, are permitted provided that the
64202Sbinkertn@umich.edu# following conditions are met:
74202Sbinkertn@umich.edu#
84202Sbinkertn@umich.edu# The software must be used only for Non-Commercial Use which means any
94202Sbinkertn@umich.edu# use which is NOT directed to receiving any direct monetary
104202Sbinkertn@umich.edu# compensation for, or commercial advantage from such use.  Illustrative
114202Sbinkertn@umich.edu# examples of non-commercial use are academic research, personal study,
124202Sbinkertn@umich.edu# teaching, education and corporate research & development.
134202Sbinkertn@umich.edu# Illustrative examples of commercial use are distributing products for
144202Sbinkertn@umich.edu# commercial advantage and providing services using the software for
154202Sbinkertn@umich.edu# commercial advantage.
164202Sbinkertn@umich.edu#
174202Sbinkertn@umich.edu# If you wish to use this software or functionality therein that may be
184202Sbinkertn@umich.edu# covered by patents for commercial use, please contact:
194202Sbinkertn@umich.edu#     Director of Intellectual Property Licensing
204202Sbinkertn@umich.edu#     Office of Strategy and Technology
214202Sbinkertn@umich.edu#     Hewlett-Packard Company
224202Sbinkertn@umich.edu#     1501 Page Mill Road
234202Sbinkertn@umich.edu#     Palo Alto, California  94304
244202Sbinkertn@umich.edu#
254202Sbinkertn@umich.edu# Redistributions of source code must retain the above copyright notice,
264202Sbinkertn@umich.edu# this list of conditions and the following disclaimer.  Redistributions
274202Sbinkertn@umich.edu# in binary form must reproduce the above copyright notice, this list of
284202Sbinkertn@umich.edu# conditions and the following disclaimer in the documentation and/or
294202Sbinkertn@umich.edu# other materials provided with the distribution.  Neither the name of
304202Sbinkertn@umich.edu# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
314202Sbinkertn@umich.edu# contributors may be used to endorse or promote products derived from
324202Sbinkertn@umich.edu# this software without specific prior written permission.  No right of
3311053Sandreas.hansson@arm.com# sublicense is granted herewith.  Derivatives of the software and
344486Sbinkertn@umich.edu# output created using the software may be prepared, but only for
355337Sstever@gmail.com# Non-Commercial Uses.  Derivatives of the software may be shared with
364202Sbinkertn@umich.edu# others provided: (i) the others agree to abide by the list of
3713223Sodanrc@yahoo.com.br# conditions herein which includes the Non-Commercial Use restrictions;
385337Sstever@gmail.com# and (ii) such Derivatives of the software include the above copyright
395337Sstever@gmail.com# notice to acknowledge the contribution from this software where
4012726Snikos.nikoleris@arm.com# applicable, this list of conditions and the disclaimer below.
4112752Sodanrc@yahoo.com.br#
4211375Sandreas.hansson@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4311375Sandreas.hansson@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
445192Ssaidi@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
458335Snate@binkert.org# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
468335Snate@binkert.org# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
478335Snate@binkert.org# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
489663Suri.wiener@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4911288Ssteve.reinhardt@amd.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
508335Snate@binkert.org# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5111288Ssteve.reinhardt@amd.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5211288Ssteve.reinhardt@amd.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5311288Ssteve.reinhardt@amd.com#
5411288Ssteve.reinhardt@amd.com# Authors: Gabe Black
5511288Ssteve.reinhardt@amd.com
5611288Ssteve.reinhardt@amd.comfrom m5.defines import buildEnv
5711288Ssteve.reinhardt@amd.comfrom m5.params import *
58from m5.proxy import *
59
60from BaseTLB import BaseTLB
61from MemObject import MemObject
62
63if buildEnv['FULL_SYSTEM']:
64    class X86PagetableWalker(MemObject):
65        type = 'X86PagetableWalker'
66        cxx_class = 'X86ISA::Walker'
67        port = Port("Port for the hardware table walker")
68        system = Param.System(Parent.any, "system object")
69
70class X86TLB(BaseTLB):
71    type = 'X86TLB'
72    cxx_class = 'X86ISA::TLB'
73    size = Param.Int(64, "TLB size")
74    if buildEnv['FULL_SYSTEM']:
75        walker = Param.X86PagetableWalker(\
76                X86PagetableWalker(), "page table walker")
77