?? m3s079ct.v
字號:
//******************************************************************* ////IMPORTANT NOTICE ////================ ////Copyright Mentor Graphics Corporation 1996 - 1998. All rights reserved. ////This file and associated deliverables are the trade secrets, ////confidential information and copyrighted works of Mentor Graphics ////Corporation and its licensors and are subject to your license agreement ////with Mentor Graphics Corporation. //// ////These deliverables may be used for the purpose of making silicon for one ////IC design only. No further use of these deliverables for the purpose of ////making silicon from an IC design is permitted without the payment of an ////additional license fee. See your license agreement with Mentor Graphics ////for further details. If you have further questions please contact ////Mentor Graphics Customer Support. //// ////This Mentor Graphics core (m320c50eng v1999.010) was extracted on ////workstation hostid 800059c1 Inventra //// Accumulator Barrel Shifter (right only)// Copyright Mentor Graphics Corporation and Licensors 1998. // V1.002// m3s079ct.v// M320C50 Accumulator Barrel Shifter// Right barrel shifter used by BSAR, SATH & SATL instructions.//// ShiftCntrl:// 0 : BSAR instruction// 1 : SATH instruction// 2 : SATL instructionmodule m3s079ct (RightShiftOp, ACC, ScalerShift, ShiftCntrl, SXM);//******************************************************************* ////IMPORTANT NOTICE ////================ ////Copyright Mentor Graphics Corporation 1996 - 1998. All rights reserved. ////This file and associated deliverables are the trade secrets, ////confidential information and copyrighted works of Mentor Graphics ////Corporation and its licensors and are subject to your license agreement ////with Mentor Graphics Corporation. //// ////These deliverables may be used for the purpose of making silicon for one ////IC design only. No further use of these deliverables for the purpose of ////making silicon from an IC design is permitted without the payment of an ////additional license fee. See your license agreement with Mentor Graphics ////for further details. If you have further questions please contact ////Mentor Graphics Customer Support. //// ////This Mentor Graphics core (m320c50eng v1999.010) was extracted on ////workstation hostid 800059c1 Inventra // input [31:0] ACC; input [4:0] ScalerShift; input [2:0] ShiftCntrl; input SXM; output [31:0] RightShiftOp; reg TopBit; reg [31:0] RightShiftOp; // note that this variable is used as a temporary store reg [4:0] Shift;// Generate top bit from SXM and ACC bit 15always @(SXM or ACC) TopBit = SXM & ACC[31];// Create shift valuealways @(ShiftCntrl or ScalerShift) if (ShiftCntrl[0]) Shift = ScalerShift[3:0] + 1; else begin Shift[4] = ScalerShift[4] & ~ShiftCntrl[2] & ShiftCntrl[1]; Shift[3] = ScalerShift[3] & ShiftCntrl[2]; Shift[2] = ScalerShift[2] & ShiftCntrl[2]; Shift[1] = ScalerShift[1] & ShiftCntrl[2]; Shift[0] = ScalerShift[0] & ShiftCntrl[2]; end// Barrel shifteralways @(ACC or Shift or TopBit)begin if (Shift[0]) // shift 1 bit right RightShiftOp = {TopBit,ACC[31:1]}; else RightShiftOp = {ACC[31:0]}; if (Shift[1]) // shift 2 bits right RightShiftOp = {TopBit,TopBit,RightShiftOp[31:2]}; else RightShiftOp = {RightShiftOp[31:0]}; if (Shift[2]) // shift 4 bits right RightShiftOp = {TopBit,TopBit,TopBit,TopBit,RightShiftOp[31:4]}; else RightShiftOp = {RightShiftOp[31:0]}; if (Shift[3]) // shift 8 bits right RightShiftOp = {TopBit,TopBit,TopBit,TopBit,TopBit,TopBit,TopBit,TopBit, RightShiftOp[31:8]}; else RightShiftOp = {RightShiftOp[31:0]}; if (Shift[4]) // shift 16 bits right RightShiftOp = {TopBit,TopBit,TopBit,TopBit,TopBit,TopBit,TopBit,TopBit, TopBit,TopBit,TopBit,TopBit,TopBit,TopBit,TopBit,TopBit, RightShiftOp[31:16]}; else RightShiftOp = {RightShiftOp[31:0]};endendmodule
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -