Line 44... |
Line 44... |
Bus access fault exceptions are also raised if a physical memory protection (PMP) rule is violated. In this case
|
Bus access fault exceptions are also raised if a physical memory protection (PMP) rule is violated. In this case
|
the _BUSKEEPER_ERR_FLAG_ bit remains zero (since the error signal is not triggered by the BUSKEEPER but by
|
the _BUSKEEPER_ERR_FLAG_ bit remains zero (since the error signal is not triggered by the BUSKEEPER but by
|
the CPU's PMP logic).
|
the CPU's PMP logic).
|
|
|
|
|
**NULL Address Check**
|
|
|
|
The bus keeper can ensure that no accesses are permitted to NULL addresses (`addr = 0x00000000`). These kind of
|
|
access often occur when using uninitialized pointers. If the _BUSKEEPER_NULL_CHECK_EN_ bit is set, any access to
|
|
address zero (instruction fetch, load data, store data) will raise an according bus exception. This flag
|
|
automatically clears on a hardware reset.
|
|
|
|
If a NULL address access has been detected the _BUSKEEPER_ERR_FLAG_ flag is set and the _BUSKEEPER_ERR_TYPE_
|
|
flag is cleared indicating a "Device Error".
|
|
|
|
[NOTE]
|
|
Address 0 is normally used by the IMEM and contains boot code instructions that are executed _once_ right after
|
|
hardware reset. Hence, activating the bus keeper's NULL check in application code will not corrupt code execution
|
|
at all.
|
|
|
|
|
|
.BUSKEEPER register map (`struct NEORV32_BUSKEEPER`)
|
.BUSKEEPER register map (`struct NEORV32_BUSKEEPER`)
|
[cols="<2,<2,<4,^1,<4"]
|
[cols="<2,<2,<4,^1,<4"]
|
[options="header",grid="all"]
|
[options="header",grid="all"]
|
|=======================
|
|=======================
|
| Address | Name [C] | Bit(s), Name [C] | R/W | Function
|
| Address | Name [C] | Bit(s), Name [C] | R/W | Function
|
.3+<| `0xffffff7C` .3+<| `NEORV32_BUSKEEPER.CTRL` <|`0` _BUSKEEPER_ERR_TYPE_ ^| r/- | Bus error type, valid if _BUSKEEPER_ERR_FLAG_
|
.2+<| `0xffffff7C` .2+<| `NEORV32_BUSKEEPER.CTRL` <|`0` _BUSKEEPER_ERR_TYPE_ ^| r/- <| Bus error type, valid if _BUSKEEPER_ERR_FLAG_
|
<|`16` _BUSKEEPER_NULL_CHECK_EN_ ^| r/w <| Enable NULL address check when set
|
<|`31` _BUSKEEPER_ERR_FLAG_ ^| r/c <| Sticky error flag, clears after read or write access
|
<|`31` _BUSKEEPER_ERR_FLAG_ ^| r/- <| Sticky error flag, clears after read or write access
|
|
|=======================
|
|=======================
|