4.5 EBox - Execution Box (Integer Core)

<< Click to Display Table of Contents >>

Navigation:  ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 4 - Functional Execution Domains ("Boxes) >

4.5 EBox - Execution Box (Integer Core)

The EBox implements integer and control-flow execution semantics. It performs computation, not coordination.

 

Responsibilities

 

Integer arithmetic — ADD, SUB, MUL (UMULH, MULLV, SUBQV, etc.)

Logical operations — AND, OR, XOR, BIC, ORNOT, shifts (SLL, SRL, SRA)

Byte manipulation — ZAP, ZAPNOT, EXTBL/EXTWL/EXTLL/EXTQL, INSBL/INSWL/INSLL/INSQL, MSKBL/MSKWL/MSKLL/MSKQL

Integer comparisons — CMPEQ, CMPLT, CMPLE, CMPULT, CMPULE

Conditional moves — CMOVEQ, CMOVNE, CMOVLT, CMOVGE, CMOVLE, CMOVGT

Branch condition evaluation — BEQ, BNE, BLT, BGE, BLE, BGT, BLBS, BLBC

Address calculation for memory instructions — LDA, LDAH (effective address computation)

 

Interaction Model

 

EBox reads operands from the integer register file (slot.readIntReg()), executes the operation, and writes the result into slot.payLoad with slot.needsWriteback = true. EBox does not directly access memory — all memory operations are routed through MBox. EBox may set stall or barrier flags that affect CBox.

 

Scoreboarding

 

EBox maintains an integer register scoreboard (m_intRegisterDirty, a 32-bit bitmask) that tracks which registers have pending writes. setScoreboard() marks a destination register as dirty when an instruction enters EX; clearScoreboard() clears it when the result is committed. This supports hazard detection without pipeline back-scanning.

 

Multi-Cycle Operations

 

Integer multiply and divide operations may take multiple cycles. EBox tracks busy state via m_busy and m_cyclesRemaining, with a tick() method that decrements the counter each cycle until the operation completes.

 

Implementation: EBoxBase.h, 2,257 lines, 93 execute methods.

 

Invariant: EBox computes addresses; MBox performs memory effects.

 

See Also: EBoxLib/EBoxBase.h; Chapter 14 – Execution Domains (“Boxes”).