diff options
author | Scott Johnson <scott.johnson@arilinc.com> | 2023-03-03 05:22:52 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2023-03-04 17:30:31 -0800 |
commit | 1951f80361e7cb82a8baa975183d036e8a944bd2 (patch) | |
tree | 6f2e6ca06d58f833204989cb01cc8d59c9fffab8 /riscv/mmu.h | |
parent | 360e55535da0d3a0f8123bbe9ca4b2947950e8ea (diff) | |
download | spike-1951f80361e7cb82a8baa975183d036e8a944bd2.zip spike-1951f80361e7cb82a8baa975183d036e8a944bd2.tar.gz spike-1951f80361e7cb82a8baa975183d036e8a944bd2.tar.bz2 |
Don't issue misaligned or non-power-of-2 MMIO accesses
@aswaterman explains:
Rather than requiring each MMIO device to support arbitrary sizes and
alignments, decompose MMIO misaligned loads and stores in such a way
as to guarantee their constituent parts are always aligned.
(Specifically, they now always decompose to a sequence of one-byte
accesses.)
This is not a semantic change for main-memory accesses, but it is a
semantic change for I/O devices. It makes them more realistic, in that
most bus standards don't support non-power-of-2-sized accesses.
Diffstat (limited to 'riscv/mmu.h')
-rw-r--r-- | riscv/mmu.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/riscv/mmu.h b/riscv/mmu.h index 6cf696b..56789e0 100644 --- a/riscv/mmu.h +++ b/riscv/mmu.h @@ -339,6 +339,7 @@ private: bool mmio_fetch(reg_t paddr, size_t len, uint8_t* bytes); bool mmio_load(reg_t paddr, size_t len, uint8_t* bytes); bool mmio_store(reg_t paddr, size_t len, const uint8_t* bytes); + bool mmio(reg_t paddr, size_t len, uint8_t* bytes, access_type type); bool mmio_ok(reg_t paddr, access_type type); void check_triggers(triggers::operation_t operation, reg_t address, std::optional<reg_t> data = std::nullopt); reg_t translate(reg_t addr, reg_t len, access_type type, uint32_t xlate_flags); |