mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Cleaning shifter
This commit is contained in:
parent
ebcffcdebd
commit
53baf3e787
@ -38,7 +38,7 @@ module shifter (
|
|||||||
// extension.
|
// extension.
|
||||||
|
|
||||||
generate
|
generate
|
||||||
if (`XLEN==32) begin
|
if (`XLEN==32) begin:shifter
|
||||||
// funnel shifter (see CMOS VLSI Design 4e Section 11.8.1, note Table 11.11 shift types wrong)
|
// funnel shifter (see CMOS VLSI Design 4e Section 11.8.1, note Table 11.11 shift types wrong)
|
||||||
logic [62:0] z, zshift;
|
logic [62:0] z, zshift;
|
||||||
logic [4:0] offset;
|
logic [4:0] offset;
|
||||||
@ -56,7 +56,7 @@ module shifter (
|
|||||||
// funnel operation
|
// funnel operation
|
||||||
assign zshift = z >> offset;
|
assign zshift = z >> offset;
|
||||||
assign y = zshift[31:0];
|
assign y = zshift[31:0];
|
||||||
end else begin // RV64
|
end else begin:shifter // RV64
|
||||||
// funnel shifter followed by masking
|
// funnel shifter followed by masking
|
||||||
// research idea: investigate shifter designs for mixed 32/64-bit shifts
|
// research idea: investigate shifter designs for mixed 32/64-bit shifts
|
||||||
logic [126:0] z, zshift;
|
logic [126:0] z, zshift;
|
||||||
@ -83,12 +83,7 @@ module shifter (
|
|||||||
|
|
||||||
// funnel operation
|
// funnel operation
|
||||||
assign zshift = z >> offset;
|
assign zshift = z >> offset;
|
||||||
assign ylower = zshift[31:0];
|
assign y = zshift[63:0];
|
||||||
|
|
||||||
// mask upper 32 bits for W-type 32-bit shifts
|
|
||||||
// harris: is there a clever way to get zshift[31] earlier for arithmetic right shifts to speed up critical path?
|
|
||||||
assign yupper = w64 ? {32{zshift[31]}} : zshift[63:32];
|
|
||||||
assign y = {yupper, ylower};
|
|
||||||
end
|
end
|
||||||
endgenerate
|
endgenerate
|
||||||
endmodule
|
endmodule
|
||||||
|
Loading…
Reference in New Issue
Block a user