|
<< Click to Display Table of Contents >> Navigation: ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 18 – Fault Dispatcher & Precise Exceptions > 18.3 ExceptionFactory |
ExceptionFactory_inl (exceptionLib/ExceptionFactory_inl.h, ~150 lines) provides typed construction helpers that create correctly-populated PendingEvent instances for every exception category. Each factory method accepts the detection-time parameters (cpuId, faultVA, faultPC, flags) and returns a fully classified PendingEvent with the correct PendingEventKind, ExceptionClass_EV6, EventPriority, and specialized fields pre-filled.
The factory methods eliminate manual PendingEvent construction at detection points, ensuring classification consistency. The complete set:
Factory Method |
ExceptionClass |
|---|---|
makeITBMissEvent(cpuId, faultVA) |
ItbMiss |
makeITBAccessViolationEvent(cpuId, faultVA) |
ItbAcv |
makeDTBMissSingleEvent(cpuId, faultVA, isWrite) |
Dtb_miss_single |
makeDTBMissDouble3Event(cpuId, faultVA, isWrite) |
DStream (3-level) |
makeDTBMissDouble4Event(cpuId, faultVA, isWrite) |
Dtb_miss_double_4 |
makeDTBAccessViolationEvent(cpuId, faultVA, isWrite) |
DtbAcv |
makeDTBFaultEvent(cpuId, faultVA, isWrite, faultType) |
Dfault (FOE/FOR/FOW) |
makeUnalignedEvent(cpuId, faultVA, isWrite) |
Unalign |
makeIllegalOpcodeEvent(cpuId, faultPC, instruction) |
OpcDec |
makeFENEvent(cpuId, faultPC) |
Fen |
makeArithmeticEvent(cpuId, faultPC, excSumBits) |
Arithmetic |
makeMTFPCREvent(cpuId, faultPC) |
MT_FPCR |
makeCallPalEvent(cpuId, faultPC, palFunction) |
CallPal |
makeBreakpointEvent(cpuId, faultPC) |
BreakPoint |
makeSoftwareTrapEvent(cpuId, faultPC, trapCode) |
SoftwareTrap |
makeInterruptEvent(cpuId, hwVector, hwIPL) |
Interrupt |
makeMachineCheckEvent(cpuId, reason, errorAddr) |
MachineCheck |
Detection code (MBox, EBox, FBox, pipeline control) calls the appropriate factory method and passes the result to FaultDispatcher::setPendingEvent(). The factory is the single source of truth for event construction — no detection point constructs a raw PendingEvent manually.
See Also: exceptionLib/ExceptionFactory_inl.h (~150 lines) – Factory methods; 7.4 Exception Detection Points.