Multi-Cycle MIPS Implementation
Tom Kelliher, CS 240
Nov. 9, 2007
Homework due now!
Be ready to work control sequencing exercises in class.
Comparison between single- and multi-cycle implementations.
- Introduction.
- Components added to the datapath.
- The complete datapath and its control signals.
Controlling the multi-cycle implementation.
- Instruction cycle broken into a number of clock cycles.
- Functional units can be shared: Use ALU for incrementing PC.
Hardware savings.
- Instructions can take differing numbers of clock cycles.
High-level block diagram:
Features relative to single cycle implementation:
- Single, unified memory.
- Eliminated two adders.
- Registers added between major functional to hold values for next
clock cycle. Are they architectural registers?
Two uses for additional registers:
- Fitting the clock cycle.
- Holding values needed during a later clock cycle of this
instruction.
Example: computing and holding branch target address before the
instruction is decoded.
Determining where to place registers for timing purposes:
- All combinational paths must fit into one clock cycle.
- Assume that a clock cycle can accommodate at most one of the
following:
- Memory access.
- Register file access.
- ALU operation.
- The added registers:
- Instruction register (IR): Holds the currently executing
instruction.
- Memory data register (MDR): Holds the memory word from a lw.
- Register file read registers (A and B): Buffers read data from
register file.
- ALU out register (ALUout): Buffers output from ALU.
Needed because we eliminated the adders. We'll need to add them back
later.
- PC to upper input.
- Constant 4 and sign-extended, shifted immediate field to lower
input.
Control signals:
- RegDst, RegWrite.
- ALUSrcA: Choose between PC and Rs.
- MemRead, MemWrite, MemtoReg.
- IorD: Choose between PC and ALUOut for memory address.
- PCWrite: Load a new value into PC.
- PcWriteCond: Load a new value into PC if zero is active.
- ALUOp.
- ALUSrcB: Choose between Rt/Rd, 4, sign-extended immediate,
sign-extended shifted immediate.
- PCSource: Choose between PC + 4, ALUOut (branch target address), jump
address
Thomas P. Kelliher
2007-11-07
Tom Kelliher