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 Jan 10, 2024
1 parent 9e902fc commit af41bde
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 @@ -356,6 +356,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 @@ -356,6 +356,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 @@ -50,6 +51,12 @@ SECTIONS
__wide_spm_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 @@ -261,10 +261,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 af41bde

Please sign in to comment.