Skip to content

Commit 5088100

Browse files
committed
🐛 [rtl] fix CLZ and CTZ instructions
bug introduced in #1395 (v1.12.2.9)
1 parent 983c33f commit 5088100

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rtl/core/neorv32_cpu_cp_bitmanip.vhd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ architecture neorv32_cpu_cp_bitmanip_rtl of neorv32_cpu_cp_bitmanip is
5959
if (input(i) = '0') then
6060
cnt_v := cnt_v + 1;
6161
else
62-
return cnt_v;
62+
exit;
6363
end if;
6464
end loop;
65-
return 0;
65+
return cnt_v;
6666
end function leading_zeros_f;
6767

6868
-- population count (number of set bits) --

rtl/core/neorv32_package.vhd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package neorv32_package is
2020

2121
-- Architecture Constants -----------------------------------------------------------------
2222
-- -------------------------------------------------------------------------------------------
23-
constant hw_version_c : std_ulogic_vector(31 downto 0) := x"01120301"; -- hardware version
23+
constant hw_version_c : std_ulogic_vector(31 downto 0) := x"01120302"; -- hardware version
2424
constant archid_c : natural := 19; -- official RISC-V architecture ID
2525
constant XLEN : natural := 32; -- native data path width
2626
constant int_bus_tmo_c : natural := 16; -- internal bus timeout window; has to be a power of two

0 commit comments

Comments
 (0)