⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 funcunits.cc

📁 ml-rsim 多处理器模拟器 支持类bsd操作系统
💻 CC
📖 第 1 页 / 共 2 页
字号:
/* * Copyright (c) 2002 The Board of Trustees of the University of Illinois and *                    William Marsh Rice University * Copyright (c) 2002 The University of Utah * Copyright (c) 2002 The University of Notre Dame du Lac * * All rights reserved. * * Based on RSIM 1.0, developed by: *   Professor Sarita Adve's RSIM research group *   University of Illinois at Urbana-Champaign and     William Marsh Rice University *   http://www.cs.uiuc.edu/rsim and http://www.ece.rice.edu/~rsim/dist.html * ML-RSIM/URSIM extensions by: *   The Impulse Research Group, University of Utah *   http://www.cs.utah.edu/impulse *   Lambert Schaelicke, University of Utah and University of Notre Dame du Lac *   http://www.cse.nd.edu/~lambert *   Mike Parker, University of Utah *   http://www.cs.utah.edu/~map * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal with the Software without restriction, including without * limitation the rights to use, copy, modify, merge, publish, distribute, * sublicense, and/or sell copies of the Software, and to permit persons to * whom the Software is furnished to do so, subject to the following * conditions: * * 1. Redistributions of source code must retain the above copyright notice, *    this list of conditions and the following disclaimers.  * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimers in the *    documentation and/or other materials provided with the distribution. * 3. Neither the names of Professor Sarita Adve's RSIM research group, *    the University of Illinois at Urbana-Champaign, William Marsh Rice *    University, nor the names of its contributors may be used to endorse *    or promote products derived from this Software without specific prior *    written permission.  * 4. Neither the names of the ML-RSIM project, the URSIM project, the *    Impulse research group, the University of Utah, the University of *    Notre Dame du Lac, nor the names of its contributors may be used to *    endorse or promote products derived from this software without specific *    prior written permission.  * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS WITH THE SOFTWARE.  */#include <stdio.h>extern "C"{#include "Caches/system.h"#include "Caches/req.h"} #include "Processor/funcunits.h"#include "Processor/registers.h"#include "Processor/instruction.h"#define BT 1            /* Byte        */#define HW 2            /* Half-word   */#define WD 4            /* Word        */#define DW 8            /* Double word */#define QW 16           /* Quad word   */UTYPE   unit[numINSTRS];LATTYPE lattype[numINSTRS];ReqType mem_acctype[numINSTRS];int     mem_length[numINSTRS];/*  * set the names for the latency types  */const char *lattype_names[lNUM_LAT_TYPES] ={  "ALU time            ",  "User 1 time         ",  "User 2 time         ",  "User 3 time         ",  "User 4 time         ",  "User 5 time         ",  "User 6 time         ",  "User 7 time         ",  "User 8 time         ",  "User 9 time         ",  "Barrier time        ",  "Spin time           ",  "Acquire time        ",  "Release time        ",  "RMW time            ",  "Write time          ",  "Read time           ",  "Branch time         ",  "FPU time            ",  "Except time         ",  "MEMBAR time         ",  "BUSY TIME           ",  "Read miss time      ",  "Write miss time     ",  "RMW miss time       ",  "Read L1 time        ",  "Read L2 time        ",  "Read localmem time  ",  "Read remotemem time ",  "Write L1 time       ",  "Write L2 time       ",  "Write localmem time ",  "Write remotemem time",  "RMW L1 time         ",  "RMW L2 time         ",  "RMW localmem time   ",  "RMW remotemem time  ",  "RMW Late PF time    ",  "Write Late PF time  ",  "Read Late PF time   "};void UnitArraySetup(){  unit[iRESERVED]      = uALU;  unit[iCALL]          = uALU;  unit[iILLTRAP]       = uALU;  unit[iBPcc]          = uALU;  unit[iBicc]          = uALU;  unit[iBPr]           = uALU;  unit[iFBPfcc]        = uALU;  unit[iFBfcc]         = uALU;  unit[iSETHI]         = uALU;  unit[iADD]           = uALU;  unit[iAND]           = uALU;  unit[iOR]            = uALU;  unit[iXOR]           = uALU;  unit[iSUB]           = uALU;  unit[iANDN]          = uALU;  unit[iORN]           = uALU;  unit[iXNOR]          = uALU;  unit[iADDC]          = uALU;  unit[iMULX]          = uALU;  // uMUL  unit[iUMUL]          = uALU;  // uMUL  unit[iSMUL]          = uALU;  // uMUL  unit[iUDIVX]         = uALU;  // uMUL  unit[iUDIV]          = uALU;  // uMUL  unit[iSDIV]          = uALU;  // uMUL    unit[iSUBC]          = uALU;  unit[iADDcc]         = uALU;  unit[iANDcc]         = uALU;  unit[iORcc]          = uALU;  unit[iXORcc]         = uALU;  unit[iSUBcc]         = uALU;  unit[iANDNcc]        = uALU;  unit[iORNcc]         = uALU;  unit[iXNORcc]        = uALU;  unit[iADDCcc]        = uALU;  unit[iUMULcc]        = uALU;        // uMUL  unit[iSMULcc]        = uALU;        // uMUL  unit[iUDIVcc]        = uALU;        // uMUL  unit[iSDIVcc]        = uALU;        // uMUL    unit[iSUBCcc]        = uALU;  unit[iTADDcc]        = uALU;  unit[iTSUBcc]        = uALU;  unit[iTADDccTV]      = uALU;  unit[iTSUBccTV]      = uALU;  unit[iMULScc]        = uALU;  unit[iSLL]           = uALU;   // uSHIFT  unit[iSRL]           = uALU;   // uSHIFT  unit[iSRA]           = uALU;   // uSHIFT  unit[iarithSPECIAL1] = uALU;   // arithSPECIAL1 includes MEMBAR  unit[iRDPR]          = uALU;  unit[iFLUSHW]        = uALU;  unit[iMOVcc]         = uALU;  unit[iSDIVX]         = uALU;  unit[iPOPC]          = uALU;  unit[iMOVR]          = uALU;  unit[iarithSPECIAL2] = uALU;  unit[iSAVRESTD]      = uALU;  unit[iWRPR]          = uALU;  unit[iIMPDEP1]       = uALU;  unit[iIMPDEP2]       = uALU;  unit[iJMPL]          = uALU;  unit[iRETURN]        = uALU;  unit[iTcc]           = uALU;  unit[iFLUSH]         = uMEM;  unit[iSAVE]          = uALU;  unit[iRESTORE]       = uALU;  unit[iDONERETRY]     = uALU;  unit[iFMOVs]         = uFP;  unit[iFMOVd]         = uFP;  unit[iFMOVq]         = uFP;  // since these are such simple ops  unit[iFNEGs]         = uFP;  // let them run at high speed  unit[iFNEGd]         = uFP;  unit[iFNEGq]         = uFP;  unit[iFABSs]         = uFP;  unit[iFABSd]         = uFP;  unit[iFABSq]         = uFP;  unit[iFSQRTs]        = uFP;  unit[iFSQRTd]        = uFP;  unit[iFSQRTq]        = uFP;  unit[iFADDs]         = uFP;  unit[iFADDd]         = uFP;  unit[iFADDq]         = uFP;  unit[iFSUBs]         = uFP;  unit[iFSUBd]         = uFP;  unit[iFSUBq]         = uFP;  unit[iFMULs]         = uFP;  unit[iFMULd]         = uFP;  unit[iFMULq]         = uFP;  unit[iFDIVs]         = uFP;  unit[iFDIVd]         = uFP;  unit[iFDIVq]         = uFP;  unit[iFsMULd]        = uFP;  unit[iFdMULq]        = uFP;  unit[iFsTOx]         = uFP;  unit[iFdTOx]         = uFP;  unit[iFqTOx]         = uFP;  unit[iFxTOs]         = uFP;  unit[iFxTOd]         = uFP;  unit[iFxToq]         = uFP;  unit[iFiTOs]         = uFP;  unit[iFdTOs]         = uFP;  unit[iFqTOs]         = uFP;  unit[iFiTOd]         = uFP;  unit[iFsTOd]         = uFP;  unit[iFqTOd]         = uFP;  unit[iFiTOq]         = uFP;  unit[iFsTOq]         = uFP;  unit[iFdTOq]         = uFP;  unit[iFsTOi]         = uFP;  unit[iFdTOi]         = uFP;  unit[iFqTOi]         = uFP;  unit[iFMOVs0]        = uFP;  unit[iFMOVd0]        = uFP;  unit[iFMOVq0]        = uFP;  unit[iFMOVs1]        = uFP;  unit[iFMOVd1]        = uFP;  unit[iFMOVq1]        = uFP;  unit[iFMOVs2]        = uFP;  unit[iFMOVd2]        = uFP;  unit[iFMOVq2]        = uFP;  unit[iFMOVs3]        = uFP;  unit[iFMOVd3]        = uFP;  unit[iFMOVq3]        = uFP;  unit[iFMOVsi]        = uFP;  unit[iFMOVdi]        = uFP;  unit[iFMOVqi]        = uFP;  unit[iFMOVsx]        = uFP;  unit[iFMOVdx]        = uFP;  unit[iFMOVqx]        = uFP;  unit[iFCMPs]         = uFP;  unit[iFCMPd]         = uFP;  unit[iFCMPq]         = uFP;  unit[iFCMPEs]        = uFP;  unit[iFCMPEd]        = uFP;  unit[iFCMPEq]        = uFP;  unit[iFMOVRsZ]       = uFP;  unit[iFMOVRdZ]       = uFP;  unit[iFMOVRqZ]       = uFP;  unit[iFMOVRsLEZ]     = uFP;  unit[iFMOVRdLEZ]     = uFP;  unit[iFMOVRqLEZ]     = uFP;  unit[iFMOVRsLZ]      = uFP;  unit[iFMOVRdLZ]      = uFP;  unit[iFMOVRqLZ]      = uFP;  unit[iFMOVRsNZ]      = uFP;    unit[iFMOVRdNZ]      = uFP;  unit[iFMOVRqNZ]      = uFP;  unit[iFMOVRsGZ]      = uFP;  unit[iFMOVRdGZ]      = uFP;  unit[iFMOVRqGZ]      = uFP;  unit[iFMOVRsGEZ]     = uFP;    unit[iFMOVRdGEZ]     = uFP;  unit[iFMOVRqGEZ]     = uFP;  unit[iLDUW]          = uMEM;  unit[iLDUB]          = uMEM;  unit[iLDUH]          = uMEM;  unit[iLDD]           = uMEM;  unit[iSTW]           = uMEM;  unit[iSTB]           = uMEM;  unit[iSTH]           = uMEM;  unit[iSTD]           = uMEM;  unit[iLDSW]          = uMEM;  unit[iLDSB]          = uMEM;  unit[iLDSH]          = uMEM;  unit[iLDX]           = uMEM;  unit[iLDSTUB]        = uMEM;  unit[iSTX]           = uMEM;  unit[iSWAP]          = uMEM;  unit[iLDUWA]         = uMEM;  unit[iLDUBA]         = uMEM;  unit[iLDUHA]         = uMEM;  unit[iLDDA]          = uMEM;  unit[iSTWA]          = uMEM;  unit[iSTBA]          = uMEM;  unit[iSTHA]          = uMEM;  unit[iSTDA]          = uMEM;  unit[iLDSWA]         = uMEM;  unit[iLDSBA]         = uMEM;  unit[iLDSHA]         = uMEM;  unit[iLDXA]          = uMEM;  unit[iLDSTUBA]       = uMEM;  unit[iSTXA]          = uMEM;  unit[iSWAPA]         = uMEM;  unit[iLDF]           = uMEM;  unit[iLDFSR]         = uMEM;  unit[iLDXFSR]        = uMEM;  unit[iLDQF]          = uMEM;  unit[iLDDF]          = uMEM;  unit[iSTF]           = uMEM;  unit[iSTFSR]         = uMEM;  unit[iSTXFSR]        = uMEM;  unit[iSTQF]          = uMEM;  unit[iSTDF]          = uMEM;  unit[iPREFETCH]      = uMEM;  unit[iLDFA]          = uMEM;  unit[iLDQFA]         = uMEM;  unit[iLDDFA]         = uMEM;  unit[iSTFA]          = uMEM;  unit[iSTQFA]         = uMEM;   /* remote write related instructions */  unit[iRWSD]          = uMEM;  unit[iRWWT_I]        = uMEM;  unit[iRWWT_F]        = uMEM;  unit[iRWWTI_I]       = uMEM;  unit[iRWWTI_F]       = uMEM;  unit[iRWWS_I]        = uMEM;  unit[iRWWS_F]        = uMEM;  unit[iRWWSI_I]       = uMEM;  unit[iRWWSI_F]       = uMEM;  /* end of remote write instructions */    unit[iSTDFA]         = uMEM;  unit[iCASA]          = uMEM;  unit[iPREFETCHA]     = uMEM;  unit[iCASXA]         = uMEM;    /* remote write related types */    mem_acctype[iRWWT_I]    = RWRITE;  mem_length[iRWWT_I]     = WD;  mem_acctype[iRWWTI_I]   = RWRITE;  mem_length[iRWWTI_I]    = WD;  mem_acctype[iRWWS_I]    = RWRITE;  mem_length[iRWWS_I]     = WD;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -