For various reasons, the hoped-for C++11 lab never came to fruition. If you are interested, I recommend a slow and careful read of the wikipedia article on C++11, which explains many of the significant innovations of this release over previous C++ releases.
This replacement lab is likely to be a bit less content-laden than some before it.
— Luther Tychonievich
Due to scheduling constraints, we are running low on time to offer PA07. However, because the process of doing that is a beneficial learning exercise, and because I expect it will boost many of your GPAs to have it included, this lab will have you work with a partner on that PA.
When considering pipelined execution, there are two related but not identical notions of time
: instruction-order time and clock-cycle time. A pipeline diagram is a graph of both kinds of time, with instruction order on the vertical axis (future = down) and clock cycle on the horizontal (future = right).
For example, we might diagram the execution of
as
1 | 2 | 3 | 4 | 5 | 6 | 7 | |
---|---|---|---|---|---|---|---|
movq |
F | D | E | M | W | ||
addq |
F | D | D | E | M | W |
We can read a lot of information from this diagram; for example
We have a five-stage pipeline (F, D, E, M, W)
We ran two instructions (2 rows)
They had a joint latency of 7 cycles (7 columns)
The addq
stalled while in the decode stage
During cycle 4, nothing was in the execute stage (it had been given a nop
as part of the stall). If we looked at the stages then, we’d see
F | D | E | M | W |
---|---|---|---|---|
next | addq |
nop | movq |
previous |
Contrast that with cycle 3, which looked like
F | D | E | M | W |
---|---|---|---|---|
next | addq |
movq |
previous | instr before that |
This stage-style view can be created by taking a column and turning it sideways, then filling in missing stages with nop.
There are some things a pipeline diagram should never show:
With a partner, visit the pipline PA and do the following
Your lab credit will be based on being present and engaged. Your PA credit will be based on the correctness of your solution.