[CS61C FA20] Lecture 22.3 - Pipelining II: Pipelining Datapath — Transcript
Full transcript
- 0:01[Music]
- 0:13hi
- 0:14welcome back to our pipelining module
- 0:17previously we have seen how pipelining
- 0:20is applied
- 0:21to laundry processing and we have also
- 0:23outlined
- 0:24how should we pipeline a risk five data
- 0:26path
- 0:28a conclusion there is that if we would
- 0:30like to build a five-stage pipeline
- 0:33we should define divide the the
- 0:35execution into
- 0:36five stages instruction fetch
- 0:39instruction decode
- 0:40execute memory access and write back so
- 0:43let's
- 0:44take a look at our single cycle data
- 0:47path
- 0:48that we are well familiar with by now
- 0:50and see how should we pipeline it
- 0:52so here is our single cycle data path
- 0:56it has familiar blocks that we have seen
- 0:58before like the program counter
- 1:00instruction memory this uh fixed plus
- 1:03four adder
- 1:04um immediate generation register file
- 1:07branch
- 1:09comparator um alu
- 1:12and the data memory and multiplexers
- 1:14that help configure this data path to
- 1:16execute a particular instruction
- 1:18and of course there is the control logic
- 1:20that
- 1:21configures the data path
- 1:25we have also outlined that there are
- 1:28different stages of execution inside
- 1:30this data path
- 1:31and those are the stages that we're
- 1:33going to break down
- 1:35into different pipeline stages
- 1:38to recap these stages are the
- 1:40instruction fetch
- 1:41instruction decode with register read
- 1:44alu execute stage memory access and
- 1:47write back
- 1:48the instruction fetch starts on the
- 1:51rising edge of a clock
- 1:54by incrementing the program counter
- 1:58and it finishes by having the data read
- 2:01out of the instruction memory
- 2:04remember our memory read and
- 2:07register access are treated as
- 2:09combinational
- 2:11logic operations meaning that they do
- 2:13not rely on clocks
- 2:15and as soon as the data is stable at the
- 2:18output we
- 2:19conclude we assume that that operation
- 2:22has been concluded
- 2:23has been finished so as soon as the
- 2:26instruction
- 2:26here instruction bits are stable at the
- 2:29output of the instruction memory
- 2:30we move on to the next stage the next
- 2:33stage is instruction decode
- 2:35when when where will this decode this
- 2:37memory and
- 2:38read the registers again the registers
- 2:40are read
- 2:41like a combinational logic so as soon as
- 2:44those values
- 2:45are stable at the output of the
- 2:48register file the instruction the code
- 2:52phase
- 2:52is done we move on to the
- 2:55execution phase or the execute phase
- 2:58where we perform the alu
- 2:59operation and that one is done when the
- 3:02output dlu is valid
- 3:04we move on to the memory access phase
- 3:07if we are accessing memory in loads or
- 3:09source
- 3:10and when we are done with that we move
- 3:13on
- 3:13to the right back where we write back
- 3:16into destination register
- 3:18in the
- 3:22register file on the rising edge of a
- 3:23clock
- 3:25so how do we pipeline well we simply
- 3:27insert registers at appropriate places
- 3:30at the end on the boundary between each
- 3:33of these execution phases
- 3:35we need to put registers so we are going
- 3:38to have registers here that are
- 3:39conveniently labeled as ifid
- 3:41id ex exma and mawb
- 3:47to separate various execution phases
- 3:54let's take a look at a few of the
- 3:55highlights here although this looks
- 3:57fairly
- 3:58familiar first
- 4:02at the end of the instruction fetch
- 4:04phase
- 4:05we have two registers we have a register
- 4:09for the program counter
- 4:10and for the instruction the latter one
- 4:13is particularly interesting
- 4:14keep in mind that we have five
- 4:16instructions in flight
- 4:18while one of them is being fetched we
- 4:20have copies of the
- 4:22previously fetched four instructions
- 4:24down the stream
- 4:25so we need to save those instructions
- 4:27that's why we have them in
- 4:28this register then in the registers
- 4:31below that and so on
- 4:35each one of these pipeline registers
- 4:38will have to hold
- 4:39the bits that correspond to the to the
- 4:42instruction that is being
- 4:44executed in that particular stage
- 4:47otherwise we will know what that stage
- 4:49is doing so that stage has to
- 4:51keep the instruction but also control
- 4:54bits that correspond
- 4:55to that the other thing
- 4:58that should be noticed here is that um
- 5:02we are sending down the program counter
- 5:03and we are pipelining the program
- 5:05counter
- 5:06value but we are not sending down the pc
- 5:09plus 4 value
- 5:11instead we are recreating pc plus 4
- 5:15value
- 5:15in the memory access stage
- 5:20that's a design decision it is cheaper
- 5:23to have a
- 5:24fixed function adder plus four adder
- 5:26instead
- 5:27of using one two three
- 5:30uh registers to store three
- 5:3332-bit pc plus four values the other
- 5:36thing that we notice here
- 5:38we are using the pc value
- 5:41more upstream here in the first three
- 5:43stages of execution and then we need
- 5:45only pc plus 4
- 5:47down in the memory access stage
- 5:52to send it down to be written back if
- 5:54needed
- 5:57and that is essentially it it looks
- 6:00fairly
- 6:01straightforward although there are a few
- 6:03catches that we are going to see
- 6:05a bit later
- 6:13the other thing that i just wanted to
- 6:15highlight here is
- 6:17this fact that we actually have five
- 6:19instructions the three
- 6:20instructions that are in flight here um
- 6:23the fifth one is not shown that is in
- 6:25the right back stage
- 6:26so the oldest instruction the first the
- 6:27one that made it the furthest down the
- 6:29pipe the first one the first one that
- 6:30went into the pipe
- 6:32made it the furthest down the pipe is
- 6:34the one in the memory access stage
- 6:36which is or then the one that is a
- 6:39little younger than that one
- 6:41is slt and then we have uh store word
- 6:45and the one that is being presently
- 6:50fetched is load word keep in mind
- 6:54that we do have to pack everything that
- 6:56is associated with that instruction into
- 6:58that pipeline stage
- 7:00so the instruction that is in the memory
- 7:03access
- 7:04will have its copy in the register here
- 7:06and also
- 7:08the values that correspond to it in
- 7:11the the associated registers that
- 7:14precede that stage and the same thing
- 7:16here
- 7:17happens before the
- 7:21execute stage we have copies of
- 7:23everything that is needed for that
- 7:25particular instruction
- 7:26because we are going to get new values
- 7:29for
- 7:30the previous for the next instruction
- 7:31which is store worked
- 7:35the other thing to keep in mind besides
- 7:37the
- 7:38instruction bits we also need to save
- 7:42the decoded control bits
- 7:44remember we have control logic that
- 7:46tells us what
- 7:47each stage should be doing how each
- 7:49stage should be configured
- 7:51so once when we decode the instruction
- 7:54we in addition
- 7:55to our instruction we need to send down
- 7:57the stream all the control bits that
- 7:59correspond
- 8:00to that instruction
- 8:03so each of these
- 8:07registers that are storing the prior
- 8:08encounter are going to be a bit wider
- 8:10to save the necessary control signals
- 8:15so for example our memory access
- 8:18stage register or the register is
- 8:22sitting between the memory access and
- 8:23the right back
- 8:24has to con save the control signals that
- 8:27correspond
- 8:28to that final right back um
- 8:31over there and then um you know between
- 8:35right back and memory access uh between
- 8:38the execute and memory access we need to
- 8:40save the bits that correspond to the
- 8:42memory access
- 8:43and the write back stages and so on
- 8:49that is basically it there are some
- 8:52things
- 8:52however that are particular to this
- 8:56to the situation or have multiple
- 8:59instructions in flight
- 9:01and which are called hazards we're going
- 9:04to take a look at the hazards
- 9:06next see you then
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 22.3 - Pipelining II: Pipelining Datapath by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,218 words across 234 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.