Skip to content

Bugfix: make AXI4Shared preserve ARSIZE/AWSIZE - #481

Merged
Dolu1990 merged 1 commit into
SpinalHDL:masterfrom
juanschroeder:cvwsoc
Aug 31, 2026
Merged

Dolu1990 merged 1 commit into
SpinalHDL:masterfrom
juanschroeder:cvwsoc

Conversation

@juanschroeder

Copy link
Copy Markdown
Contributor

The error showed up in a setup with 64-bit bus (D extension)

DataCache.scala includes handling for both cached and uncached access. Currently, in toAxi4Shared() the size is hardwired to:

axi.sharedCmd.size := log2Up(p.memDataBytes)

That makes all uncached/MMIO accesses with AxSIZE=3 (64 bits) in a 64-bit bus, which is problematic for peripherals that don't support 64-bit accesses.

The change preserves MMIO/uncached access size:

Byte access       -> AXI SIZE=0
Half word access  -> AXI SIZE=1
Word access       -> AXI SIZE=2
FLD/FSD (float)   -> AXI SIZE=3

While for cached memory/cache refills it keeps using full bus width. E.g.
AxSIZE=3 for 64-bit bus

The error showed up in a setup with 64-bit bus and D extension.

DataCache.scala includes handling for both cached and uncached access.
Currently, in toAxi4Shared() the size is hardwired to:

    axi.sharedCmd.size := log2Up(p.memDataBytes)

That makes all uncached/MMIO accesses with AxSIZE=3 (64 bits) in a
64-bit bus, which is problematic for peripherals that don't support
64-bit accesses.

The change preserves MMIO/uncached access size:

    Byte access       -> AXI SIZE=0
    Half word access  -> AXI SIZE=1
    Word access       -> AXI SIZE=2
    FLD/FSD (float)   -> AXI SIZE=3

While for cached memory/cache refills it keeps using full bus width.
E.g.
    AxSIZE=3 for 64-bit bus

Signed-off-by: Juan Schroeder <jcschroeder@gmail.com>
@Dolu1990
Dolu1990 merged commit c4b2a55 into SpinalHDL:master Aug 31, 2026
@Dolu1990

Copy link
Copy Markdown
Member

Thanks ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants