Skip to content

Commit

Permalink
treewide: Alias narrow SPM address space to uncached region
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Sep 25, 2023
1 parent 93f6a1b commit c028f9f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions target/sim/cfg/full.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@
spm_narrow: {
address: 1879048192, // 0x7000_0000
length: 524288, // 512 kiB 0x8_0000
# An uncached alias address space of the same length
uncached_alias: 1879572480, // 0x7008_0000
},
spm_wide: {
address: 1895825408, // 0x7100_0000
Expand Down
2 changes: 2 additions & 0 deletions target/sim/cfg/single-cluster.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@
spm_narrow: {
address: 1879048192, // 0x7000_0000
length: 524288, // 512 kiB 0x8_0000
# An uncached alias address space of the same length
uncached_alias: 1879572480, // 0x7008_0000
},
spm_wide: {
address: 1895825408, // 0x7100_0000
Expand Down
3 changes: 2 additions & 1 deletion target/sim/sw/host/runtime/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ volatile uint64_t* const clint_mtimecmp0_ptr =
// Globals
//===============================================================

volatile comm_buffer_t comm_buffer __attribute__((aligned(8)));
comm_buffer_t comm_buffer __attribute__((aligned(8)))
__attribute__((section(".nc_spm")));

//===============================================================
// Initialization
Expand Down
7 changes: 7 additions & 0 deletions target/sim/sw/host/runtime/host.ld
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ENTRY(_start)
MEMORY
{
DRAM (rwxa) : ORIGIN = 0x80000000, LENGTH = 0x80000000
NC_SPM (rwxa) : ORIGIN = 0x70080000, LENGTH = 0x80000
}

SECTIONS
Expand Down Expand Up @@ -41,6 +42,12 @@ SECTIONS
__bss_end = . ;
} > DRAM

.nc_spm :
{
*(.nc_spm)
. = ALIGN(8);
} > NC_SPM

__end = .;

.devicebin : { *(.devicebin) } > DRAM
Expand Down
6 changes: 5 additions & 1 deletion util/occamygen/occamygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,14 @@ def main():
occamy.cfg["pcie"]["address_mm"]).attach_to(am_soc_narrow_xbar)

# Connect narrow SPM to Narrow AXI
bases = []
bases.append(occamy.cfg["spm_narrow"]["address"])
if "uncached_alias" in occamy.cfg["spm_narrow"]:
bases.append(occamy.cfg["spm_narrow"]["uncached_alias"])
am_spm_narrow = am.new_leaf(
"spm_narrow",
occamy.cfg["spm_narrow"]["length"],
occamy.cfg["spm_narrow"]["address"]).attach_to(am_soc_narrow_xbar)
*bases).attach_to(am_soc_narrow_xbar)

# Connect wide SPM to Wide AXI
am_spm_wide = am.new_leaf(
Expand Down

0 comments on commit c028f9f

Please sign in to comment.