Search code examples
mipspipelinemips32

Query about MIPS R3051 pipeline behaviour (MIPS-I architecture)


I am currently implementing a MIPS R3051 in software as part of my university project.

I notice in the programmers manual from IDT it specifies that computational instructions can access the results of other computational instructions ahead of them in the pipeline at their RD stage, even though the ahead instruction has not yet committed its results to the relevant register in the WB stage. This is done via "special logic within the execution engine" to prevent a stall being necessary.

My query is does this also apply to non-computational instructions (like a jump-type instruction for example)?

An example: if an ADD instruction calculates a value at its ALU stage destined for r1, with a JR [r1] instruction behind it in the pipeline at RD, will the JR instruction get:

(a) the old contents of r1 or

(b) will this "special logic" allow the new value of r1 to be forwarded to it? or

(c) will the pipeline stall until r1 has been committed properly at WB?

Apologies if this is asked elsewhere (I have not spotted it). Many thanks.

Regards, Phil


Solution

  • The key here is to keep well in mind that this "special logic" is only an optimization: it makes things faster, here bypassing something so to avoid a stall, but it must still insure that the result is unchanged. Otherwise it would be impossible or at least to difficult to program with this hardware.

    So, to answer your question, you will see either case (b) or (c) but never case (a).