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

Subversion Repositories or1k

[/] [or1k/] [tags/] [asyst_3/] [or1200/] [rtl/] [verilog/] [or1200_mem2reg.v] - Diff between revs 777 and 788

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

Rev 777 Rev 788
Line 42... Line 42...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.3  2002/03/28 19:14:10  lampret
 
// Changed define name from OR1200_MEM2REG_FAST to OR1200_IMPL_MEM2REG2
 
//
// Revision 1.2  2002/01/14 06:18:22  lampret
// Revision 1.2  2002/01/14 06:18:22  lampret
// Fixed mem2reg bug in FAST implementation. Updated debug unit to work with new genpc/if.
// Fixed mem2reg bug in FAST implementation. Updated debug unit to work with new genpc/if.
//
//
// Revision 1.1  2002/01/03 08:16:15  lampret
// Revision 1.1  2002/01/03 08:16:15  lampret
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
Line 200... Line 203...
 
 
//
//
// Byte 0
// Byte 0
//
//
always @(sel_byte0 or memdata) begin
always @(sel_byte0 or memdata) begin
 
`ifdef OR1200_ADDITIONAL_SYNOPSYS_DIRECTIVES
        case(sel_byte0) // synopsys full_case parallel_case infer_mux
        case(sel_byte0) // synopsys full_case parallel_case infer_mux
 
`else
 
        case(sel_byte0) // synopsys full_case parallel_case
 
`endif
                `OR1200_M2R_BYTE0: begin
                `OR1200_M2R_BYTE0: begin
                                regdata_ll = memdata[7:0];
                                regdata_ll = memdata[7:0];
                        end
                        end
                `OR1200_M2R_BYTE1: begin
                `OR1200_M2R_BYTE1: begin
                                regdata_ll = memdata[15:8];
                                regdata_ll = memdata[15:8];
Line 220... Line 227...
 
 
//
//
// Byte 1
// Byte 1
//
//
always @(sel_byte1 or memdata) begin
always @(sel_byte1 or memdata) begin
 
`ifdef OR1200_ADDITIONAL_SYNOPSYS_DIRECTIVES
        case(sel_byte1) // synopsys full_case parallel_case infer_mux
        case(sel_byte1) // synopsys full_case parallel_case infer_mux
 
`else
 
        case(sel_byte1) // synopsys full_case parallel_case
 
`endif
                `OR1200_M2R_ZERO: begin
                `OR1200_M2R_ZERO: begin
                                regdata_lh = 8'h00;
                                regdata_lh = 8'h00;
                        end
                        end
                `OR1200_M2R_BYTE1: begin
                `OR1200_M2R_BYTE1: begin
                                regdata_lh = memdata[15:8];
                                regdata_lh = memdata[15:8];
Line 249... Line 260...
 
 
//
//
// Byte 2
// Byte 2
//
//
always @(sel_byte2 or memdata) begin
always @(sel_byte2 or memdata) begin
 
`ifdef OR1200_ADDITIONAL_SYNOPSYS_DIRECTIVES
        case(sel_byte2) // synopsys full_case parallel_case infer_mux
        case(sel_byte2) // synopsys full_case parallel_case infer_mux
 
`else
 
        case(sel_byte2) // synopsys full_case parallel_case
 
`endif
                `OR1200_M2R_ZERO: begin
                `OR1200_M2R_ZERO: begin
                                regdata_hl = 8'h00;
                                regdata_hl = 8'h00;
                        end
                        end
                `OR1200_M2R_BYTE2: begin
                `OR1200_M2R_BYTE2: begin
                                regdata_hl = memdata[23:16];
                                regdata_hl = memdata[23:16];
Line 275... Line 290...
 
 
//
//
// Byte 3
// Byte 3
//
//
always @(sel_byte3 or memdata) begin
always @(sel_byte3 or memdata) begin
 
`ifdef OR1200_ADDITIONAL_SYNOPSYS_DIRECTIVES
        case(sel_byte3) // synopsys full_case parallel_case infer_mux
        case(sel_byte3) // synopsys full_case parallel_case infer_mux
 
`else
 
        case(sel_byte3) // synopsys full_case parallel_case
 
`endif
                `OR1200_M2R_ZERO: begin
                `OR1200_M2R_ZERO: begin
                                regdata_hh = 8'h00;
                                regdata_hh = 8'h00;
                        end
                        end
                `OR1200_M2R_BYTE3: begin
                `OR1200_M2R_BYTE3: begin
                                regdata_hh = memdata[31:24];
                                regdata_hh = memdata[31:24];
Line 300... Line 319...
end
end
 
 
`else
`else
 
 
//
//
// Slow implementation of mem2reg
// Straightforward implementation of mem2reg
//
//
 
 
reg     [width-1:0]              regdata;
reg     [width-1:0]              regdata;
reg     [width-1:0]              aligned;
reg     [width-1:0]              aligned;
 
 
//
//
// Alignment
// Alignment
//
//
always @(addr or memdata) begin
always @(addr or memdata) begin
 
`ifdef OR1200_ADDITIONAL_SYNOPSYS_DIRECTIVES
        case(addr) // synopsys infer_mux
        case(addr) // synopsys infer_mux
 
`else
 
        case(addr) // synopsys full_case parallel_case
 
`endif
                2'b00:
                2'b00:
                        aligned = memdata;
                        aligned = memdata;
                2'b01:
                2'b01:
                        aligned = {memdata[23:0], 8'b0};
                        aligned = {memdata[23:0], 8'b0};
                2'b10:
                2'b10:
Line 326... Line 349...
 
 
//
//
// Bytes
// Bytes
//
//
always @(lsu_op or aligned) begin
always @(lsu_op or aligned) begin
 
`ifdef OR1200_ADDITIONAL_SYNOPSYS_DIRECTIVES
        case(lsu_op) // synopsys infer_mux
        case(lsu_op) // synopsys infer_mux
 
`else
 
        case(lsu_op) // synopsys parallel_case
 
`endif
                `OR1200_LSUOP_LBZ: begin
                `OR1200_LSUOP_LBZ: begin
                                regdata[7:0] = aligned[31:24];
                                regdata[7:0] = aligned[31:24];
                                regdata[31:8] = 24'b0;
                                regdata[31:8] = 24'b0;
                        end
                        end
                `OR1200_LSUOP_LBS: begin
                `OR1200_LSUOP_LBS: begin

powered by: WebSVN 2.1.0

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