I8259.py revision 5859
15630Sgblack@eecs.umich.edu# Copyright (c) 2008 The Regents of The University of Michigan 25630Sgblack@eecs.umich.edu# All rights reserved. 35630Sgblack@eecs.umich.edu# 45630Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without 55630Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are 65630Sgblack@eecs.umich.edu# met: redistributions of source code must retain the above copyright 75630Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer; 85630Sgblack@eecs.umich.edu# redistributions in binary form must reproduce the above copyright 95630Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the 105630Sgblack@eecs.umich.edu# documentation and/or other materials provided with the distribution; 115630Sgblack@eecs.umich.edu# neither the name of the copyright holders nor the names of its 125630Sgblack@eecs.umich.edu# contributors may be used to endorse or promote products derived from 135630Sgblack@eecs.umich.edu# this software without specific prior written permission. 145630Sgblack@eecs.umich.edu# 155630Sgblack@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 165630Sgblack@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 175630Sgblack@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 185630Sgblack@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 195630Sgblack@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 205630Sgblack@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 215630Sgblack@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 225630Sgblack@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 235630Sgblack@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 245630Sgblack@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 255630Sgblack@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 265630Sgblack@eecs.umich.edu# 275630Sgblack@eecs.umich.edu# Authors: Gabe Black 285630Sgblack@eecs.umich.edu 295630Sgblack@eecs.umich.edufrom m5.params import * 305630Sgblack@eecs.umich.edufrom m5.proxy import * 315630Sgblack@eecs.umich.edufrom Device import BasicPioDevice 325827Sgblack@eecs.umich.edufrom X86IntPin import X86IntSourcePin, X86IntSinkPin 335634Sgblack@eecs.umich.edu 345634Sgblack@eecs.umich.educlass X86I8259CascadeMode(Enum): 355634Sgblack@eecs.umich.edu map = {'I8259Master' : 0, 365634Sgblack@eecs.umich.edu 'I8259Slave' : 1, 375634Sgblack@eecs.umich.edu 'I8259Single' : 2 385634Sgblack@eecs.umich.edu } 395630Sgblack@eecs.umich.edu 405630Sgblack@eecs.umich.educlass I8259(BasicPioDevice): 415630Sgblack@eecs.umich.edu type = 'I8259' 425630Sgblack@eecs.umich.edu cxx_class='X86ISA::I8259' 435630Sgblack@eecs.umich.edu pio_latency = Param.Latency('1ns', "Programmed IO latency in simticks") 445827Sgblack@eecs.umich.edu output = Param.X86IntSourcePin(X86IntSourcePin(), 455827Sgblack@eecs.umich.edu 'The pin this I8259 drives') 465634Sgblack@eecs.umich.edu mode = Param.X86I8259CascadeMode('How this I8259 is cascaded') 475859Sgblack@eecs.umich.edu slave = Param.I8259(NULL, 'Slave I8259, if any') 485634Sgblack@eecs.umich.edu 495634Sgblack@eecs.umich.edu def pin(self, line): 505827Sgblack@eecs.umich.edu return X86IntSinkPin(device=self, number=line) 51