FuncUnit.py revision 4486
12381SN/A# Copyright (c) 2006-2007 The Regents of The University of Michigan
28949Sandreas.hansson@arm.com# All rights reserved.
38949Sandreas.hansson@arm.com#
48949Sandreas.hansson@arm.com# Redistribution and use in source and binary forms, with or without
58949Sandreas.hansson@arm.com# modification, are permitted provided that the following conditions are
68949Sandreas.hansson@arm.com# met: redistributions of source code must retain the above copyright
78949Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer;
88949Sandreas.hansson@arm.com# redistributions in binary form must reproduce the above copyright
98949Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer in the
108949Sandreas.hansson@arm.com# documentation and/or other materials provided with the distribution;
118949Sandreas.hansson@arm.com# neither the name of the copyright holders nor the names of its
128949Sandreas.hansson@arm.com# contributors may be used to endorse or promote products derived from
138949Sandreas.hansson@arm.com# this software without specific prior written permission.
142592SN/A#
157636Ssteve.reinhardt@amd.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
162381SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
172381SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
182381SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
192381SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
202381SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
212381SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
222381SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
232381SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
242381SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
252381SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
262381SN/A#
272381SN/A# Authors: Kevin Lim
282381SN/A
292381SN/Afrom m5.SimObject import SimObject
302381SN/Afrom m5.params import *
312381SN/A
322381SN/Aclass OpType(Enum):
332381SN/A    vals = ['(null)', 'IntAlu', 'IntMult', 'IntDiv', 'FloatAdd',
342381SN/A            'FloatCmp', 'FloatCvt', 'FloatMult', 'FloatDiv', 'FloatSqrt',
352381SN/A            'MemRead', 'MemWrite', 'IprAccess', 'InstPrefetch']
362381SN/A
372381SN/Aclass OpDesc(SimObject):
382381SN/A    type = 'OpDesc'
392381SN/A    issueLat = Param.Int(1, "cycles until another can be issued")
402665Ssaidi@eecs.umich.edu    opClass = Param.OpType("type of operation")
412665Ssaidi@eecs.umich.edu    opLat = Param.Int(1, "cycles until result is available")
422665Ssaidi@eecs.umich.edu
432665Ssaidi@eecs.umich.educlass FUDesc(SimObject):
449031Sandreas.hansson@arm.com    type = 'FUDesc'
452381SN/A    count = Param.Int("number of these FU's available")
462381SN/A    opList = VectorParam.OpDesc("operation classes for this FU type")
472381SN/A