17.11.2012 Views

Soft-Core Processor Design - CiteSeer

Soft-Core Processor Design - CiteSeer

Soft-Core Processor Design - CiteSeer

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

LOAD state, except that a memory write request is issued and the data is not written to the<br />

register file. If a memory operation, either load or store, accesses the memory with no latency, the<br />

FSM never enters the respective state, because the memory operation commits in a single cycle,<br />

like most other operations.<br />

When a skip instruction reaches the execute stage, its condition is verified. The control unit is<br />

able to verify the skip condition because the values of the condition code flags, and a register<br />

operand, are forwarded to the control unit. These values are needed because the skip instruction<br />

SKPS tests the condition on flag values, while instructions SKPRZ, SKPRNZ, SKP1, and SKP0<br />

test the values of the register operand. If the skip condition is satisfied, the FSM enters the<br />

C_PFX state (Check for PFX). It remains in the C_PFX state if the instruction in the execute<br />

pipeline stage is a PFX instruction. While the FSM is in the C_PFX state, any instruction that<br />

reaches the execute stage does not commit its results. Therefore, the instruction that follows the<br />

PFX will not commit its result, which is required by the semantics of the PFX instruction. After<br />

the instruction following the PFX retires from the execute stage, the FSM returns to the R & X<br />

state.<br />

If a TRAP instruction is in the execute pipeline stage, a memory read request for a vector table<br />

entry is issued, and the FSM enters the TRAP state. The FSM remains in the TRAP state until the<br />

memory responds with valid data. At that point, pipeline registers and the prefetch unit are<br />

flushed, and new instructions are fetched from the address retrieved from the vector table. The<br />

FSM returns to the R & X state, and the operation of the pipeline resumes.<br />

Other instructions do not require additional states to be handled properly. If a control-flow<br />

instruction is in the operand pipeline stage, and the FSM is in the R & X state, the prefetch unit is<br />

flushed and the FSM remains in the R & X state. If the next instruction is not available from the<br />

prefetch unit, the pipeline is stalled, and the state machine stays in the R & X state. If a<br />

control-flow instruction is encountered while the FSM is in the LOAD or STORE state, the<br />

prefetch unit is flushed when the memory lowers the d_wait signal. If the control-flow instruction<br />

is encountered while the FSM is in the TRAP state, the control-flow instruction is not executed,<br />

because the TRAP instruction modifies the control flow itself and does not have the delay slot<br />

behaviour.<br />

I/O and software interrupts are handled by inserting the TRAP instruction with the appropriate<br />

interrupt number into the pipeline. In case of a software interrupt, all instructions following the<br />

instruction causing the interrupt are flushed from the pipeline and replaced by NOPs. The<br />

operation of the pipeline resumes until the inserted TRAP instruction reaches the execute stage,<br />

where it is handled like a normal TRAP instruction.<br />

45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!