Skip to content

Commit 46ef442

Browse files
authored
[rtl] minor edits and cleanups (#672)
2 parents 18d29f2 + fdb79e5 commit 46ef442

11 files changed

+114
-113
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ mimpid = 0x01040312 -> Version 01.04.03.12 -> v1.4.3.12
3232

3333
| Date (*dd.mm.yyyy*) | Version | Comment |
3434
|:-------------------:|:-------:|:--------|
35+
| 17.08.2023 | 1.8.7.9 | minor rtl edits and cleanups; [#672](https://github.com/stnolting/neorv32/pull/672) |
3536
| 13.08.2023 | 1.8.7.8 | :warning: constrain/optimize `mtval` and `mcounteren` CSRs; [#671](https://github.com/stnolting/neorv32/pull/671) |
3637
| 12.08.2023 | 1.8.7.7 | remove _unratified_ `Zicond` ISA extension; minor rtl code cleanups and optimizations; [#670](https://github.com/stnolting/neorv32/pull/670) |
3738
| 05.08.2023 | 1.8.7.6 | :bug: fix bug: HPM width configurations below 32 bit fail; [#665](https://github.com/stnolting/neorv32/pull/665) |

docs/datasheet/cpu_csr.adoc

+16-16
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ bits can actually be modified.
9999
| Name | Floating-point accrued exceptions
100100
| Address | `0x001`
101101
| Reset value | `0x00000000`
102-
| ISA | `Zicsr` + `Zfinx`
102+
| ISA | `Zicsr` & `Zfinx`
103103
| Description | FPU status flags.
104104
|=======================
105105

@@ -126,7 +126,7 @@ bits can actually be modified.
126126
| Name | Floating-point dynamic rounding mode
127127
| Address | `0x002`
128128
| Reset value | `0x00000000`
129-
| ISA | `Zicsr` + `Zfinx`
129+
| ISA | `Zicsr` & `Zfinx`
130130
| Description | The `frm` CSR is used to configure the rounding mode of the FPU.
131131
|=======================
132132

@@ -150,7 +150,7 @@ bits can actually be modified.
150150
| Name | Floating-point control and status register
151151
| Address | `0x003`
152152
| Reset value | `0x00000000`
153-
| ISA | `Zicsr` + `Zfinx`
153+
| ISA | `Zicsr` & `Zfinx`
154154
| Description | The `fcsr` provides combined access to the <<_fflags>> and <<_frm>> flags.
155155
|=======================
156156

@@ -179,7 +179,7 @@ bits can actually be modified.
179179
| Name | Machine environment configuration register
180180
| Address | `0x30a`
181181
| Reset value | `0x00000000`
182-
| ISA | `Zicsr` + `U`
182+
| ISA | `Zicsr` & `U`
183183
| Description | The features of this CSR are not implemented yet. The register is read-only and always returns zero.
184184
|=======================
185185

@@ -194,7 +194,7 @@ bits can actually be modified.
194194
| Name | Machine environment configuration register - high word
195195
| Address | `0x31a`
196196
| Reset value | `0x00000000`
197-
| ISA | `Zicsr` + `U`
197+
| ISA | `Zicsr` & `U`
198198
| Description | The features of this CSR are not implemented yet. The register is read-only and always returns zero.
199199
|=======================
200200

@@ -336,7 +336,7 @@ interrupt is triggered or an exception is raised.
336336
| Name | Machine counter enable
337337
| Address | `0x306`
338338
| Reset value | `0x00000000`
339-
| ISA | `Zicsr` + `U`
339+
| ISA | `Zicsr` & `U`
340340
| Description | The `mcounteren` CSR is used to constrain user-mode access to the CPU's counter CSRs.
341341
This CSR is also available if U mode is disabled, but the register is hardwired to all-zero in this case.
342342
|=======================
@@ -519,7 +519,7 @@ See section <<_pmp_isa_extension>> for more information.
519519
| Name | PMP region configuration registers
520520
| Address | `0x3a0` (`pmpcfg0`) ... `0x3a3` (`pmpcfg3`)
521521
| Reset value | `0x00000000`
522-
| ISA | `Zicsr` + `PMP`
522+
| ISA | `Zicsr` & `PMP`
523523
| Description | Configuration of physical memory protection regions. Each region provides an individual 8-bit array in these CSRs.
524524
|=======================
525525

@@ -549,7 +549,7 @@ The `pmpaddr*` CSRs are used to configure the region's address boundaries.
549549
| Name | Physical memory protection address registers
550550
| Address | `0x3b0` (`pmpaddr0`) ... `0x3bf` (`pmpaddr15`)
551551
| Reset value | `0x00000000`
552-
| ISA | `Zicsr` + `PMP`
552+
| ISA | `Zicsr` & `PMP`
553553
| Description | Region address configuration. The two MSBs of each CSR are hardwired to zero (= bits 33:32 of the physical address).
554554
|=======================
555555

@@ -586,7 +586,7 @@ if this instruction is actually going to retire or if it causes an exception.
586586
| Address | `0xc00` (`cycle`)
587587
| | `0xc80` (`cycleh`)
588588
| Reset value | `0x00000000`
589-
| ISA | `Zicsr` + `Zicntr`
589+
| ISA | `Zicsr` & `Zicntr`
590590
| Description | The `cycle[h]` CSRs are user-mode shadow copies of the according <<_mcycleh>> CSRs. The user-mode
591591
counter are read-only. Any write access will raise an illegal instruction exception.
592592
|=======================
@@ -603,7 +603,7 @@ counter are read-only. Any write access will raise an illegal instruction except
603603
| Address | `0xc02` (`instret`)
604604
| | `0xc82` (`instreth`)
605605
| Reset value | `0x00000000`
606-
| ISA | `Zicsr` + `Zicntr`
606+
| ISA | `Zicsr` & `Zicntr`
607607
| Description | The `instret[h]` CSRs are user-mode shadow copies of the according <<_minstreth>> CSRs. The user-mode
608608
counter are read-only. Any write access will raise an illegal instruction exception.
609609
|=======================
@@ -620,7 +620,7 @@ counter are read-only. Any write access will raise an illegal instruction except
620620
| Address | `0xb00` (`mcycle`)
621621
| | `0xb80` (`mcycleh`)
622622
| Reset value | `0x00000000`
623-
| ISA | `Zicsr` + `Zicntr`
623+
| ISA | `Zicsr` & `Zicntr`
624624
| Description | If not halted via the <<_mcountinhibit>> CSR the `cycle[h]` CSRs will increment with every active CPU clock
625625
cycle (CPU not in sleep mode). These registers are read/write only for machine-mode software.
626626
|=======================
@@ -637,7 +637,7 @@ cycle (CPU not in sleep mode). These registers are read/write only for machine-m
637637
| Address | `0xb02` (`minstret`)
638638
| | `0xb82` (`minstreth`)
639639
| Reset value | `0x00000000`
640-
| ISA | `Zicsr` + `Zicntr`
640+
| ISA | `Zicsr` & `Zicntr`
641641
| Description | If not halted via the <<_mcountinhibit>> CSR the `minstret[h]` CSRs will increment with every retired instruction.
642642
These registers are read/write only for machine-mode software
643643
|=======================
@@ -673,7 +673,7 @@ If `HPM_NUM_CNTS` is less than 64, all remaining MSB-aligned bits are hardwired
673673
| Name | Machine hardware performance monitor event select
674674
| Address | `0x233` (`mhpmevent3`) ... `0x32f` (`mhpmevent15`)
675675
| Reset value | `0x00000000`
676-
| ISA | `Zicsr` + `Zihpm`
676+
| ISA | `Zicsr` & `Zihpm`
677677
| Description | The value in these CSRs define the architectural events that cause an increment of the according `mhpmcounter*[h]` counter(s).
678678
All available events are listed in the table below. If more than one event is selected, the according counter will increment if _any_ of
679679
the enabled events is observed (logical OR). Note that the counter will only increment by 1 step per clock
@@ -715,7 +715,7 @@ cycle even if more than one trigger event is observed.
715715
| Address | `0xb03` (`mhpmcounter3`) ... `0xb0f` (mhpmcounter15)
716716
| | `0xb83` (`mhpmcounter3h`) ... `0xb8f` (`mhpmcounter15h`)
717717
| Reset value | `0x00000000`
718-
| ISA | `Zicsr` + `Zihpm`
718+
| ISA | `Zicsr` & `Zihpm`
719719
| Description | If not halted via the <<_mcountinhibit>> CSR the HPM counter CSR(s) increment whenever a
720720
configured event from the according <<_mhpmevent>> CSR occurs. The counter registers are read/write for machine mode
721721
and are not accessible for lower-privileged software.
@@ -733,7 +733,7 @@ and are not accessible for lower-privileged software.
733733
| Address | `0xc03` (`hpmcounter3`) ... `0xc0f` (hpmcounter15)
734734
| | `0xc83` (`hpmcounter3h`) ... `0xc8f` (`hpmcounter15h`)
735735
| Reset value | `0x00000000`
736-
| ISA | `Zicsr` + `Zihpm`
736+
| ISA | `Zicsr` & `Zihpm`
737737
| Description | The `hpmcounter*[h]` are user-mode shadow copies of the according <<_mhpmcounterh>> CSRs. The user mode
738738
counter CSRs are read-only. Any write access will raise an illegal instruction exception.
739739
|=======================
@@ -872,7 +872,7 @@ outside of machine-mode will raise an illegal instruction exception.
872872
| Name | Machine extended isa and extensions register
873873
| Address | `0xfc0`
874874
| Reset value | `DEFINED`
875-
| ISA | `Zicsr` + `X`
875+
| ISA | `Zicsr` & `X`
876876
| Description | The `mxisa` CSRs is a NEORV32-specific read-only CSR that helps machine-mode software to
877877
discover ISA sub-extensions and CPU configuration options
878878
|=======================

docs/datasheet/software_rte.adoc

+15-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ default handlers can be overridden by the application code to install applicatio
1313
Using the RTE is **optional but highly recommended**. The RTE provides a simple and comfortable way of delegating
1414
traps to application-specific handlers while making sure that all traps (even though they are not explicitly used
1515
by the application) are handled correctly. Performance-optimized applications or embedded operating systems may
16-
not use the RTE at allin order to increase response time.
16+
not use the RTE at all in order to increase response time.
1717

1818

1919
==== RTE Operation
@@ -80,7 +80,20 @@ enum NEORV32_RTE_TRAP_enum {
8080
RTE_TRAP_MEI = 12, /**< Machine external interrupt */
8181
RTE_TRAP_FIRQ_0 = 13, /**< Fast interrupt channel 0 */
8282
RTE_TRAP_FIRQ_1 = 14, /**< Fast interrupt channel 1 */
83-
...
83+
RTE_TRAP_FIRQ_2 = 15, /**< Fast interrupt channel 2 */
84+
RTE_TRAP_FIRQ_3 = 16, /**< Fast interrupt channel 3 */
85+
RTE_TRAP_FIRQ_4 = 17, /**< Fast interrupt channel 4 */
86+
RTE_TRAP_FIRQ_5 = 18, /**< Fast interrupt channel 5 */
87+
RTE_TRAP_FIRQ_6 = 19, /**< Fast interrupt channel 6 */
88+
RTE_TRAP_FIRQ_7 = 20, /**< Fast interrupt channel 7 */
89+
RTE_TRAP_FIRQ_8 = 21, /**< Fast interrupt channel 8 */
90+
RTE_TRAP_FIRQ_9 = 22, /**< Fast interrupt channel 9 */
91+
RTE_TRAP_FIRQ_10 = 23, /**< Fast interrupt channel 10 */
92+
RTE_TRAP_FIRQ_11 = 24, /**< Fast interrupt channel 11 */
93+
RTE_TRAP_FIRQ_12 = 25, /**< Fast interrupt channel 12 */
94+
RTE_TRAP_FIRQ_13 = 26, /**< Fast interrupt channel 13 */
95+
RTE_TRAP_FIRQ_14 = 27, /**< Fast interrupt channel 14 */
96+
RTE_TRAP_FIRQ_15 = 28 /**< Fast interrupt channel 15 */
8497
----
8598

8699
The second argument `*handler` is the actual function that implements the user-defined trap handler.

rtl/core/neorv32_cpu.vhd

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ entity neorv32_cpu is
6262
CPU_EXTENSION_RISCV_Zxcfu : boolean; -- implement custom (instr.) functions unit?
6363
CPU_EXTENSION_RISCV_Sdext : boolean; -- implement external debug mode extension?
6464
CPU_EXTENSION_RISCV_Sdtrig : boolean; -- implement trigger module extension?
65-
-- Extension Options --
65+
-- Tuning Options --
6666
FAST_MUL_EN : boolean; -- use DSPs for M extension's multiplier
6767
FAST_SHIFT_EN : boolean; -- use barrel shifter for shift operations
6868
-- Physical Memory Protection (PMP) --
@@ -323,7 +323,7 @@ begin
323323
CPU_EXTENSION_RISCV_Zmmul => CPU_EXTENSION_RISCV_Zmmul, -- implement multiply-only M sub-extension?
324324
CPU_EXTENSION_RISCV_Zfinx => CPU_EXTENSION_RISCV_Zfinx, -- implement 32-bit floating-point extension (using INT reg!)
325325
CPU_EXTENSION_RISCV_Zxcfu => CPU_EXTENSION_RISCV_Zxcfu, -- implement custom (instr.) functions unit?
326-
-- Extension Options --
326+
-- Tuning Options --
327327
FAST_MUL_EN => FAST_MUL_EN, -- use DSPs for M extension's multiplier
328328
FAST_SHIFT_EN => FAST_SHIFT_EN -- use barrel shifter for shift operations
329329
)

rtl/core/neorv32_cpu_alu.vhd

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ entity neorv32_cpu_alu is
4949
CPU_EXTENSION_RISCV_Zmmul : boolean; -- implement multiply-only M sub-extension?
5050
CPU_EXTENSION_RISCV_Zfinx : boolean; -- implement 32-bit floating-point extension (using INT reg!)
5151
CPU_EXTENSION_RISCV_Zxcfu : boolean; -- implement custom (instr.) functions unit?
52-
-- Extension Options --
52+
-- Tuning Options --
5353
FAST_MUL_EN : boolean; -- use DSPs for M extension's multiplier
5454
FAST_SHIFT_EN : boolean -- use barrel shifter for shift operations
5555
);

0 commit comments

Comments
 (0)