This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pipeline result register write.

Note: This was originally posted on 13th January 2011 at http://forums.arm.com

Hi.

I'm trying to develop a small program to count the cycle of a program.
I found an interresting case.

As you know 2 instructions can not execute in the same cycle if the destination registrer is the same.
It's sound logic, but in fact due to pipeline step, this is not as logic at it should be.

For example the next code should work

mov  r0, #15
add  r0, r0, #15


The MOV will write r0 in E1
The ADD will write r0 in E2
So there is no good reason to not start instruction execution in the same cycle

An opposite case is the next one


mul  r0, r1, r2
nop
add  r0, r5, r6
add  r0, r6, r7


The mul will execute in pipe 0 and write is result in E5
The 2 ADD will execute in separate pipeline 0 and pipeline 1 (due to the same destination regsiter). But they both have to wait for r0.
So finally they will execute exactly in the same cycle and should write their result in the same cycle.

So finally my question (because there is always a question):
What mean issued in this sentence
"Instructions with the same destination cannot be issued in the same cycle"

Does it mean the started cycle or the writing result cycle ?

Etienne
Parents
  • Note: This was originally posted on 16th January 2011 at http://forums.arm.com

    hi

    issuing means the starting cycle. As for the two examples given, both are right: issuing the dependent instructions is done according to a scoreboard (not traditional) in the decode stages. The scoreboard counts the cycles after which each of the two instructions will be writing and issue correspondingly. Because in the 1st example MOV writes after 2cycles (E0-E1) while ADD after 3 cycles => can be issued together. In the 2nd example both instructions will write  together after 3 cycles and will no therefore be issued from the decode at the same cycle (as dual).

    But i have a question for you: when they say that the MOV e.g. will write at E1, they mean that the answer will be available for forward at E1 and wait till E5 to write into the reg file of is it that it will write at E1 into the reg file??
Reply
  • Note: This was originally posted on 16th January 2011 at http://forums.arm.com

    hi

    issuing means the starting cycle. As for the two examples given, both are right: issuing the dependent instructions is done according to a scoreboard (not traditional) in the decode stages. The scoreboard counts the cycles after which each of the two instructions will be writing and issue correspondingly. Because in the 1st example MOV writes after 2cycles (E0-E1) while ADD after 3 cycles => can be issued together. In the 2nd example both instructions will write  together after 3 cycles and will no therefore be issued from the decode at the same cycle (as dual).

    But i have a question for you: when they say that the MOV e.g. will write at E1, they mean that the answer will be available for forward at E1 and wait till E5 to write into the reg file of is it that it will write at E1 into the reg file??
Children
No data