Line 1... |
Line 1... |
// $Id: aeMB_xecu.v,v 1.6 2007-11-10 16:39:38 sybreon Exp $
|
// $Id: aeMB_xecu.v,v 1.7 2007-11-14 22:14:34 sybreon Exp $
|
//
|
//
|
// AEMB MAIN EXECUTION ALU
|
// AEMB MAIN EXECUTION ALU
|
//
|
//
|
// Copyright (C) 2004-2007 Shawn Tan Ser Ngiap <shawn.tan@aeste.net>
|
// Copyright (C) 2004-2007 Shawn Tan Ser Ngiap <shawn.tan@aeste.net>
|
//
|
//
|
Line 18... |
Line 18... |
//
|
//
|
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
// License along with AEMB. If not, see <http://www.gnu.org/licenses/>.
|
// License along with AEMB. If not, see <http://www.gnu.org/licenses/>.
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.6 2007/11/10 16:39:38 sybreon
|
|
// Upgraded license to LGPLv3.
|
|
// Significant performance optimisations.
|
|
//
|
// Revision 1.5 2007/11/09 20:51:52 sybreon
|
// Revision 1.5 2007/11/09 20:51:52 sybreon
|
// Added GET/PUT support through a FSL bus.
|
// Added GET/PUT support through a FSL bus.
|
//
|
//
|
// Revision 1.4 2007/11/08 14:17:47 sybreon
|
// Revision 1.4 2007/11/08 14:17:47 sybreon
|
// Parameterised optional components.
|
// Parameterised optional components.
|
Line 42... |
Line 46... |
module aeMB_xecu (/*AUTOARG*/
|
module aeMB_xecu (/*AUTOARG*/
|
// Outputs
|
// Outputs
|
dwb_adr_o, dwb_sel_o, fsl_adr_o, rRESULT, rDWBSEL, rMSR_IE,
|
dwb_adr_o, dwb_sel_o, fsl_adr_o, rRESULT, rDWBSEL, rMSR_IE,
|
rMSR_BIP,
|
rMSR_BIP,
|
// Inputs
|
// Inputs
|
rXCE, rREGA, rREGB, rMXSRC, rMXTGT, rRA, rRB, rMXALU, rBRA, rDLY,
|
rREGA, rREGB, rMXSRC, rMXTGT, rRA, rRB, rMXALU, rBRA, rDLY, rALT,
|
rALT, rSIMM, rIMM, rOPC, rRD, rDWBDI, rPC, gclk, grst, gena
|
rSIMM, rIMM, rOPC, rRD, rDWBDI, rPC, gclk, grst, gena
|
);
|
);
|
parameter DW=32;
|
parameter DW=32;
|
|
|
parameter MUL=0;
|
parameter MUL=0;
|
parameter BSF=0;
|
parameter BSF=0;
|
Line 62... |
Line 66... |
// INTERNAL
|
// INTERNAL
|
output [31:0] rRESULT;
|
output [31:0] rRESULT;
|
output [3:0] rDWBSEL;
|
output [3:0] rDWBSEL;
|
output rMSR_IE;
|
output rMSR_IE;
|
output rMSR_BIP;
|
output rMSR_BIP;
|
input [1:0] rXCE;
|
//input [1:0] rXCE;
|
input [31:0] rREGA, rREGB;
|
input [31:0] rREGA, rREGB;
|
input [1:0] rMXSRC, rMXTGT;
|
input [1:0] rMXSRC, rMXTGT;
|
input [4:0] rRA, rRB;
|
input [4:0] rRA, rRB;
|
input [2:0] rMXALU;
|
input [2:0] rMXALU;
|
input rBRA, rDLY;
|
input rBRA, rDLY;
|
Line 250... |
Line 254... |
// C
|
// C
|
wire fMTS = (rOPC == 6'o45) & rIMM[14];
|
wire fMTS = (rOPC == 6'o45) & rIMM[14];
|
wire fADDC = ({rOPC[5:4], rOPC[2]} == 3'o0);
|
wire fADDC = ({rOPC[5:4], rOPC[2]} == 3'o0);
|
|
|
always @(/*AUTOSENSE*/fADDC or fMTS or fSKIP or rMSR_C or rMXALU
|
always @(/*AUTOSENSE*/fADDC or fMTS or fSKIP or rMSR_C or rMXALU
|
or rOPA or rRES_ADDC or rRES_SFTC or rXCE)
|
or rOPA or rRES_ADDC or rRES_SFTC)
|
if (fSKIP | |rXCE) begin
|
//if (fSKIP | |rXCE) begin
|
|
if (fSKIP) begin
|
xMSR_C <= rMSR_C;
|
xMSR_C <= rMSR_C;
|
end else
|
end else
|
case (rMXALU)
|
case (rMXALU)
|
3'o0: xMSR_C <= (fADDC) ? rRES_ADDC : rMSR_C;
|
3'o0: xMSR_C <= (fADDC) ? rRES_ADDC : rMSR_C;
|
3'o1: xMSR_C <= rMSR_C; // LOGIC
|
3'o1: xMSR_C <= rMSR_C; // LOGIC
|
Line 267... |
Line 272... |
endcase
|
endcase
|
|
|
// IE/BIP/BE
|
// IE/BIP/BE
|
wire fRTID = (rOPC == 6'o55) & rRD[0];
|
wire fRTID = (rOPC == 6'o55) & rRD[0];
|
wire fRTBD = (rOPC == 6'o55) & rRD[1];
|
wire fRTBD = (rOPC == 6'o55) & rRD[1];
|
wire fBRK = ((rOPC == 6'o56) | (rOPC == 6'o66)) & (rRA[4:2] == 3'o3);
|
wire fBRK = ((rOPC == 6'o56) | (rOPC == 6'o66)) & (rRA == 5'hC);
|
|
wire fXCE = ((rOPC == 6'o56) | (rOPC == 6'o66)) & (rRA == 5'hE);
|
|
|
always @(/*AUTOSENSE*/fMTS or fRTID or rMSR_IE or rOPA or rXCE)
|
always @(/*AUTOSENSE*/fMTS or fRTID or fXCE or rMSR_IE or rOPA)
|
xMSR_IE <= (rXCE == 2'o2) ? 1'b0 :
|
xMSR_IE <= (fXCE) ? 1'b0 :
|
(fRTID) ? 1'b1 :
|
(fRTID) ? 1'b1 :
|
(fMTS) ? rOPA[1] :
|
(fMTS) ? rOPA[1] :
|
rMSR_IE;
|
rMSR_IE;
|
|
|
always @(/*AUTOSENSE*/fBRK or fMTS or fRTBD or rMSR_BIP or rOPA)
|
always @(/*AUTOSENSE*/fBRK or fMTS or fRTBD or rMSR_BIP or rOPA)
|