Beruflich Dokumente
Kultur Dokumente
SP98, U.CB
Administrative Issues
Read Chapter 5 This lecture and next one slightly different from the book Thursday lecture -- Nick Weaver
SP98, U.CB
Top-down
specify component behavior from high-level requirements
Iterative refinement
establish partial solution, expand and improve Instruction Set Architecture
=>
datapath
processor
control
Reg. File
Mux
ALU
Reg
Mem
Decoder
Sequencer
Cells
cs 152 L12 Multicycle.3
Gates
SP98, U.CB
1 Mux 0 RegWr 5
Rt Zero
Rs
Rd
busW 32 Clk
MemWr
32 32 WrEn Adr
1 32
imm16
Data In 32 Clk
16
Data Memory
ALUSrc ExtOp
cs 152 L12 Multicycle.4 SP98, U.CB
:
ALUop 3 00 0000 R-type 1 0 0 1 0 0 0 x R-type 1 0 0
op RegDst ALUSrc MemtoReg RegWrite MemWrite Branch Jump ExtOp ALUop (Symbolic) ALUop <2> ALUop <1> ALUop <0>
cs 152 L12 Multicycle.5
00 1101 10 0011 10 1011 00 0100 00 0010 ori 0 1 0 1 0 0 0 0 Or 0 1 0 lw 0 1 1 1 0 0 0 1 Add 0 0 0 sw x 1 x 0 1 0 0 1 Add 0 0 0 beq x 0 x 0 0 1 0 x Subtract 0 0 1 jump x x x 0 0 0 1 x xxx x x x
SP98, U.CB
..
op<5>
..
op<5>
..
op<5>
..
op<5>
..
<0>
op<5>
..
op<0>
<0>
<0>
<0>
<0>
R-type
ori
lw
sw
beq
jump
RegWrite ALUSrc RegDst MemtoReg MemWrite Branch Jump ExtOp ALUop<2> ALUop<1> ALUop<0>
SP98, U.CB
Datapath
In our single-cycle processor, each instruction is realized by exactly one control command or microinstruction
in general, the controller is a finite state machine microinstruction can also control sequencing (see later)
cs 152 L12 Multicycle.7 SP98, U.CB
The Big Picture: Where are We Now? The Five Classic Components of a Computer
Processor Input Control Memory Datapath
Output
Todays Topic: Designing the Datapath for the Multiple Clock Cycle Datapath
SP98, U.CB
nPC_sel
Register Fetch
Equal
Main Control
ALU control
MemRd MemWr
Result Store
mux
mux
Inst Memory
ALU
Data Mem
mux setup
mux
ALU
Data Mem
cmp
mux
Long Cycle Time All instructions take as much time as the slowest Real memory is not so nice as our idealized memory
cannot always get the job done in one (short) cycle
cs 152 L12 Multicycle.10 SP98, U.CB
sense amps
proc. bus
mem. bus
Processor
Cache 1 cycle
memory
20 - 50 cycles
SP98, U.CB
=>
storage element
SP98, U.CB
Instruction Fetch
InstructionReg <= Mem[PC]
Register Access
A <= R[rs]
ALU operation
R <= A + B
nPC_sel
Control
MemRd MemWr ALUSrc ALUctr ExtOp MemWr
SP98, U.CB
RegDst RegWr
PC
Exec
Data Mem
Result Store
Instruction Fetch
Operand Fetch
Next PC
Mem Access
Reg. File
nPC_sel
Operand Fetch
ExtOp
Result Store
Exec
Critical Path ?
Next PC PC
nPC_sel
Instruction Fetch
IR
Operand Fetch
B Mem Access M Data Mem
Result Store
A
ExtOp ALUSrc ALUctr
Recall: Step-by-step Processor Design Step 1: ISA => Logical Register Transfers Step 2: Components of the Datapath Step 3: RTL + Components => Datapath Step 4: Datapath + Logical RTs => Physical RTs Step 5: Physical RTs => Control
SP98, U.CB
Inst. Mem
Next PC
PC
A B
Exec
Reg File
IR
SP98, U.CB
Reg. File
Equal
Inst. Mem
Next PC
PC
A B
Exec
Reg File
IR
SP98, U.CB
Reg. File
Equal
Step 4 : Load
Logical Register Transfer Physical Register Transfers
inst LW Logical Register Transfers R[rt] < MEM(R[rs] + sx(Im16); PC < PC + 4 inst LW Physical Register Transfers IR < MEM[pc] A< R[rs]; B < R[rt] S < A + SignEx(Im16) M < MEM[S] R[rd] < M; PC < PC + 4
Inst. Mem
Next PC
PC
A B
Exec
Reg File
IR
SP98, U.CB
Reg. File
Equal
Step 4 : Store
Logical Register Transfer
inst SW Logical Register Transfers MEM(R[rs] + sx(Im16) < R[rt]; PC < PC + 4 inst Physical Register Transfers IR < MEM[pc] SW A< R[rs]; B < R[rt] S < A + SignEx(Im16); MEM[S] < B PC < PC + 4
Inst. Mem
Next PC
PC
A B
Exec
Reg File
IR
SP98, U.CB
Reg. File
Equal
Step 4 : Branch
Logical Register Transfer
inst BEQ Logical Register Transfers if R[rs] == R[rt] then PC <= PC + sx(Im16) || 00
else PC <= PC + 4 Physical Register Transfers IR < MEM[pc] BEQ|Eq PC < PC + sx(Im16) || 00
Inst. Mem
Next PC
PC
A B
Exec
Reg File
IR
SP98, U.CB
Reg. File
Equal
BrWr Target
Mux
0 32 0 1 2 3 32
32
Mux
Instruction Reg
32 32
Mux
1
Ideal Memory
WrAdr 32 Din Dout
Reg File
Mux
32
<< 2
ALU Control
Imm 16
Extend
32
ALUOp ALUSelB
SP98, U.CB
ExtOp
MemtoReg