aboutsummaryrefslogtreecommitdiff
path: root/src/shift_unit.v
diff options
context:
space:
mode:
Diffstat (limited to 'src/shift_unit.v')
-rw-r--r--src/shift_unit.v10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/shift_unit.v b/src/shift_unit.v
index ae1d665..e92334d 100644
--- a/src/shift_unit.v
+++ b/src/shift_unit.v
@@ -7,12 +7,14 @@ module shift_unit (
output reg [31:0] result
);
+`include "include/consts.vh"
+
always @ (*) begin
case (op)
- 2'b00: result <= a << b; // SLL
- 2'b01: result <= a >> b; // SRL
- 2'b11: result <= a >>> b; // SRA
- default: result <= 32'b0;
+ SHIFT_OP_SLL: result <= a << b; // SLL
+ SHIFT_OP_SRL: result <= a >> b; // SRL
+ SHIFT_OP_SRA: result <= a >>> b; // SRA
+ default: result <= 32'b0;
endcase
end