20.1 PalBox Execution Domain

<< Click to Display Table of Contents >>

Navigation:  ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 20 – Boot Sequence, PAL, and SRM Integration >

20.1 PalBox Execution Domain

20.1.1 Role and Design

 

The PalBox is an EmulatR-specific execution domain that has no direct hardware counterpart on the 21264 die. On real Alpha silicon, PALcode executed as privileged Alpha instructions with access to hardware-internal processor registers through HW_MFPR and HW_MTPR opcodes. In EmulatR, the PalBox encapsulates all PAL mode entry/exit logic, CALL_PAL dispatch, IPR access, shadow register management, and system service routing.

 

Implementation: PalBoxLib/PalBoxBase.h, ~2,122 lines, 175 execute methods. PalBox supports the full Tru64 UNIX PAL call set as defined in the Alpha Architecture Reference Manual.

 


 

20.1.2 Responsibilities

 

CALL_PAL dispatch: executeCALL_PAL() extracts the PAL function code from instruction bits [7:0] and routes to the appropriate PalService handler.

 

PAL mode entry and exit: enterPal(reason, vector, faultPC) sets PAL mode and redirects execution to the exception/interrupt handler. Only HW_REI may exit PAL mode.

 

Privileged register access: HW_MFPR (opcode 0x19) reads IPRs; HW_MTPR (opcode 0x1D) writes IPRs. Both are PAL-mode-only.

 

Hardware load/store: HW_LD (opcode 0x1B) and HW_ST (opcode 0x1F) provide PAL-mode physical memory access bypassing normal VA→PA translation.

 

Exception vectoring: Computes PAL entry vectors from PAL_BASE + offset for exception and interrupt delivery.

 

Shadow register management: Activates and deactivates the PAL shadow register bank during PAL mode transitions.

 

Low-level OS services: Implements privileged PAL calls including HALT, RESTART, DRAINA, SWPCTX (context switch), DI/EI (disable/enable interrupts), IMB (instruction memory barrier), CHMK/CHMS/CHME/CHMU (change mode), CALLSYS, BPT, BUGCHK, GENTRAP, and the interlocked queue operations (INSQHIL, INSQTIL, REMQHIL, REMQTIL, etc.).

 

BoxResult mapping: applyBoxResult() unpacks BoxResult flags (flush, enter PAL mode, fault info) into PipelineSlot fields for pipeline consumption.

 

See Also: PalBoxLib/PalBoxBase.h (~2,122 lines, 175 execute methods); 14.6 PalBox – Privileged Architecture Library Execution Box.