From 84e9a917a31f39eaf333d1fc69b30d13e7640c7a Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Tue, 15 Nov 2022 21:37:16 -0600 Subject: Fix shr carry bug --- rtl/core/shifter.sv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rtl/core') diff --git a/rtl/core/shifter.sv b/rtl/core/shifter.sv index 2b5739d..96b8866 100644 --- a/rtl/core/shifter.sv +++ b/rtl/core/shifter.sv @@ -35,7 +35,7 @@ module core_shifter if(ctrl.ror) {c, q} = {c_ror, q_ror}; else if(ctrl.shr) - {c, q} = {c_shr, q_shr[W - 1] | (ctrl.put_carry & c_in), q_shr[W - 2:0]}; + {c, q} = {c_shr, q_shr[W - 1] | (ctrl.put_carry && c_in && shift != 0), q_shr[W - 2:0]}; else {c, q} = {c_shl, q_shl}; -- cgit v1.2.3