I8259.py revision 14290
111147Smitch.hayenga@arm.com# Copyright (c) 2008 The Regents of The University of Michigan
212109SRekai.GonzalezAlberquilla@arm.com# All rights reserved.
311147Smitch.hayenga@arm.com#
411147Smitch.hayenga@arm.com# Redistribution and use in source and binary forms, with or without
511147Smitch.hayenga@arm.com# modification, are permitted provided that the following conditions are
611147Smitch.hayenga@arm.com# met: redistributions of source code must retain the above copyright
711147Smitch.hayenga@arm.com# notice, this list of conditions and the following disclaimer;
811147Smitch.hayenga@arm.com# redistributions in binary form must reproduce the above copyright
911147Smitch.hayenga@arm.com# notice, this list of conditions and the following disclaimer in the
1011147Smitch.hayenga@arm.com# documentation and/or other materials provided with the distribution;
1111147Smitch.hayenga@arm.com# neither the name of the copyright holders nor the names of its
1211147Smitch.hayenga@arm.com# contributors may be used to endorse or promote products derived from
1311147Smitch.hayenga@arm.com# this software without specific prior written permission.
1411147Smitch.hayenga@arm.com#
1511147Smitch.hayenga@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1611147Smitch.hayenga@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1711147Smitch.hayenga@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1811147Smitch.hayenga@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1911147Smitch.hayenga@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2011147Smitch.hayenga@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2111147Smitch.hayenga@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2211147Smitch.hayenga@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2311147Smitch.hayenga@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2411147Smitch.hayenga@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2511147Smitch.hayenga@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2611147Smitch.hayenga@arm.com#
2711147Smitch.hayenga@arm.com# Authors: Gabe Black
2811147Smitch.hayenga@arm.com
2911147Smitch.hayenga@arm.comfrom m5.params import *
3011147Smitch.hayenga@arm.comfrom m5.proxy import *
3111147Smitch.hayenga@arm.comfrom m5.objects.Device import BasicPioDevice
3211147Smitch.hayenga@arm.comfrom m5.objects.IntPin import IntSourcePin, VectorIntSinkPin
3311147Smitch.hayenga@arm.com
3411147Smitch.hayenga@arm.comclass X86I8259CascadeMode(Enum):
3511147Smitch.hayenga@arm.com    map = {'I8259Master' : 0,
3611147Smitch.hayenga@arm.com           'I8259Slave' : 1,
3711147Smitch.hayenga@arm.com           'I8259Single' : 2
3811147Smitch.hayenga@arm.com    }
3911147Smitch.hayenga@arm.com
4011147Smitch.hayenga@arm.comclass I8259(BasicPioDevice):
4111147Smitch.hayenga@arm.com    type = 'I8259'
4211147Smitch.hayenga@arm.com    cxx_class='X86ISA::I8259'
4311147Smitch.hayenga@arm.com    cxx_header = "dev/x86/i8259.hh"
4411147Smitch.hayenga@arm.com    output = IntSourcePin('The pin this I8259 drives')
4511147Smitch.hayenga@arm.com    inputs = VectorIntSinkPin('The pins that drive this I8259')
4611147Smitch.hayenga@arm.com    mode = Param.X86I8259CascadeMode('How this I8259 is cascaded')
4711147Smitch.hayenga@arm.com    slave = Param.I8259(NULL, 'Slave I8259, if any')
4811147Smitch.hayenga@arm.com