<<<
:sectnums:
==== System Configuration Information Memory (SYSINFO)

[cols="<3,<3,<4"]
[frame="topbot",grid="none"]
|=======================
| Hardware source files:  | neorv32_sysinfo.vhd |
| Software driver files:  | neorv32_sysinfo.h |
| Top entity ports:       | none |
| Configuration generics: | * | most of the top's configuration generics
| CPU interrupts:         | none |
| Access restrictions:  2+| privileged access only, non-32-bit write accesses are ignored
|=======================


**Overview**

The SYSINFO module allows the application software to determine the setting of most of the <<_processor_top_entity_generics>>
that are related to CPU and processor/SoC configuration. This device is always implemented - regardless of the actual hardware
configuration since the NEORV32 software framework requires information from this device for correct operation.
However, advanced users that do not want to use the default NEORV32 software framework can choose to disable the
entire SYSINFO module. This might also be suitable for setups that use the processor just as wrapper for a CPU-only
configuration.

.Disabling the SYSINFO Module
[WARNING]
Setting the `IO_DISABLE_SYSINFO` top entity generic to `true` will remove the SYSINFO module from the design.
This option is suitable for advanced uses that wish to use a CPU-only setup that still contains the bus infrastructure.
As a result, large parts of the NEORV32 software framework no longer work (e.g. most IO drivers, the RTE and the bootloader).
**Hence, this option is not recommended.**


**Register Map**

All registers of this module are read-only except for the `CLK` register. Upon reset, the `CLK` registers is initialized
from the `CLOCK_FREQUENCY` top entity generic. Application software can override this default value in order, for example,
to take into account a dynamic frequency scaling of the processor.

.SYSINFO register map (`struct NEORV32_SYSINFO`)
[cols="<2,<1,^1,<7"]
[options="header",grid="all"]
|=======================
| Address | Name [C] | R/W | Description
| `0xfffffe00` | `CLK`    | r/w | clock frequency in Hz (initialized from top's `CLOCK_FREQUENCY` generic)
| `0xfffffe04` | `MEM[4]` | r/- | internal memory configuration (see <<_sysinfo_memory_configuration>>)
| `0xfffffe08` | `SOC`    | r/- | specific SoC configuration (see <<_sysinfo_soc_configuration>>)
| `0xfffffe0c` | `CACHE`  | r/- | cache configuration information (see <<_sysinfo_cache_configuration>>)
|=======================


===== SYSINFO - Memory Configuration

[NOTE]
Bit fields in this register are set to all-zero if the according memory system is not implemented.

.SYSINFO `MEM` Bytes
[cols="^1,<2,<7"]
[options="header",grid="all"]
|=======================
| Byte | Name [C] | Description
| `0`  | `SYSINFO_MEM_IMEM` | _log2_(internal IMEM size in bytes), via top's `MEM_INT_IMEM_SIZE` generic
| `1`  | `SYSINFO_MEM_DMEM` | _log2_(internal DMEM size in bytes), via top's `MEM_INT_DMEM_SIZE` generic
| `2`  | -                  | _reserved_, read as zero
| `3`  | `SYSINFO_MEM_BOOT` | boot mode configuration, via top's `BOOT_MODE_SELECT` generic (see <<_boot_configuration>>))
|=======================


===== SYSINFO - SoC Configuration

.SYSINFO `SOC` Bits
[cols="^2,<6,<10"]
[options="header",grid="all"]
|=======================
| Bit | Name [C] | Description
| `0`     | `SYSINFO_SOC_BOOTLOADER`   | set if processor-internal bootloader is implemented (via top's `BOOT_MODE_SELECT` generic; see <<_boot_configuration>>)
| `1`     | `SYSINFO_SOC_XBUS`         | set if external Wishbone bus interface is implemented (via top's `XBUS_EN` generic)
| `2`     | `SYSINFO_SOC_MEM_INT_IMEM` | set if processor-internal DMEM is implemented (via top's `MEM_INT_IMEM_EN` generic)
| `3`     | `SYSINFO_SOC_MEM_INT_DMEM` | set if processor-internal IMEM is implemented (via top's `MEM_INT_DMEM_EN` generic)
| `4`     | `SYSINFO_SOC_OCD`          | set if on-chip debugger is implemented (via top's `OCD_EN` generic)
| `5`     | `SYSINFO_SOC_ICACHE`       | set if processor-internal instruction cache is implemented (via top's `ICACHE_EN` generic)
| `6`     | `SYSINFO_SOC_DCACHE`       | set if processor-internal data cache is implemented (via top's `DCACHE_EN` generic)
| `7`     | `SYSINFO_SOC_CLOCK_GATING` | set if CPU clock gating is implemented (via top's `CLOCK_GATING_EN` generic)
| `8`     | `SYSINFO_SOC_XBUS_CACHE`   | set if external bus interface cache is implemented (via top's `XBUS_CACHE_EN` generic)
| `9`     | `SYSINFO_SOC_XIP`          | set if XIP module is implemented (via top's `XIP_EN` generic)
| `10`    | `SYSINFO_SOC_XIP_CACHE`    | set if XIP cache is implemented (via top's `XIP_CACHE_EN` generic)
| `11`    | `SYSINFO_SOC_OCD_AUTH`     | set if on-chip debugger authentication is implemented (via top's `OCD_AUTHENTICATION` generic)
| `12`    | `SYSINFO_SOC_IMEM_ROM`     | set if processor-internal IMEM is implemented as pre-initialized ROM (via top's `BOOT_MODE_SELECT` generic; see <<_boot_configuration>>)
| `13`    | -                          | _reserved_, read as zero
| `14`    | `SYSINFO_SOC_IO_DMA`       | set if direct memory access controller is implemented (via top's `IO_DMA_EN` generic)
| `15`    | `SYSINFO_SOC_IO_GPIO`      | set if GPIO is implemented (via top's `IO_GPIO_EN` generic)
| `16`    | `SYSINFO_SOC_IO_MTIME`     | set if MTIME is implemented (via top's `IO_MTIME_EN` generic)
| `17`    | `SYSINFO_SOC_IO_UART0`     | set if primary UART0 is implemented (via top's `IO_UART0_EN` generic)
| `18`    | `SYSINFO_SOC_IO_SPI`       | set if SPI is implemented (via top's `IO_SPI_EN` generic)
| `19`    | `SYSINFO_SOC_IO_TWI`       | set if TWI is implemented (via top's `IO_TWI_EN` generic)
| `20`    | `SYSINFO_SOC_IO_PWM`       | set if PWM is implemented (via top's `IO_PWM_NUM_CH` generic)
| `21`    | `SYSINFO_SOC_IO_WDT`       | set if WDT is implemented (via top's `IO_WDT_EN` generic)
| `22`    | `SYSINFO_SOC_IO_CFS`       | set if custom functions subsystem is implemented (via top's `IO_CFS_EN` generic)
| `23`    | `SYSINFO_SOC_IO_TRNG`      | set if TRNG is implemented (via top's `IO_TRNG_EN` generic)
| `24`    | `SYSINFO_SOC_IO_SDI`       | set if SDI is implemented (via top's `IO_SDI_EN` generic)
| `25`    | `SYSINFO_SOC_IO_UART1`     | set if secondary UART1 is implemented (via top's `IO_UART1_EN` generic)
| `26`    | `SYSINFO_SOC_IO_NEOLED`    | set if NEOLED is implemented (via top's `IO_NEOLED_EN` generic)
| `27`    | `SYSINFO_SOC_IO_XIRQ`      | set if XIRQ is implemented (via top's `XIRQ_NUM_CH` generic)
| `28`    | `SYSINFO_SOC_IO_GPTMR`     | set if GPTMR is implemented (via top's `IO_GPTMR_EN` generic)
| `29`    | `SYSINFO_SOC_IO_SLINK`     | set if stream link interface is implemented (via top's `IO_SLINK_EN` generic)
| `30`    | `SYSINFO_SOC_IO_ONEWIRE`   | set if ONEWIRE interface is implemented (via top's `IO_ONEWIRE_EN` generic)
| `31`    | `SYSINFO_SOC_IO_CRC`       | set if cyclic redundancy check unit is implemented (via top's `IO_CRC_EN` generic)
|=======================


===== SYSINFO - Cache Configuration

[NOTE]
Bit fields in this register are set to all-zero if the according cache is not implemented.

.SYSINFO `CACHE` Bits
[cols="^1,<10,<10"]
[options="header",grid="all"]
|=======================
| Bit     | Name [C] | Description
| `3:0`   | `SYSINFO_CACHE_INST_BLOCK_SIZE_3 : SYSINFO_CACHE_INST_BLOCK_SIZE_0` | _log2_(i-cache block size in bytes), via top's `ICACHE_BLOCK_SIZE` generic
| `7:4`   | `SYSINFO_CACHE_INST_NUM_BLOCKS_3 : SYSINFO_CACHE_INST_NUM_BLOCKS_0` | _log2_(i-cache number of cache blocks), via top's `ICACHE_NUM_BLOCKS` generic
| `11:8`  | `SYSINFO_CACHE_DATA_BLOCK_SIZE_3 : SYSINFO_CACHE_DATA_BLOCK_SIZE_0` | _log2_(d-cache block size in bytes), via top's `DCACHE_BLOCK_SIZE` generic
| `15:12` | `SYSINFO_CACHE_DATA_NUM_BLOCKS_3 : SYSINFO_CACHE_DATA_NUM_BLOCKS_0` | _log2_(d-cache number of cache blocks), via top's `DCACHE_NUM_BLOCKS` generic
| `19:16` | `SYSINFO_CACHE_XIP_BLOCK_SIZE_3 : SYSINFO_CACHE_XIP_BLOCK_SIZE_0`   | _log2_(xip-cache block size in bytes), via top's `XIP_CACHE_BLOCK_SIZE` generic
| `23:20` | `SYSINFO_CACHE_XIP_NUM_BLOCKS_3 : SYSINFO_CACHE_XIP_NUM_BLOCKS_0`   | _log2_(xip-cache number of cache blocks), via top's `XIP_CACHE_NUM_BLOCKS` generic
| `27:24` | `SYSINFO_CACHE_XBUS_BLOCK_SIZE_3 : SYSINFO_CACHE_XBUS_BLOCK_SIZE_0` | _log2_(xbus-cache block size in bytes), via top's `XBUS_CACHE_BLOCK_SIZE` generic
| `31:28` | `SYSINFO_CACHE_XBUS_NUM_BLOCKS_3 : SYSINFO_CACHE_XBUS_NUM_BLOCKS_0` | _log2_(xbus-cache number of cache blocks), via top's `XBUS_CACHE_NUM_BLOCKS` generic
|=======================
