Skip to content

Commit 8b83c07

Browse files
authored
🐛 [rtl] fix CLZ and CTZ instructions (#1397)
2 parents 983c33f + 4dda7e1 commit 8b83c07

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ mimpid = 0x01040312 -> Version 01.04.03.12 -> v1.4.3.12
2929

3030
| Date | Version | Comment | Ticket |
3131
|:----:|:-------:|:--------|:------:|
32-
| 05.10.2025 | 1.12.3.1 | rework debug module | [#1396](https://github.com/stnolting/neorv32/pull/1396) |
32+
| 06.10.2025 | 1.12.3.2 | :bug: fix `clz` and `ctz` instructions; bug introduced in #1395 (v1.12.2.9) | [#1397](https://github.com/stnolting/neorv32/pull/1397) |
33+
| 05.10.2025 | 1.12.3.1 | rework debug module (DM) - slightly faster response, less hardware utilization, cleaner code | [#1396](https://github.com/stnolting/neorv32/pull/1396) |
3334
| 05.10.2025 | [**1.12.3**](https://github.com/stnolting/neorv32/releases/tag/v1.12.3) | :rocket: **New release** | |
3435
| 04.10.2025 | 1.12.2.9 | minor rtl edits and cleanups | [#1395](https://github.com/stnolting/neorv32/pull/1395) |
3536
| 04.10.2025 | 1.12.2.8 | :bug: fix broken DTM bypass register; further DTM logic optimization | [#1393](https://github.com/stnolting/neorv32/pull/1393) |
@@ -560,4 +561,4 @@ mimpid = 0x01040312 -> Version 01.04.03.12 -> v1.4.3.12
560561
| 29.06.2022 | 1.7.3.2 | :test_tube: add experimental core complex wrapper for integration into the [**LiteX**](https://github.com/enjoy-digital/litex) SoC builder framework | [#353](https://github.com/stnolting/neorv32/pull/353) |
561562
| 28.06.2022 | 1.7.3.1 | :bug: fix bug that caused permanent CPU stall if illegal load/store instruction | [#356](https://github.com/stnolting/neorv32/pull/356) |
562563
| 23.06.2022 | [**1.7.3**](https://github.com/stnolting/neorv32/releases/tag/v1.7.3) | :rocket: **New release** | |
563-
| ... | ... | Changelog trimmed. See [`CHANGELOG.md` in v1.7.3](https://github.com/stnolting/neorv32/blob/v1.7.3/CHANGELOG.md) to see older logs. | ... |
564+
| ... | ... | Changelog trimmed. See [`CHANGELOG.md` in v1.7.3](https://github.com/stnolting/neorv32/blob/v1.7.3/CHANGELOG.md) for older logs. | ... |

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)