FuncUnit.py revision 7760
12735Sktlim@umich.edu# Copyright (c) 2010 ARM Limited 22735Sktlim@umich.edu# All rights reserved. 32735Sktlim@umich.edu# 42735Sktlim@umich.edu# The license below extends only to copyright in the software and shall 52735Sktlim@umich.edu# not be construed as granting a license to any other intellectual 62735Sktlim@umich.edu# property including but not limited to intellectual property relating 72735Sktlim@umich.edu# to a hardware implementation of the functionality of the software 82735Sktlim@umich.edu# licensed hereunder. You may use the software subject to the license 92735Sktlim@umich.edu# terms below provided that you ensure that this notice is replicated 102735Sktlim@umich.edu# unmodified and in its entirety in all distributions of the software, 112735Sktlim@umich.edu# modified or unmodified, in source code or in binary form. 122735Sktlim@umich.edu# 132735Sktlim@umich.edu# Copyright (c) 2006-2007 The Regents of The University of Michigan 142735Sktlim@umich.edu# All rights reserved. 152735Sktlim@umich.edu# 162735Sktlim@umich.edu# Redistribution and use in source and binary forms, with or without 172735Sktlim@umich.edu# modification, are permitted provided that the following conditions are 182735Sktlim@umich.edu# met: redistributions of source code must retain the above copyright 192735Sktlim@umich.edu# notice, this list of conditions and the following disclaimer; 202735Sktlim@umich.edu# redistributions in binary form must reproduce the above copyright 212735Sktlim@umich.edu# notice, this list of conditions and the following disclaimer in the 222735Sktlim@umich.edu# documentation and/or other materials provided with the distribution; 232735Sktlim@umich.edu# neither the name of the copyright holders nor the names of its 242735Sktlim@umich.edu# contributors may be used to endorse or promote products derived from 252735Sktlim@umich.edu# this software without specific prior written permission. 262735Sktlim@umich.edu# 272735Sktlim@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 282735Sktlim@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 292735Sktlim@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 302735Sktlim@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 312735Sktlim@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 322735Sktlim@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 332735Sktlim@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 342735Sktlim@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 352735Sktlim@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 362735Sktlim@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 372735Sktlim@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 382735Sktlim@umich.edu# 392735Sktlim@umich.edu# Authors: Kevin Lim 402735Sktlim@umich.edu 412735Sktlim@umich.edufrom m5.SimObject import SimObject 422735Sktlim@umich.edufrom m5.params import * 432735Sktlim@umich.edu 442735Sktlim@umich.educlass OpClass(Enum): 452735Sktlim@umich.edu vals = ['No_OpClass', 'IntAlu', 'IntMult', 'IntDiv', 'FloatAdd', 462735Sktlim@umich.edu 'FloatCmp', 'FloatCvt', 'FloatMult', 'FloatDiv', 'FloatSqrt', 472735Sktlim@umich.edu 'SimdAdd', 'SimdAddAcc', 'SimdAlu', 'SimdCmp', 'SimdCvt', 482735Sktlim@umich.edu 'SimdMisc', 'SimdMult', 'SimdMultAcc', 'SimdShift', 'SimdShiftAcc', 492735Sktlim@umich.edu 'SimdSqrt', 'SimdFloatAdd', 'SimdFloatAlu', 'SimdFloatCmp', 502735Sktlim@umich.edu 'SimdFloatCvt', 'SimdFloatDiv', 'SimdFloatMisc', 'SimdFloatMult', 513735Sstever@eecs.umich.edu 'SimdFloatMultAcc', 'SimdFloatSqrt', 522735Sktlim@umich.edu 'MemRead', 'MemWrite', 'IprAccess', 'InstPrefetch'] 532735Sktlim@umich.edu 543735Sstever@eecs.umich.educlass OpDesc(SimObject): 552735Sktlim@umich.edu type = 'OpDesc' 562735Sktlim@umich.edu issueLat = Param.Int(1, "cycles until another can be issued") 573735Sstever@eecs.umich.edu opClass = Param.OpClass("type of operation") 582735Sktlim@umich.edu opLat = Param.Int(1, "cycles until result is available") 592735Sktlim@umich.edu 602735Sktlim@umich.educlass FUDesc(SimObject): 613735Sstever@eecs.umich.edu type = 'FUDesc' 623735Sstever@eecs.umich.edu count = Param.Int("number of these FU's available") 632735Sktlim@umich.edu opList = VectorParam.OpDesc("operation classes for this FU type") 642735Sktlim@umich.edu