FuncUnit.py revision 13169:eb3b2bea4231
16019Shines@cs.fsu.edu# Copyright (c) 2010,2018 ARM Limited
26019Shines@cs.fsu.edu# All rights reserved.
37152Sgblack@eecs.umich.edu#
47152Sgblack@eecs.umich.edu# The license below extends only to copyright in the software and shall
57152Sgblack@eecs.umich.edu# not be construed as granting a license to any other intellectual
67152Sgblack@eecs.umich.edu# property including but not limited to intellectual property relating
77152Sgblack@eecs.umich.edu# to a hardware implementation of the functionality of the software
87152Sgblack@eecs.umich.edu# licensed hereunder.  You may use the software subject to the license
97152Sgblack@eecs.umich.edu# terms below provided that you ensure that this notice is replicated
107152Sgblack@eecs.umich.edu# unmodified and in its entirety in all distributions of the software,
117152Sgblack@eecs.umich.edu# modified or unmodified, in source code or in binary form.
127152Sgblack@eecs.umich.edu#
137152Sgblack@eecs.umich.edu# Copyright (c) 2006-2007 The Regents of The University of Michigan
147152Sgblack@eecs.umich.edu# All rights reserved.
156019Shines@cs.fsu.edu#
166019Shines@cs.fsu.edu# Redistribution and use in source and binary forms, with or without
176019Shines@cs.fsu.edu# modification, are permitted provided that the following conditions are
186019Shines@cs.fsu.edu# met: redistributions of source code must retain the above copyright
196019Shines@cs.fsu.edu# notice, this list of conditions and the following disclaimer;
206019Shines@cs.fsu.edu# redistributions in binary form must reproduce the above copyright
216019Shines@cs.fsu.edu# notice, this list of conditions and the following disclaimer in the
226019Shines@cs.fsu.edu# documentation and/or other materials provided with the distribution;
236019Shines@cs.fsu.edu# neither the name of the copyright holders nor the names of its
246019Shines@cs.fsu.edu# contributors may be used to endorse or promote products derived from
256019Shines@cs.fsu.edu# this software without specific prior written permission.
266019Shines@cs.fsu.edu#
276019Shines@cs.fsu.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
286019Shines@cs.fsu.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
296019Shines@cs.fsu.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
306019Shines@cs.fsu.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
316019Shines@cs.fsu.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
326019Shines@cs.fsu.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
336019Shines@cs.fsu.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
346019Shines@cs.fsu.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
356019Shines@cs.fsu.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
366019Shines@cs.fsu.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
376019Shines@cs.fsu.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
386019Shines@cs.fsu.edu#
396019Shines@cs.fsu.edu# Authors: Kevin Lim
406019Shines@cs.fsu.edu
416019Shines@cs.fsu.edufrom m5.SimObject import SimObject
426019Shines@cs.fsu.edufrom m5.params import *
436019Shines@cs.fsu.edu
446019Shines@cs.fsu.educlass OpClass(Enum):
456019Shines@cs.fsu.edu    vals = ['No_OpClass', 'IntAlu', 'IntMult', 'IntDiv', 'FloatAdd',
466019Shines@cs.fsu.edu            'FloatCmp', 'FloatCvt', 'FloatMult', 'FloatMultAcc', 'FloatDiv',
476019Shines@cs.fsu.edu            'FloatMisc', 'FloatSqrt',
487152Sgblack@eecs.umich.edu            'SimdAdd', 'SimdAddAcc', 'SimdAlu', 'SimdCmp', 'SimdCvt',
497152Sgblack@eecs.umich.edu            'SimdMisc', 'SimdMult', 'SimdMultAcc', 'SimdShift', 'SimdShiftAcc',
507152Sgblack@eecs.umich.edu            'SimdSqrt', 'SimdFloatAdd', 'SimdFloatAlu', 'SimdFloatCmp',
517152Sgblack@eecs.umich.edu            'SimdFloatCvt', 'SimdFloatDiv', 'SimdFloatMisc', 'SimdFloatMult',
527152Sgblack@eecs.umich.edu            'SimdFloatMultAcc', 'SimdFloatSqrt',
537152Sgblack@eecs.umich.edu            'SimdAes', 'SimdAesMix', 'SimdSha1Hash', 'SimdSha1Hash2',
547152Sgblack@eecs.umich.edu            'SimdSha256Hash', 'SimdSha256Hash2', 'SimdShaSigma2',
557152Sgblack@eecs.umich.edu            'SimdShaSigma3', 'MemRead', 'MemWrite',
567152Sgblack@eecs.umich.edu            'FloatMemRead', 'FloatMemWrite',
577152Sgblack@eecs.umich.edu            'IprAccess', 'InstPrefetch']
587152Sgblack@eecs.umich.edu
597152Sgblack@eecs.umich.educlass OpDesc(SimObject):
607152Sgblack@eecs.umich.edu    type = 'OpDesc'
617152Sgblack@eecs.umich.edu    cxx_header = "cpu/func_unit.hh"
627152Sgblack@eecs.umich.edu    opClass = Param.OpClass("type of operation")
637152Sgblack@eecs.umich.edu    opLat = Param.Cycles(1, "cycles until result is available")
647152Sgblack@eecs.umich.edu    pipelined = Param.Bool(True, "set to true when the functional unit for"
657152Sgblack@eecs.umich.edu        "this op is fully pipelined. False means not pipelined at all.")
667152Sgblack@eecs.umich.edu
677152Sgblack@eecs.umich.educlass FUDesc(SimObject):
687152Sgblack@eecs.umich.edu    type = 'FUDesc'
697152Sgblack@eecs.umich.edu    cxx_header = "cpu/func_unit.hh"
707152Sgblack@eecs.umich.edu    count = Param.Int("number of these FU's available")
717152Sgblack@eecs.umich.edu    opList = VectorParam.OpDesc("operation classes for this FU type")
727152Sgblack@eecs.umich.edu