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

Subversion Repositories versatile_library

[/] [versatile_library/] [trunk/] [rtl/] [verilog/] [arith.v] - Diff between revs 152 and 153

Show entire file | Details | Blame | View Log

Rev 152 Rev 153
Line 188... Line 188...
                     (sll) ?  {8{1'b0}}:
                     (sll) ?  {8{1'b0}}:
                     (s[4:3]==2'b01) ? tmp[1] :
                     (s[4:3]==2'b01) ? tmp[1] :
                     (s[4:3]==2'b10) ? tmp[2] :
                     (s[4:3]==2'b10) ? tmp[2] :
                     tmp[3];
                     tmp[3];
end else begin : impl_classic
end else begin : impl_classic
reg [31:0] dout;
 
//E2_ifdef SYSTEMVERILOG
assign dout =
always_comb
    (opcode==opcode_sll) ? din << s :
//E2_else
    (opcode==opcode_srl) ? din >> s :
always @ (din or s or opcode)
    (opcode==opcode_sra) ? (din >> s) | ({32{din[31]}} << (6'd32-{1'b0,s})) :
//E2_endif
    din << s;
    case (opcode)
 
    opcode_sll: dout = din << s;
 
    opcode_srl: dout = din >> s;
 
    opcode_sra: dout = (din >> s) | ({32{din[31]}} << (6'd32-{1'b0,s}));
 
    //opcode_ror: dout = not yet implemented
 
    default: dout = din << s;
 
    endcase
 
 
 
end
end
endgenerate
endgenerate
 
 
endmodule
endmodule

powered by: WebSVN 2.1.0

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