Digital Logic Design: a rigorous approach c
- Chapter 22: A Simplified DLX: Implementation
Guy Even Moti Medina
School of Electrical Engineering Tel-Aviv Univ.
June 16, 2020 Book Homepage: http://www.eng.tau.ac.il/~guy/Even-Medina
1 / 1
Digital Logic Design: a rigorous approach c Chapter 22: A - - PowerPoint PPT Presentation
Digital Logic Design: a rigorous approach c Chapter 22: A Simplified DLX: Implementation Guy Even Moti Medina School of Electrical Engineering Tel-Aviv Univ. June 16, 2020 Book Homepage: http://www.eng.tau.ac.il/~guy/Even-Medina 1 / 1
1 / 1
1 Goal: design a circuit that can execute any DLX program
2 This circuit is a stored program computer also known as a
3 A practical computer based on Turing’s idea of a universal
4 First stored program computers built in 1948-1949 (SSEM,
2 / 1
3 / 1
1 There are 32 General Purpose Registers (GPR): R0 to R31. 2 The Instruction Register (IR) is, also, a clock enabled parallel
3 The remaining registers: Program Counter (PC), Memory
4 / 1
5 / 1
6 / 1
7 / 1
1 The input may change in cycle t only if
2 If busy(t) = 0 and busy(t − 1) = 1, then: 1
2
8 / 1
9 / 1
Env. Memory Controller Memory Controller Z1 Z2
ADMUX
GPR Env. B PC Env.
MDR
00 01 10 11 10 00 01 11
S1MUX S2MUX
DINTMUX
1
MAR
1 31
032 1
IR Env.
1
MDRMUX
C A S1 S2 DINT DI[31:0] DO[31:0] AO[31:0]
SHIFT Env.
ALU
10 / 1
32 32 ALU 5 type[4:0] Z[31:0] 32 X[31:0] Y[31:0]
xor(32) add-sub(32) comp(32) and(32)
11 / 1
△
12 / 1
13 / 1
1 The outcome of a comparison is one or zero depending on
2 The logical operations are bitwise. 3 The comparison operations return either 032 or 031 ◦ 1. 4 The input type[0] indicates if the function is addition. It is
5 The input type[1] indicates if the function is comparison. 14 / 1
15 / 1
16 / 1
△
17 / 1
18 / 1
19 / 1
20 / 1
21 / 1
22 / 1
1 Write the value of input C in Ri, where i = Cadr. 2 Read the contents of the registers Ri and Rj, where
23 / 1
24 / 1
1 data: array R[31 : 0] of 32-bit wide registers. 2 initialize: ∀i : R[i] ← 032. 3 For t = 0 to ∞ do 1
2
3
25 / 1
clk R/W Address[4 : 0] Din[31 : 0] clk R/W Address[4 : 0] Din[31 : 0] ram(25) × 32 ram(25) × 32 5 5 32 32 5 5 5 1 5 32 32 Cadr Aadr Badr AEQZ C clk clk Dout[31 : 0] Dout[31 : 0] Cadr zero 1 1 Bin GPR WE GPR WE GPR WE tester
GPR WE’ GPR WE’ Aout Ain
26 / 1
27 / 1
1 Instruction Fetch: copy the instruction to be executed from
2 Instruction Decode. Decode the instruction stored in the IR.
3 Execute. Execute the instruction, for example, in an add
4 Memory Access. In this step load and store instructions access
5 Write-back. Store the result of an instruction, if needed, in
28 / 1
29 / 1
FETCH DECODE LOAD COPYMDR2C COPYGPR2MDR STORE JR SAVEPC ADDRESSCMP JALR BRANCH BTAKEN TESTI ALUI WBI SHIFT ALU WBR busy D5 D6 D7 D9 D8 is−store busy busy bt D4 D3 D2 HALT D10 D1 not(busy) not(bt) not(is-store) not(busy) not(busy)
30 / 1
1 Instruction Fetch. The Fetch state is the only state that deals
2 Instruction Decode. The Decode state is the only state that
3 Execute. The states: Alu, TestI, AluI, and Shift deal with the
4 Memory Access. The states Load and Store deal with memory
5 Write-back. The states WBR and WBI deal with writing back
31 / 1
1 States that deal with the execution of branch and jump
2 States that deal with load and store instructions. These are
3 A sink state, called Halt, for stopping the execution. 32 / 1
1 The current instruction Inst[31 : 0] that is an output of the
2 The AEQZ flag that indicates if the output of register A equals
3 The busy flag that is output by the memory controller. 33 / 1
1 IRCE, PCCE, ACE, BCE, CCE, MARCE, MDRCE: clock
2 S1SEL[1:0], S2SEL[1:0], DINTSEL, MDRSEL, ADSEL:
3 ALUF[2:0], ADD, TEST: signals that are input to the ALU
34 / 1
1 SHIFT, RIGHT: signals that are input to the Shifter
2 Itype: indicates whether the current instruction is an I-type
3 JLINK: This signal is input to the IR environment. The signal
35 / 1
36 / 1
37 / 1
38 / 1
39 / 1
40 / 1
FETCH DECODE LOAD COPYMDR2C COPYGPR2MDR STORE JR SAVEPC ADDRESSCMP JALR BRANCH BTAKEN TESTI ALUI WBI SHIFT ALU WBR busy D5 D6 D7 D9 D8 is−store busy busy bt D4 D3 D2 HALT D10 D1 not(busy) not(bt) not(is-store) not(busy) not(busy)
41 / 1
1 The Fetch, Load and Store states have a self-loop labeled by
2 The Branch state has two possible transitions. The transition
42 / 1
1 The Address-Computation has two possible transitions. The
2 The Decode state has 10 possible transitions. These
43 / 1
busy D5
WBI
busy
FETCH DECODE
ADDRESSCMP
LOAD COPYMDR2C not(busy) not(is-store) not(busy)
44 / 1
SHIFT Env.
ALU Env. Memory Controller Memory Controller
ADMUX
AO[31:0] GPR Env. B PC Env.
MDR
00 01 10 11 10 00 01 11
S1MUX S2MUX
DINTMUX
1
MAR
1 31
032 1
IR Env.
1
MDRMUX
C A S1 S2 DINT DI[31:0] DO[31:0]
45 / 1
Env.
ALU Env. Memory Controller Memory Controller GPR Env. B PC Env.
MDR
00 01 10 11 10 00 01 11
S1MUX S2MUX
DINTMUX
1
MAR
1
ADMUX
31
032 1
IR Env.
1
MDRMUX
C A S1 S2 DINT DI[31:0] DO[31:0] AO[31:0]
SHIFT
46 / 1
Env.
ALU Env. Memory Controller Memory Controller
ADMUX
GPR Env. B PC Env.
MDR
00 01 10 11 10 00 01 11
S1MUX S2MUX
DINTMUX
1
MAR
1 31
032 1
IR Env.
1
MDRMUX
C A S1 S2 DINT DI[31:0] DO[31:0] AO[31:0]
SHIFT
47 / 1
Env. Memory Controller Memory Controller AO[31:0]
1
GPR Env. B PC Env.
MDR
00 01 10 11 10 00 01 11
S1MUX S2MUX
DINTMUX
1
MAR ADMUX
31
032 1
IR Env.
1
MDRMUX
C A S1 S2 DINT DI[31:0] DO[31:0]
SHIFT Env.
ALU
48 / 1
Memory Controller Memory Controller DINT GPR Env. B PC Env.
MDR
00 01 10 11 10 00 01 11
S1MUX S2MUX
DINTMUX
1
MAR
1
ADMUX
31
032 1
IR Env.
1
MDRMUX
C A S1 S2 DI[31:0] DO[31:0] AO[31:0]
SHIFT Env.
ALU Env.
49 / 1
ALU Env. Memory Controller Memory Controller GPR Env. B PC Env.
MDR
00 01 10 11 10 00 01 11
S1MUX S2MUX
DINTMUX
1
MAR
1
ADMUX
31
032 1
IR Env.
1
MDRMUX
C A S1 S2 DINT DI[31:0] DO[31:0] AO[31:0]
SHIFT Env.
50 / 1
51 / 1