From 9c7d7fd782f70d99120ce6ac45a897606b52c878 Mon Sep 17 00:00:00 2001 From: Flavian Kaufmann Date: Mon, 13 May 2024 17:48:26 +0200 Subject: refactoring constants --- src/shift_unit.v | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/shift_unit.v') 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 -- cgit v1.2.3