single-cycle (fjnish) / pipelining 0 1 Changelog 29 September - - PowerPoint PPT Presentation

single cycle fjnish pipelining 0
SMART_READER_LITE
LIVE PREVIEW

single-cycle (fjnish) / pipelining 0 1 Changelog 29 September - - PowerPoint PPT Presentation

single-cycle (fjnish) / pipelining 0 1 Changelog 29 September 2020: rephrase questions on stage walkthrough slides 29 September 2020: make stage walkthrough partial circuits more complete 1 last time data memory operation accesses same data


slide-1
SLIDE 1

single-cycle (fjnish) / pipelining 0

1

slide-2
SLIDE 2

Changelog

29 September 2020: rephrase questions on stage walkthrough slides 29 September 2020: make stage walkthrough partial circuits more complete

1

slide-3
SLIDE 3

last time

data memory operation

accesses same data as instruction memory write at end of cycle if write enable signal set

single-cycle CPU timing

conceptual division into stages non-writing components compute/read as they get inputs writing components act at rising edge of clock

building processors with MUXes

(1) fjgure out what needs to happen for each instruction (2) place MUXes to make decision based on type of instruction

2

slide-4
SLIDE 4

some linking/ISAHW notes (1)

JMP instruction, etc.: takes an address relocations fjll in that address

not the machine code at that address needs adjustment when combining object fjles into executable

relocations generally don’t change machine code size

3

slide-5
SLIDE 5

some linking/ISAHW notes (2)

movq 0x1234(%rax,%rbx,8), %rcx … reads from memory at address RAX + RBX × 8 + 0x1234

common error: missing memory access? common error: addition + multiplication not before memory access

4

slide-6
SLIDE 6

some linking/ISAHW notes (3)

mov %X, %Y add %A, %Y mov %Y, %X add %B, %X mov %C, %Y add %A, %X add %B, %X mov %C, %Y

5

slide-7
SLIDE 7

SEQ: instruction fetch

read instruction memory at PC split into seperate wires:

icode:ifun — opcode rA, rB — register numbers valC — call target or mov displacement

compute next instruction address:

valP — PC + (instr length)

6

slide-8
SLIDE 8

instruction fetch

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

7

slide-9
SLIDE 9

SEQ: instruction “decode”

read registers

valA, valB — register values

8

slide-10
SLIDE 10

instruction decode (1)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

exercise: for which instructions would there be a problem ? nop, addq, mrmovq, rmmovq, jmp, pushq

9

slide-11
SLIDE 11

instruction decode (1)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

exercise: for which instructions would there be a problem ? nop, addq, mrmovq, rmmovq, jmp, pushq

9

slide-12
SLIDE 12

instruction decode (1)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

exercise: for which instructions would there be a problem ? nop, addq, mrmovq, rmmovq, jmp, pushq of these: only pushq

9

slide-13
SLIDE 13

SEQ: srcA, srcB

always read rA, rB? Problems:

push rA pop call ret

book: extra signals: srcA, srcB — computed input register MUX controlled by icode

10

slide-14
SLIDE 14

SEQ: possible registers to read

instruction srcA srcB halt, nop, jCC, irmovq none none cmovCC, rrmovq rA none mrmovq none rB rmmovq, OPq rA rB call, ret none? %rsp pushq, popq rA %rsp MUX srcB

rB %rsp

(none)

F

logic function icode

11

slide-15
SLIDE 15

SEQ: possible registers to read

instruction srcA srcB halt, nop, jCC, irmovq none none cmovCC, rrmovq rA none mrmovq none rB rmmovq, OPq rA rB call, ret none? %rsp pushq, popq rA %rsp MUX srcB

rB %rsp

(none)

F

logic function icode

11

slide-16
SLIDE 16

instruction decode (2)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

12

slide-17
SLIDE 17

SEQ: execute

perform ALU operation (add, sub, xor, and)

valE — ALU output

read prior condition codes

Cnd — condition codes based on ifun (instruction type for jCC/cmovCC)

write new condition codes

13

slide-18
SLIDE 18

using condition codes: cmov

(always) 1 (le) SF | ZF (l) SF

cc

(from instr) rB 0xF dstE

NOT

14

slide-19
SLIDE 19

execute (1)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

exercise: which of these instructions would there be a problem ? nop, addq, mrmovq, popq, call,

15

slide-20
SLIDE 20

execute (1)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

exercise: which of these instructions would there be a problem ? nop, addq, mrmovq, popq, call,

15

slide-21
SLIDE 21

SEQ: ALU operations?

ALU inputs always valA, valB (register values)? no, inputs from instruction: (Displacement + rB)

MUX

aluA

valA valC

mrmovq rmmovq

no, constants: (rsp +/- 8)

pushq popq call ret

extra signals: aluA, aluB

computed ALU input values

16

slide-22
SLIDE 22

execute (2)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

17

slide-23
SLIDE 23

SEQ: Memory

read or write data memory

valM — value read from memory (if any)

18

slide-24
SLIDE 24

memory (1)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

exercise: which of these instructions would there be a problem ? nop, rmmovq, mrmovq, popq, call,

19

slide-25
SLIDE 25

memory (1)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

exercise: which of these instructions would there be a problem ? nop, rmmovq, mrmovq, popq, call,

19

slide-26
SLIDE 26

SEQ: control signals for memory

read/write — read enable? write enable? Addr — address

mostly ALU output special cases (need extra MUX): popq, ret

Data — value to write

mostly valA special cases (need extra MUX): call

20

slide-27
SLIDE 27

memory (2)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

21

slide-28
SLIDE 28

SEQ: write back

write registers

22

slide-29
SLIDE 29

write back (1)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP textbook convention: E used for storing ALU results (e.g. add) M used for storing memory results (e.g. rmmovq) (you don’t have to do this…)

exercise: which of these instructions would there be a problem ? nop, irmovq, mrmovq, rmmovq, addq, popq

23

slide-30
SLIDE 30

write back (1)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP textbook convention: E used for storing ALU results (e.g. add) M used for storing memory results (e.g. rmmovq) (you don’t have to do this…)

exercise: which of these instructions would there be a problem ? nop, irmovq, mrmovq, rmmovq, addq, popq

23

slide-31
SLIDE 31

write back (1)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP textbook convention: E used for storing ALU results (e.g. add) M used for storing memory results (e.g. rmmovq) (you don’t have to do this…)

exercise: which of these instructions would there be a problem ? nop, irmovq, mrmovq, rmmovq, addq, popq

23

slide-32
SLIDE 32

SEQ: control signals for WB

two write inputs — two needed by popq

valM (memory output), valE (ALU output)

two register numbers

dstM, dstE

write disable — use dummy register number 0xF

MUX

dstE

rB F %rsp

24

slide-33
SLIDE 33

write back (2a)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

25

slide-34
SLIDE 34

write back (2b)

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

26

slide-35
SLIDE 35

SEQ: Update PC

choose value for PC next cycle (input to PC register)

usually valP (following instruction) exceptions: call, jCC, ret

27

slide-36
SLIDE 36

PC update

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF Stat

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length + valP

28

slide-37
SLIDE 37

circuit: setting MUXes

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length +

8 9

PC+2 M[PC+1]

rA=8 rB=9 R[8] R[9] aluA + aluB M[PC+2]

add

MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select when running addq %r8, %r9? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for rmmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for irmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for mrmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for jle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for cmovle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for ret? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for popq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for call?

29

slide-38
SLIDE 38

circuit: setting MUXes

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length +

8 9

PC+2 M[PC+1]

rA=8 rB=9 R[8] R[9] aluA + aluB M[PC+2]

add

MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select when running addq %r8, %r9? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for rmmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for irmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for mrmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for jle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for cmovle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for ret? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for popq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for call?

29

slide-39
SLIDE 39

circuit: setting MUXes

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length +

8 9

PC+2 M[PC+1]

rA=8 rB=9 R[8] R[9] aluA + aluB M[PC+2]

add

MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select when running addq %r8, %r9? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for rmmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for irmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for mrmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for jle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for cmovle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for ret? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for popq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for call?

29

slide-40
SLIDE 40

circuit: setting MUXes

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length +

8 9

PC+2 M[PC+1]

rA=8 rB=9 R[8] R[9] aluA + aluB M[PC+2]

add

MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select when running addq %r8, %r9? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for rmmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for irmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for mrmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for jle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for cmovle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for ret? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for popq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for call?

30

slide-41
SLIDE 41

circuit: setting MUXes

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length +

8 9

PC+2 M[PC+1]

rA=8 rB=9 R[8] R[9] aluA + aluB M[PC+2]

add

MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select when running addq %r8, %r9? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for rmmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for irmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for mrmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for jle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for cmovle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for ret? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for popq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for call?

30

slide-42
SLIDE 42

circuit: setting MUXes

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length +

8 9

PC+2 M[PC+1]

rA=8 rB=9 R[8] R[9] aluA + aluB M[PC+2]

add

MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select when running addq %r8, %r9? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for rmmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for irmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for mrmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for jle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for cmovle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for ret? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for popq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for call?

31

slide-43
SLIDE 43

circuit: setting MUXes

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length +

8 9

PC+2 M[PC+1]

rA=8 rB=9 R[8] R[9] aluA + aluB M[PC+2]

add

MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select when running addq %r8, %r9? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for rmmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for irmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for mrmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for jle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for cmovle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for ret? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for popq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for call?

32

slide-44
SLIDE 44

circuit: setting MUXes

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length +

8 9

PC+2 M[PC+1]

rA=8 rB=9 R[8] R[9] aluA + aluB M[PC+2]

add

MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select when running addq %r8, %r9? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for rmmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for irmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for mrmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for jle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for cmovle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for ret? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for popq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for call?

33

slide-45
SLIDE 45

circuit: setting MUXes

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length +

8 9

PC+2 M[PC+1]

rA=8 rB=9 R[8] R[9] aluA + aluB M[PC+2]

add

MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select when running addq %r8, %r9? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for rmmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for irmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for mrmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for jle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for cmovle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for ret? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for popq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for call?

34

slide-46
SLIDE 46

circuit: setting MUXes

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length +

8 9

PC+2 M[PC+1]

rA=8 rB=9 R[8] R[9] aluA + aluB M[PC+2]

add

MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select when running addq %r8, %r9? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for rmmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for irmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for mrmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for jle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for cmovle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for ret? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for popq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for call?

35

slide-47
SLIDE 47

circuit: setting MUXes

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length +

8 9

PC+2 M[PC+1]

rA=8 rB=9 R[8] R[9] aluA + aluB M[PC+2]

add

MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select when running addq %r8, %r9? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for rmmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for irmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for mrmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for jle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for cmovle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for ret? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for popq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for call?

36

slide-48
SLIDE 48

circuit: setting MUXes

PC

Instr. Mem.

register fjle

srcA srcB R[srcA] R[srcB] dstE next R[dstE] dstM next R[dstM]

Data Mem.

ZF/SF

Data in Addr in Data out

valC

0xF 0xF %rsp %rsp 0xF 0xF %rsp rA rB

ALU

aluA aluB valE 8 add/sub xor/and (function

  • f instr.)

write? function

  • f opcode

PC+9

instr. length +

8 9

PC+2 M[PC+1]

rA=8 rB=9 R[8] R[9] aluA + aluB M[PC+2]

add

MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select when running addq %r8, %r9? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for rmmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for irmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for mrmovq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for jle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for cmovle? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for ret? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for popq? MUXes — PC, dstM, dstE, aluA, aluB, dmemIn, dmemAddr, … Exercise: what do they select for call?

37

slide-49
SLIDE 49

Human pipeline: laundry

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

whites whites whites colors colors colors whites whites whites colors colors colors sheets sheets sheets

38

slide-50
SLIDE 50

Human pipeline: laundry

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

whites whites whites colors colors colors whites whites whites colors colors colors sheets sheets sheets

38

slide-51
SLIDE 51

Waste (1)

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

whites whites whites colors colors colors sheets sheets sheets

wasted time! wasted time!

39

slide-52
SLIDE 52

Waste (1)

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

whites whites whites colors colors colors sheets sheets sheets

wasted time! wasted time!

39

slide-53
SLIDE 53

Waste (2)

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

whites whites whites colors colors colors sheets sheets sheets

40

slide-54
SLIDE 54

Latency — Time for One

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

whites whites whites colors colors colors sheets sheets sheets

pipelined latency (2.1 h)

colors colors colors

normal latency (1.8 h)

41

slide-55
SLIDE 55

Latency — Time for One

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

whites whites whites colors colors colors sheets sheets sheets

pipelined latency (2.1 h)

colors colors colors

normal latency (1.8 h)

41

slide-56
SLIDE 56

Latency — Time for One

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

whites whites whites colors colors colors sheets sheets sheets

pipelined latency (2.1 h)

colors colors colors

normal latency (1.8 h)

41

slide-57
SLIDE 57

Throughput — Rate of Many

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

whites whites whites colors colors colors sheets sheets sheets

time between fjnishes (0.83 h) load h loads/h time between starts (0.83 h)

42

slide-58
SLIDE 58

Throughput — Rate of Many

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

whites whites whites colors colors colors sheets sheets sheets

time between fjnishes (0.83 h) 1 load 0.83h = 1.2 loads/h time between starts (0.83 h)

42

slide-59
SLIDE 59

Throughput — Rate of Many

Washer Dryer Folding Table

11:00 12:00 13:00 14:00

whites whites whites colors colors colors sheets sheets sheets

time between fjnishes (0.83 h) 1 load 0.83h = 1.2 loads/h time between starts (0.83 h)

42