Skip to content

Commit

Permalink
[sysinfo] remove reservation set grnaularity
Browse files Browse the repository at this point in the history
  • Loading branch information
stnolting committed Jul 3, 2024
1 parent 333542b commit f820d58
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/datasheet/soc_sysinfo.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Bit fields in this register are set to all-zero if the according cache is not im
| `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_RVSG` | _log2_(reservation set size granularity in bytes), via top's `AMO_RVS_GRANULARITY` generic
| `3` | - | _reserved_, read as zero
|=======================


Expand Down
3 changes: 1 addition & 2 deletions rtl/core/neorv32_sysinfo.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ entity neorv32_sysinfo is
MEM_INT_IMEM_SIZE : natural; -- size of processor-internal instruction memory in bytes
MEM_INT_DMEM_EN : boolean; -- implement processor-internal data memory
MEM_INT_DMEM_SIZE : natural; -- size of processor-internal data memory in bytes
AMO_RVS_GRANULARITY : natural; -- size in bytes, has to be a power of 2, min 4
ICACHE_EN : boolean; -- implement instruction cache
ICACHE_NUM_BLOCKS : natural; -- i-cache: number of blocks (min 2), has to be a power of 2
ICACHE_BLOCK_SIZE : natural; -- i-cache: block size in bytes (min 4), has to be a power of 2
Expand Down Expand Up @@ -90,7 +89,7 @@ begin
sysinfo(1)(7 downto 0) <= std_ulogic_vector(to_unsigned(index_size_f(MEM_INT_IMEM_SIZE), 8)); -- log2(IMEM size)
sysinfo(1)(15 downto 8) <= std_ulogic_vector(to_unsigned(index_size_f(MEM_INT_DMEM_SIZE), 8)); -- log2(DMEM size)
sysinfo(1)(23 downto 16) <= (others => '0'); -- reserved
sysinfo(1)(31 downto 24) <= std_ulogic_vector(to_unsigned(index_size_f(AMO_RVS_GRANULARITY), 8)); -- log2(reservation set granularity)
sysinfo(1)(31 downto 24) <= (others => '0'); -- reserved

-- SYSINFO(2): SoC Configuration --
sysinfo(2)(0) <= '1' when INT_BOOTLOADER_EN else '0'; -- processor-internal bootloader implemented?
Expand Down
6 changes: 2 additions & 4 deletions sw/lib/include/neorv32_sysinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ typedef volatile struct __attribute__((packed,aligned(4))) {

/** NEORV32_SYSINFO->MEM (r/-): Memory configuration (sizes) */
enum NEORV32_SYSINFO_MEM_enum {
SYSINFO_MEM_IMEM = 0, /**< SYSINFO_MEM byte 0 (r/-): log2(internal IMEM size in bytes) (via MEM_INT_IMEM_SIZE generic) */
SYSINFO_MEM_DMEM = 1, /**< SYSINFO_MEM byte 1 (r/-): log2(internal DMEM size in bytes) (via MEM_INT_DMEM_SIZE generic) */

SYSINFO_MEM_RVSG = 3 /**< SYSINFO_MEM byte 3 (r/-): log2(reservation set granularity in bytes) (via AMO_RVS_GRANULARITY generic) */
SYSINFO_MEM_IMEM = 0, /**< SYSINFO_MEM byte 0 (r/-): log2(internal IMEM size in bytes) (via MEM_INT_IMEM_SIZE generic) */
SYSINFO_MEM_DMEM = 1 /**< SYSINFO_MEM byte 1 (r/-): log2(internal DMEM size in bytes) (via MEM_INT_DMEM_SIZE generic) */
};

/** NEORV32_SYSINFO->SOC (r/-): Implemented processor devices/features */
Expand Down
9 changes: 0 additions & 9 deletions sw/lib/source/neorv32_rte.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,15 +590,6 @@ void neorv32_rte_print_hw_config(void) {
neorv32_uart0_printf("none\n");
}

// reservation set granularity
neorv32_uart0_printf("Reservation set: ");
if (neorv32_cpu_csr_read(CSR_MISA) & (1 << 0)) {
neorv32_uart0_printf("%u bytes granularity\n", (uint32_t)(1 << NEORV32_SYSINFO->MEM[SYSINFO_MEM_RVSG]) & 0xFFFFFFFCUL);
}
else {
neorv32_uart0_printf("none\n");
}

// external bus interface
neorv32_uart0_printf("Ext. bus interface: ");
tmp = NEORV32_SYSINFO->SOC;
Expand Down
2 changes: 1 addition & 1 deletion sw/svd/neorv32.svd
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@
<field><name>SYSINFO_MEM_0</name><bitRange>[7:0]</bitRange><description>log2(IMEM size in bytes)</description></field>
<field><name>SYSINFO_MEM_1</name><bitRange>[15:8]</bitRange><description>log2(DMEM size in bytes)</description></field>
<field><name>SYSINFO_MEM_2</name><bitRange>[23:16]</bitRange><description>yet unused</description></field>
<field><name>SYSINFO_MEM_3</name><bitRange>[31:24]</bitRange><description>log2(reservation set granularity in bytes)</description></field>
<field><name>SYSINFO_MEM_3</name><bitRange>[31:24]</bitRange><description>yet unused</description></field>
</fields>
</register>
<register>
Expand Down

0 comments on commit f820d58

Please sign in to comment.