113759Sgiacomo.gabrielli@arm.com# Copyright (c) 2010, 2017-2018 ARM Limited
27760SGiacomo.Gabrielli@arm.com# All rights reserved.
37760SGiacomo.Gabrielli@arm.com#
47760SGiacomo.Gabrielli@arm.com# The license below extends only to copyright in the software and shall
57760SGiacomo.Gabrielli@arm.com# not be construed as granting a license to any other intellectual
67760SGiacomo.Gabrielli@arm.com# property including but not limited to intellectual property relating
77760SGiacomo.Gabrielli@arm.com# to a hardware implementation of the functionality of the software
87760SGiacomo.Gabrielli@arm.com# licensed hereunder.  You may use the software subject to the license
97760SGiacomo.Gabrielli@arm.com# terms below provided that you ensure that this notice is replicated
107760SGiacomo.Gabrielli@arm.com# unmodified and in its entirety in all distributions of the software,
117760SGiacomo.Gabrielli@arm.com# modified or unmodified, in source code or in binary form.
127760SGiacomo.Gabrielli@arm.com#
134486Sbinkertn@umich.edu# Copyright (c) 2006-2007 The Regents of The University of Michigan
144486Sbinkertn@umich.edu# All rights reserved.
154486Sbinkertn@umich.edu#
164486Sbinkertn@umich.edu# Redistribution and use in source and binary forms, with or without
174486Sbinkertn@umich.edu# modification, are permitted provided that the following conditions are
184486Sbinkertn@umich.edu# met: redistributions of source code must retain the above copyright
194486Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer;
204486Sbinkertn@umich.edu# redistributions in binary form must reproduce the above copyright
214486Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer in the
224486Sbinkertn@umich.edu# documentation and/or other materials provided with the distribution;
234486Sbinkertn@umich.edu# neither the name of the copyright holders nor the names of its
244486Sbinkertn@umich.edu# contributors may be used to endorse or promote products derived from
254486Sbinkertn@umich.edu# this software without specific prior written permission.
264486Sbinkertn@umich.edu#
274486Sbinkertn@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
284486Sbinkertn@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
294486Sbinkertn@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
304486Sbinkertn@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
314486Sbinkertn@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
324486Sbinkertn@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
334486Sbinkertn@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
344486Sbinkertn@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
354486Sbinkertn@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
364486Sbinkertn@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
374486Sbinkertn@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
384486Sbinkertn@umich.edu#
394486Sbinkertn@umich.edu# Authors: Kevin Lim
404486Sbinkertn@umich.edu
413102SN/Afrom m5.SimObject import SimObject
423102SN/Afrom m5.params import *
432736SN/A
444556Sbinkertn@umich.educlass OpClass(Enum):
454556Sbinkertn@umich.edu    vals = ['No_OpClass', 'IntAlu', 'IntMult', 'IntDiv', 'FloatAdd',
4611683Sfernando.endo2@gmail.com            'FloatCmp', 'FloatCvt', 'FloatMult', 'FloatMultAcc', 'FloatDiv',
4711683Sfernando.endo2@gmail.com            'FloatMisc', 'FloatSqrt',
487760SGiacomo.Gabrielli@arm.com            'SimdAdd', 'SimdAddAcc', 'SimdAlu', 'SimdCmp', 'SimdCvt',
497760SGiacomo.Gabrielli@arm.com            'SimdMisc', 'SimdMult', 'SimdMultAcc', 'SimdShift', 'SimdShiftAcc',
5013759Sgiacomo.gabrielli@arm.com            'SimdDiv', 'SimdSqrt', 'SimdFloatAdd', 'SimdFloatAlu',
5113759Sgiacomo.gabrielli@arm.com            'SimdFloatCmp', 'SimdFloatCvt', 'SimdFloatDiv', 'SimdFloatMisc',
5213759Sgiacomo.gabrielli@arm.com            'SimdFloatMult', 'SimdFloatMultAcc', 'SimdFloatSqrt',
5313759Sgiacomo.gabrielli@arm.com            'SimdReduceAdd', 'SimdReduceAlu', 'SimdReduceCmp',
5413759Sgiacomo.gabrielli@arm.com            'SimdFloatReduceAdd', 'SimdFloatReduceCmp',
5513169Smatt.horsnell@arm.com            'SimdAes', 'SimdAesMix', 'SimdSha1Hash', 'SimdSha1Hash2',
5613169Smatt.horsnell@arm.com            'SimdSha256Hash', 'SimdSha256Hash2', 'SimdShaSigma2',
5713759Sgiacomo.gabrielli@arm.com            'SimdShaSigma3',
5813759Sgiacomo.gabrielli@arm.com            'SimdPredAlu',
5913759Sgiacomo.gabrielli@arm.com            'MemRead', 'MemWrite', 'FloatMemRead', 'FloatMemWrite',
6011683Sfernando.endo2@gmail.com            'IprAccess', 'InstPrefetch']
612736SN/A
622736SN/Aclass OpDesc(SimObject):
632736SN/A    type = 'OpDesc'
649338SAndreas.Sandberg@arm.com    cxx_header = "cpu/func_unit.hh"
654556Sbinkertn@umich.edu    opClass = Param.OpClass("type of operation")
669184Sandreas.hansson@arm.com    opLat = Param.Cycles(1, "cycles until result is available")
6710807Snilay@cs.wisc.edu    pipelined = Param.Bool(True, "set to true when the functional unit for"
6810807Snilay@cs.wisc.edu        "this op is fully pipelined. False means not pipelined at all.")
692736SN/A
702736SN/Aclass FUDesc(SimObject):
712736SN/A    type = 'FUDesc'
729338SAndreas.Sandberg@arm.com    cxx_header = "cpu/func_unit.hh"
732736SN/A    count = Param.Int("number of these FU's available")
742736SN/A    opList = VectorParam.OpDesc("operation classes for this FU type")
75