> scenarios to help me understand? 123.jpg
>
I would say, trying to run any code from MMIO areas is not a good idea,
in any case.
In my CPU core (not natively RISC-V, but can run RV64G as a sub-mode),
code execution from MMIO areas is not allowed, at all, and in effect,
RAM vs MMIO have different ways of accessing and using the bus (in RAM
areas, it fetches and writes back cache lines, in MMIO, every access
effectively takes a round-trip around the bus; and the devices on the
MMIO part of the bus don't support cache-line access).
This is partly because every access to an MMIO device may potentially
reflect or modify the internal working state of the device being
accessed, performed at the moment it is being accessed.
But, generally when an instruction fetch is performed, the cache might
operate in terms of cache lines, and then extract the instruction(s) it
needs from them.
So, for example, if one is running code at 0x011088Ex, the CPU might
also fetch memory from 0x011088Fx or maybe even 0x0110890x (or, if one
is near a page boundary, it might cross into the next page, etc...).
Mostly depending on the size of the cache line.
Access to normal data areas of RAM is typically similar, with the cache
lines hanging around in the L1 caches or similar until they need to be
evicted back out to the L2 cache, or to external RAM (and the large flat
address space where any piece of memory can be accessed at any moment,
or where memory written is one thread is seemingly immediately visible
in other threads, etc, is, to some extent, an illusion).
For actual hardware interfaces (and MMIO in general), this illusion is
not good enough, so it needs to pays some extra penalties to do it for real.
Well, except for some things like graphics framebuffers where one can
get along OK with potential inconsistencies (if a block of pixels on
screen isn't updated at exactly the right time, no one will likely
notice or care).
> --
> You received this message because you are subscribed to the Google
> Groups "RISC-V ISA Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
isa-dev+u...@groups.riscv.org
> <mailto:
isa-dev+u...@groups.riscv.org>.
> To view this discussion on the web visit
>
https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/260f7612-5cdb-4a21-b3ca-939b08902846n%40groups.riscv.org <
https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/260f7612-5cdb-4a21-b3ca-939b08902846n%40groups.riscv.org?utm_medium=email&utm_source=footer>.