OpenCores
URL https://opencores.org/ocsvn/aemb/aemb/trunk

Subversion Repositories aemb

[/] [aemb/] [trunk/] [rtl/] [verilog/] [aeMB_xecu.v] - Diff between revs 50 and 53

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 50 Rev 53
Line 1... Line 1...
// $Id: aeMB_xecu.v,v 1.4 2007-11-08 14:17:47 sybreon Exp $
// $Id: aeMB_xecu.v,v 1.5 2007-11-09 20:51:52 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...
// License along with this library; if not, write to the Free Software
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
// USA
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.4  2007/11/08 14:17:47  sybreon
 
// Parameterised optional components.
 
//
// Revision 1.3  2007/11/03 08:34:55  sybreon
// Revision 1.3  2007/11/03 08:34:55  sybreon
// Minor code cleanup.
// Minor code cleanup.
//
//
// Revision 1.2  2007/11/02 19:20:58  sybreon
// Revision 1.2  2007/11/02 19:20:58  sybreon
// Added better (beta) interrupt support.
// Added better (beta) interrupt support.
Line 33... Line 36...
// Code compatible with -O0/1/2/3/s generated code.
// Code compatible with -O0/1/2/3/s generated code.
//
//
 
 
module aeMB_xecu (/*AUTOARG*/
module aeMB_xecu (/*AUTOARG*/
   // Outputs
   // Outputs
   dwb_adr_o, dwb_sel_o, rRESULT, rDWBSEL, rMSR_IE, rMSR_BIP,
   dwb_adr_o, dwb_sel_o, fsl_adr_o, rRESULT, rDWBSEL, rMSR_IE,
 
   rMSR_BIP,
   // Inputs
   // Inputs
   rXCE, rREGA, rREGB, rMXSRC, rMXTGT, rRA, rMXALU, rBRA, rDLY, rALT,
   rXCE, rREGA, rREGB, rMXSRC, rMXTGT, rRA, rRB, rMXALU, rBRA, rDLY,
   rSIMM, rIMM, rOPC, rRD, rDWBDI, rPC, gclk, grst, gena
   rALT, 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;
 
 
   // DATA WISHBONE
   // DATA WISHBONE
   output [DW-1:2] dwb_adr_o;
   output [DW-1:2] dwb_adr_o;
   output [3:0]    dwb_sel_o;
   output [3:0]    dwb_sel_o;
 
 
 
   // FSL WISHBONE
 
   output [14:2]   fsl_adr_o;
 
 
   // 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;
   input [4:0]      rRA, rRB;
   input [2:0]      rMXALU;
   input [2:0]      rMXALU;
   input           rBRA, rDLY;
   input           rBRA, rDLY;
   input [10:0]    rALT;
   input [10:0]    rALT;
 
 
   input [31:0]    rSIMM;
   input [31:0]    rSIMM;
Line 305... Line 312...
   assign           dwb_adr_o = rRESULT[DW-1:2];
   assign           dwb_adr_o = rRESULT[DW-1:2];
   assign           dwb_sel_o = rDWBSEL;
   assign           dwb_sel_o = rDWBSEL;
 
 
   always @(/*AUTOSENSE*/rOPC or wADD)
   always @(/*AUTOSENSE*/rOPC or wADD)
     case (rOPC[1:0])
     case (rOPC[1:0])
       2'o0: case (wADD[1:0])
       2'o0: case (wADD[1:0]) // 8'bit
               2'o0: xDWBSEL <= 4'h8;
               2'o0: xDWBSEL <= 4'h8;
               2'o1: xDWBSEL <= 4'h4;
               2'o1: xDWBSEL <= 4'h4;
               2'o2: xDWBSEL <= 4'h2;
               2'o2: xDWBSEL <= 4'h2;
               2'o3: xDWBSEL <= 4'h1;
               2'o3: xDWBSEL <= 4'h1;
             endcase // case (wADD[1:0])
             endcase // case (wADD[1:0])
       2'o1: xDWBSEL <= (wADD[1]) ? 4'h3 : 4'hC;
       2'o1: xDWBSEL <= (wADD[1]) ? 4'h3 : 4'hC; // 16'bit
       2'o2: xDWBSEL <= 4'hF;
       2'o2: xDWBSEL <= 4'hF; // 32'bit
       default: xDWBSEL <= 4'hX;
       2'o3: xDWBSEL <= 4'h0; // FSL
     endcase // case (rOPC[1:0])
     endcase // case (rOPC[1:0])
 
 
 
   // --- FSL WISHBONE --------------------
 
 
 
   reg [14:2]       rFSLADR, xFSLADR;
 
 
 
   assign           fsl_adr_o = rFSLADR[14:2];
 
 
 
   always @(/*AUTOSENSE*/rALT or rRB) begin
 
      xFSLADR <= {rALT, rRB[3:2]};
 
   end
 
 
   // --- SYNC ---
   // --- SYNC ---
 
 
   always @(posedge gclk)
   always @(posedge gclk)
     if (grst) begin
     if (grst) begin
        /*AUTORESET*/
        /*AUTORESET*/
        // Beginning of autoreset for uninitialized flops
        // Beginning of autoreset for uninitialized flops
        rDWBSEL <= 4'h0;
        rDWBSEL <= 4'h0;
 
        rFSLADR <= 13'h0;
        rMSR_BE <= 1'h0;
        rMSR_BE <= 1'h0;
        rMSR_BIP <= 1'h0;
        rMSR_BIP <= 1'h0;
        rMSR_C <= 1'h0;
        rMSR_C <= 1'h0;
        rMSR_IE <= 1'h0;
        rMSR_IE <= 1'h0;
        rRESULT <= 32'h0;
        rRESULT <= 32'h0;
Line 336... Line 354...
        rDWBSEL <= #1 xDWBSEL;
        rDWBSEL <= #1 xDWBSEL;
        rMSR_C <= #1 xMSR_C;
        rMSR_C <= #1 xMSR_C;
        rMSR_IE <= #1 xMSR_IE;
        rMSR_IE <= #1 xMSR_IE;
        rMSR_BE <= #1 xMSR_BE;
        rMSR_BE <= #1 xMSR_BE;
        rMSR_BIP <= #1 xMSR_BIP;
        rMSR_BIP <= #1 xMSR_BIP;
 
        rFSLADR <= #1 xFSLADR;
     end
     end
 
 
endmodule // aeMB_xecu
endmodule // aeMB_xecu
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.