|
<< Click to Display Table of Contents >> Navigation: ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 15 – Memory System Implementation Details > 15.11 Memory Fault Handling |
Memory faults may occur during address translation (TLB miss), access permission checks (KRE/KWE/ERE/EWE/SRE/SWE/URE/UWE), alignment checks, MMIO routing (unmapped PA), or bus errors. The MEM_STATUS enumeration in memory_core.h defines all possible return codes: Ok, OutOfRange, Misaligned, TlbMiss, AccessViolation, BusError, Un_Aligned, Time_Out, WriteProtected, TranslationFault, NotInitialized, TargetMisDirect, and IllegalInstruction.
Faults are raised during the EX stage and prevent memory effects from committing. The pipeline flushes younger instructions, and LL/SC reservations are cleared on fault delivery. The PermissionDetail enumeration provides fine-grained fault classification for read, write, and execute permission failures at each privilege level (Kernel/Executive/Supervisor/User), plus Fault-On-Write, Fault-On-Read, and Fault-On-Execute for demand-paging support.
Invariant: Faults prevent partial effects. No memory operation may partially commit.
See Also: memoryLib/memory_core.h – MEM_STATUS, PermissionDetail, MemoryAccessType enumerations; Chapter 18 – Fault Dispatcher & Precise Exceptions (FaultDispatcher).