X86LocalApic.py revision 14293
18839Sandreas.hansson@arm.com# Copyright (c) 2012 ARM Limited 28839Sandreas.hansson@arm.com# All rights reserved. 38839Sandreas.hansson@arm.com# 48839Sandreas.hansson@arm.com# The license below extends only to copyright in the software and shall 58839Sandreas.hansson@arm.com# not be construed as granting a license to any other intellectual 68839Sandreas.hansson@arm.com# property including but not limited to intellectual property relating 78839Sandreas.hansson@arm.com# to a hardware implementation of the functionality of the software 88839Sandreas.hansson@arm.com# licensed hereunder. You may use the software subject to the license 98839Sandreas.hansson@arm.com# terms below provided that you ensure that this notice is replicated 108839Sandreas.hansson@arm.com# unmodified and in its entirety in all distributions of the software, 118839Sandreas.hansson@arm.com# modified or unmodified, in source code or in binary form. 128839Sandreas.hansson@arm.com# 135647Sgblack@eecs.umich.edu# Copyright (c) 2008 The Regents of The University of Michigan 145647Sgblack@eecs.umich.edu# All rights reserved. 155647Sgblack@eecs.umich.edu# 165647Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without 175647Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are 185647Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright 195647Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer; 205647Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright 215647Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the 225647Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution; 235647Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its 245647Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from 255647Sgblack@eecs.umich.edu# this software without specific prior written permission. 265647Sgblack@eecs.umich.edu# 275647Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 285647Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 295647Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 305647Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 315647Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 325647Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 335647Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 345647Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 355647Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 365647Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 375647Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 385647Sgblack@eecs.umich.edu# 395647Sgblack@eecs.umich.edu# Authors: Gabe Black 405647Sgblack@eecs.umich.edu 418742Sgblack@eecs.umich.edufrom m5.defines import buildEnv 425647Sgblack@eecs.umich.edufrom m5.params import * 438742Sgblack@eecs.umich.edufrom m5.proxy import * 4413665Sandreas.sandberg@arm.com 4514293Sgabeblack@google.comfrom m5.objects.Device import PioDevice 4614145Sgabeblack@google.comfrom m5.objects.ClockDomain import DerivedClockDomain 475647Sgblack@eecs.umich.edu 4814293Sgabeblack@google.comclass X86LocalApic(PioDevice): 495647Sgblack@eecs.umich.edu type = 'X86LocalApic' 505647Sgblack@eecs.umich.edu cxx_class = 'X86ISA::Interrupts' 519338SAndreas.Sandberg@arm.com cxx_header = 'arch/x86/interrupts.hh' 528839Sandreas.hansson@arm.com int_master = MasterPort("Port for sending interrupt messages") 538839Sandreas.hansson@arm.com int_slave = SlavePort("Port for receiving interrupt messages") 547900Shestness@cs.utexas.edu int_latency = Param.Latency('1ns', \ 557900Shestness@cs.utexas.edu "Latency for an interrupt to propagate through this device.") 5614145Sgabeblack@google.com 5714293Sgabeblack@google.com pio_latency = Param.Latency('100ns', 'Programmed IO latency') 5814145Sgabeblack@google.com 5914145Sgabeblack@google.com # The clock rate for the local APIC timer is supposed to be the "bus clock" 6014145Sgabeblack@google.com # which we assume is 1/16th the rate of the CPU clock. I don't think this 6114145Sgabeblack@google.com # is a hard rule, but seems to be true in practice. This can be overriden 6214145Sgabeblack@google.com # in configs that use it. 6314145Sgabeblack@google.com clk_domain = DerivedClockDomain( 6414145Sgabeblack@google.com clk_domain=Parent.clk_domain, clk_divider=16) 65