Line 1... |
Line 1... |
/*
|
/*
|
* $Id: aeMB_regfile.v,v 1.10 2007-04-25 22:52:53 sybreon Exp $
|
* $Id: aeMB_regfile.v,v 1.11 2007-04-26 14:29:53 sybreon Exp $
|
*
|
*
|
* AEMB Register File
|
* AEMB Register File
|
* 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
|
Line 23... |
Line 23... |
* 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.10 2007/04/25 22:52:53 sybreon
|
|
* Fixed minor simulation bug.
|
|
*
|
* Revision 1.9 2007/04/25 22:15:04 sybreon
|
* Revision 1.9 2007/04/25 22:15:04 sybreon
|
* Added support for 8-bit and 16-bit data types.
|
* Added support for 8-bit and 16-bit data types.
|
*
|
*
|
* Revision 1.8 2007/04/12 20:21:33 sybreon
|
* Revision 1.8 2007/04/12 20:21:33 sybreon
|
* Moved testbench into /sim/verilog.
|
* Moved testbench into /sim/verilog.
|
Line 117... |
Line 120... |
assign dwb_dat_o = {rDWBDAT[7:0],rDWBDAT[15:8],rDWBDAT[23:16],rDWBDAT[31:24]};
|
assign dwb_dat_o = {rDWBDAT[7:0],rDWBDAT[15:8],rDWBDAT[23:16],rDWBDAT[31:24]};
|
assign wDWBDAT = {dwb_dat_i[7:0],dwb_dat_i[15:8],dwb_dat_i[23:16],dwb_dat_i[31:24]};
|
assign wDWBDAT = {dwb_dat_i[7:0],dwb_dat_i[15:8],dwb_dat_i[23:16],dwb_dat_i[31:24]};
|
|
|
always @(/*AUTOSENSE*/rDWBSEL or wDWBDAT)
|
always @(/*AUTOSENSE*/rDWBSEL or wDWBDAT)
|
case (rDWBSEL)
|
case (rDWBSEL)
|
4'hF: sDWBDAT <= wDWBDAT;
|
default: sDWBDAT <= wDWBDAT;
|
4'hC: sDWBDAT <= {16'd0,wDWBDAT[31:16]};
|
4'hC: sDWBDAT <= {16'd0,wDWBDAT[31:16]};
|
4'h3: sDWBDAT <= {16'd0,wDWBDAT[15:0]};
|
4'h3: sDWBDAT <= {16'd0,wDWBDAT[15:0]};
|
4'h8: sDWBDAT <= {24'd0,wDWBDAT[31:24]};
|
4'h8: sDWBDAT <= {24'd0,wDWBDAT[31:24]};
|
4'h4: sDWBDAT <= {24'd0,wDWBDAT[23:16]};
|
4'h4: sDWBDAT <= {24'd0,wDWBDAT[23:16]};
|
4'h2: sDWBDAT <= {24'd0,wDWBDAT[15:8]};
|
4'h2: sDWBDAT <= {24'd0,wDWBDAT[15:8]};
|
4'h1: sDWBDAT <= {24'd0,wDWBDAT[7:0]};
|
4'h1: sDWBDAT <= {24'd0,wDWBDAT[7:0]};
|
default: sDWBDAT <= 32'h0;
|
//default: sDWBDAT <= 32'h0;
|
endcase // case (rDWBSEL)
|
endcase // case (rDWBSEL)
|
|
|
// Forwarding Control
|
// Forwarding Control
|
wire fDFWD = (rRD == rRD_) & fWE;
|
wire fDFWD = (rRD == rRD_) & fWE;
|
wire fMFWD = rDWBSTB & ~rDWBWE;
|
wire fMFWD = rDWBSTB & ~rDWBWE;
|