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

Subversion Repositories aemb

[/] [aemb/] [tags/] [AEMB_7_05/] [rtl/] [verilog/] [aeMB_regfile.v] - Diff between revs 3 and 4

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

Rev 3 Rev 4
Line 7... Line 7...
// Last Modified On: 2006-12-29
// Last Modified On: 2006-12-29
// Update Count    : 0
// Update Count    : 0
// Status          : Unknown, Use with caution!
// Status          : Unknown, Use with caution!
 
 
/*
/*
 * $Id: aeMB_regfile.v,v 1.1 2007-03-09 17:52:17 sybreon Exp $
 * $Id: aeMB_regfile.v,v 1.2 2007-03-26 12:21:31 sybreon Exp $
 *
 *
 * Copyright (C) 2006 Shawn Tan Ser Ngiap <shawn.tan@aeste.net>
 * Copyright (C) 2006 Shawn Tan Ser Ngiap <shawn.tan@aeste.net>
 *
 *
 * This library is free software; you can redistribute it and/or modify it
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * under the terms of the GNU Lesser General Public License as published by
Line 32... Line 32...
 * special actions during hardware exception/interrupts. Data forwarding
 * special actions during hardware exception/interrupts. Data forwarding
 * is also taken care of inside here to simplify decode logic.
 * is also taken care of inside here to simplify decode logic.
 *
 *
 * HISTORY
 * HISTORY
 * $Log: not supported by cvs2svn $
 * $Log: not supported by cvs2svn $
 
 * Revision 1.1  2007/03/09 17:52:17  sybreon
 
 * initial import
 
 *
 *
 *
 */
 */
 
 
module aeMB_regfile(/*AUTOARG*/
module aeMB_regfile(/*AUTOARG*/
   // Outputs
   // Outputs
Line 66... Line 69...
   reg [31:0]     r08,r09,r0A,r0B,r0C,r0D,r0E,r0F;
   reg [31:0]     r08,r09,r0A,r0B,r0C,r0D,r0E,r0F;
   reg [31:0]     r10,r11,r12,r13,r14,r15,r16,r17;
   reg [31:0]     r10,r11,r12,r13,r14,r15,r16,r17;
   reg [31:0]     r18,r19,r1A,r1B,r1C,r1D,r1E,r1F;
   reg [31:0]     r18,r19,r1A,r1B,r1C,r1D,r1E,r1F;
 
 
   // FLAGS
   // FLAGS
   wire fWE = rRWE;
   wire fWE = rRWE & ~rDWBWE;
   wire fLNK = rLNK;
   wire fLNK = rLNK;
   wire fLD = rDWBSTB ^ rDWBWE;
   wire fLD = rDWBSTB ^ rDWBWE;
 
 
   // PC Latch
   // PC Latch
   reg [31:0]     rPC_;
   reg [31:0]     rPC_;
Line 135... Line 138...
     end else begin // if (drun)
     end else begin // if (drun)
        /*AUTORESET*/
        /*AUTORESET*/
        // Beginning of autoreset for uninitialized flops
        // Beginning of autoreset for uninitialized flops
        rDWBDAT <= 32'h0;
        rDWBDAT <= 32'h0;
        // End of automatics
        // End of automatics
     end
     end // else: !if(drun)
 
 
   // Load Registers
   // Load Registers
   reg [31:0]         rREGA, rREGB;
   reg [31:0]         rREGA, rREGB;
   always @(posedge nclk or negedge nrst)
   always @(posedge nclk or negedge nrst)
     if (!nrst) begin
     if (!nrst) begin
Line 222... Line 225...
        /*AUTORESET*/
        /*AUTORESET*/
        // Beginning of autoreset for uninitialized flops
        // Beginning of autoreset for uninitialized flops
        rREGA <= 32'h0;
        rREGA <= 32'h0;
        rREGB <= 32'h0;
        rREGB <= 32'h0;
        // End of automatics
        // End of automatics
     end
     end // else: !if(drun)
 
 
 
 
   // Normal Registers
   // Normal Registers
   wire fR00 = (rRD_ == 5'h00);
   wire fR00 = (rRD_ == 5'h00);
   wire fR01 = (rRD_ == 5'h01);
   wire fR01 = (rRD_ == 5'h01);
Line 361... Line 364...
        r1C <= #1 (fR1C & fLD) ? wDWBDAT : (fR1C & fLNK) ? rPC_ : (fR1C & fWE) ? rRESULT : r1C;
        r1C <= #1 (fR1C & fLD) ? wDWBDAT : (fR1C & fLNK) ? rPC_ : (fR1C & fWE) ? rRESULT : r1C;
        r1D <= #1 (fR1D & fLD) ? wDWBDAT : (fR1D & fLNK) ? rPC_ : (fR1D & fWE) ? rRESULT : r1D;
        r1D <= #1 (fR1D & fLD) ? wDWBDAT : (fR1D & fLNK) ? rPC_ : (fR1D & fWE) ? rRESULT : r1D;
        r1E <= #1 (fR1E & fLD) ? wDWBDAT : (fR1E & fLNK) ? rPC_ : (fR1E & fWE) ? rRESULT : r1E;
        r1E <= #1 (fR1E & fLD) ? wDWBDAT : (fR1E & fLNK) ? rPC_ : (fR1E & fWE) ? rRESULT : r1E;
        r1F <= #1 (fR1F & fLD) ? wDWBDAT : (fR1F & fLNK) ? rPC_ : (fR1F & fWE) ? rRESULT : r1F;
        r1F <= #1 (fR1F & fLD) ? wDWBDAT : (fR1F & fLNK) ? rPC_ : (fR1F & fWE) ? rRESULT : r1F;
         */
         */
     end // if (drun)
     end // else: !if(!nrst)
 
 
   // Special Registers
   // Special Registers
   always @(negedge nclk or negedge nrst)
   always @(negedge nclk or negedge nrst)
     if (!nrst) begin
     if (!nrst) begin
        /*AUTORESET*/
        /*AUTORESET*/
Line 381... Line 384...
        r0E <= #1 (rFSM == 2'b11) ? rPC : // Needs verification
        r0E <= #1 (rFSM == 2'b11) ? rPC : // Needs verification
               (!fR0E) ? r0E : (fLD) ? wDWBDAT : (fLNK) ? rPC_ : (fWE) ? rRESULT : r0E;
               (!fR0E) ? r0E : (fLD) ? wDWBDAT : (fLNK) ? rPC_ : (fWE) ? rRESULT : r0E;
        // R11 - Exception
        // R11 - Exception
        r11 <= #1 (rFSM == 2'b10) ? rPC : // Needs verification
        r11 <= #1 (rFSM == 2'b10) ? rPC : // Needs verification
               (!fR11) ? r11 : (fLD) ? wDWBDAT : (fLNK) ? rPC_ : (fWE) ? rRESULT : r11;
               (!fR11) ? r11 : (fLD) ? wDWBDAT : (fLNK) ? rPC_ : (fWE) ? rRESULT : r11;
     end
     end // else: !if(!nrst)
 
 
 
 
endmodule // aeMB_regfile
endmodule // aeMB_regfile
 
 
// Local Variables:
// Local Variables:

powered by: WebSVN 2.1.0

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