Line 42... |
Line 42... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.2 2001/08/09 13:39:33 lampret
|
|
// Major clean-up.
|
|
//
|
// Revision 1.1 2001/07/20 00:46:21 lampret
|
// Revision 1.1 2001/07/20 00:46:21 lampret
|
// Development version of RTL. Libraries are missing.
|
// Development version of RTL. Libraries are missing.
|
//
|
//
|
//
|
//
|
|
|
|
// synopsys translate_off
|
`include "timescale.v"
|
`include "timescale.v"
|
|
// synopsys translate_on
|
`include "defines.v"
|
`include "defines.v"
|
|
|
module reg2mem(addr, lsu_op, regdata, memdata);
|
module reg2mem(addr, lsu_op, regdata, memdata);
|
|
|
parameter width = `OPERAND_WIDTH;
|
parameter width = `OPERAND_WIDTH;
|
Line 72... |
Line 77... |
//
|
//
|
// Mux to memdata[31:24]
|
// Mux to memdata[31:24]
|
//
|
//
|
always @(lsu_op or addr or regdata) begin
|
always @(lsu_op or addr or regdata) begin
|
casex({lsu_op, addr[1:0]}) // synopsys full_case parallel_case
|
casex({lsu_op, addr[1:0]}) // synopsys full_case parallel_case
|
{`LSUOP_SB, 2'b00} : memdata[31:24] <= #1 regdata[7:0];
|
{`LSUOP_SB, 2'b00} : memdata[31:24] = regdata[7:0];
|
{`LSUOP_SH, 2'b00} : memdata[31:24] <= #1 regdata[15:8];
|
{`LSUOP_SH, 2'b00} : memdata[31:24] = regdata[15:8];
|
default : memdata[31:24] <= #1 regdata[31:24];
|
default : memdata[31:24] = regdata[31:24];
|
endcase
|
endcase
|
end
|
end
|
|
|
//
|
//
|
// Mux to memdata[23:16]
|
// Mux to memdata[23:16]
|
//
|
//
|
always @(lsu_op or addr or regdata) begin
|
always @(lsu_op or addr or regdata) begin
|
casex({lsu_op, addr[1:0]}) // synopsys full_case parallel_case
|
casex({lsu_op, addr[1:0]}) // synopsys full_case parallel_case
|
{`LSUOP_SW, 2'b00} : memdata[23:16] <= #1 regdata[23:16];
|
{`LSUOP_SW, 2'b00} : memdata[23:16] = regdata[23:16];
|
default : memdata[23:16] <= #1 regdata[7:0];
|
default : memdata[23:16] = regdata[7:0];
|
endcase
|
endcase
|
end
|
end
|
|
|
//
|
//
|
// Mux to memdata[15:8]
|
// Mux to memdata[15:8]
|
//
|
//
|
always @(lsu_op or addr or regdata) begin
|
always @(lsu_op or addr or regdata) begin
|
casex({lsu_op, addr[1:0]}) // synopsys full_case parallel_case
|
casex({lsu_op, addr[1:0]}) // synopsys full_case parallel_case
|
{`LSUOP_SB, 2'b10} : memdata[15:8] <= #1 regdata[7:0];
|
{`LSUOP_SB, 2'b10} : memdata[15:8] = regdata[7:0];
|
default : memdata[15:8] <= #1 regdata[15:8];
|
default : memdata[15:8] = regdata[15:8];
|
endcase
|
endcase
|
end
|
end
|
|
|
//
|
//
|
// Mux to memdata[7:0]
|
// Mux to memdata[7:0]
|
//
|
//
|
always @(regdata)
|
always @(regdata)
|
memdata[7:0] <= #1 regdata[7:0];
|
memdata[7:0] = regdata[7:0];
|
|
|
endmodule
|
endmodule
|
|
|
No newline at end of file
|
No newline at end of file
|