3.10 PipelineSlot Contract

<< Click to Display Table of Contents >>

Navigation:  ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 3 - Pipeline Architecture >

3.10 PipelineSlot Contract

Each pipeline stage holds a PipelineSlot (defined in machineLib/PipeLineSlot.h), which represents one in-flight instruction. The slot encapsulates all state and side-effects during instruction execution through the six-stage pipeline. Slots are lightweight and reused aggressively via the ring buffer rotation.

 

Slot Contents

 

A PipelineSlot contains the following categories of state:

 

Instruction Identity

 

di (DecodedInstruction) — raw bits, PC, opcode, semantic flags

grain (const InstructionGrain*) — pointer to the resolved cached grain

execUnit (ExecUnit) — target Box: EBOX, MBOX, FBOX, CBOX, PALBOX

slotSequence (quint64) — monotonic ordering number for debugging

 

Execution Results

 

payLoad (quint64) — result value for Box side-effects

ra_value (quint64) — payload for the RA register

va, pa (quint64) — virtual and physical addresses for memory operations

writeRa, writeFa (bool) — flags indicating register write targets

needsWriteback (bool) — whether this instruction produces a register result

 

Branch State

 

branchTaken (bool) — actual branch outcome from EX

branchTarget (quint64) — actual branch target address

predictionValid, predictionTaken, predictionTarget — prediction metadata from IF

 

Fault and Exception State

 

faultPending (bool) — indicates a fault was detected during execution

trapCode (TrapCode_Class) — fault classification

faultVA (quint64) — faulting virtual address

faultEvent (PendingEvent) — full fault event descriptor

 

Pipeline Control

 

valid (bool) — whether the slot contains a live instruction

stalled (bool) — whether the slot is blocked from advancing

flushPipeline (bool) — request to flush younger stages

serialized (bool) — indicates serialization boundary

enterPalMode (bool) — request to enter PAL execution mode

needsMemoryBarrier, needsWriteBufferDrain (bool) — barrier request flags

memoryBarrierCompleted, writeBufferDrained (bool) — barrier completion flags

 

Box References

 

Each slot carries pointers to all five Boxes (m_eBox, m_fBox, m_mBox, m_palBox, m_cBox) and to the per-CPU FaultDispatcher. These are injected once during pipeline initialization via injectOtherBoxes() and remain constant for the lifetime of the pipeline.

 

Slot Lifecycle

 

A slot moves through three states: Valid (contains a live instruction, advancing through the pipeline), Stalled (blocked from advancing, waiting for a release condition), or Flushed (invalidated, slot.valid set to false, slot.clear() called). Slots downstream of a fault, branch misprediction, or PAL entry may be discarded without committing state.

 

See Also: machineLib/PipeLineSlot.h; 3.7 Execute Stage (EX); 3.9 Writeback Stage (WB).