sequential design

12
Sequential Design ללללל10

Upload: lula

Post on 12-Jan-2016

44 views

Category:

Documents


0 download

DESCRIPTION

Sequential Design. תרגול 10. Y86 Processor Simulator. The Computer Simulation of a Central Processing Unit Based on the Intel IA32, or X86, Instruction Set. Byte. 0. 1. 2. 3. 4. 5. nop. 0. 0. addl. 6. 0. halt. 1. 0. subl. 6. 1. rrmovl rA , rB. 2. 0. rA. rB. andl. 6. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Sequential Design

Sequential Design

10תרגול

Page 2: Sequential Design

Y86 Processor Simulator

The Computer Simulation of a Central Processing Unit Based on the Intel IA32, or X86, Instruction Set.

תמר שרוט, נועם חזון 2

Page 3: Sequential Design

Y86 Instruction SetByte 0 1 2 3 4 5

pushl rA A 0 rA 8

jXX Dest 7 fn Dest

popl rA B 0 rA 8

call Dest 8 0 Dest

rrmovl rA, rB 2 0 rA rB

irmovl V, rB 3 0 8 rB V

rmmovl rA, D(rB) 4 0 rA rB D

mrmovl D(rB), rA 5 0 rA rB D

OPl rA, rB 6 fn rA rB

ret 9 0

nop 0 0

halt 1 0

addl 6 0

subl 6 1

andl 6 2

xorl 6 3

jmp 7 0

jle 7 1

jl 7 2

je 7 3

jne 7 4

jge 7 5

jg 7 6

Page 4: Sequential Design

4

Tracing the execution of SEQ

Page 5: Sequential Design

Six Stages Fetch - Reads the command bytes from memory using the PC. Extracts icode

and ifun and if needed fills rA, rB and valC. Also calculates valP = length(instruction) + PC.

Decode - Reads two values from registers and inserts them into valA and valB.

Execute - According to the ifun either the ALU executes the command or calculates the new stack pointer. The result will be put into valE. For a jump instruction checks condition codes and branch conditions.

Memory - Reads or writes from memory. The value will be put into ValM.

Write Back - Writes up to two results into the registers.

PC Update - Now updates the PC for the next command.

5

Page 6: Sequential Design

6

subl, line 3

Page 7: Sequential Design

7

irmovl, line 4

Page 8: Sequential Design

pushl, line 6

Page 9: Sequential Design

popl, line 7

Page 10: Sequential Design

SEQ Hardware Key

Blue boxes:

predesigned hardware blocks E.g., memories, ALU

Gray boxes:

control logic Describe in HCL

White ovals: labels for signals

Thick lines:

32-bit word values Thin lines:

4-8 bit values Dotted lines:

1-bit values

Instructionmemory

Instructionmemory

PCincrement

PCincrement

CCCC ALUALU

Datamemory

Datamemory

NewPC

rB

dstE dstM

ALUA

ALUB

Mem.control

Addr

srcA srcB

read

write

ALUfun.

Fetch

Decode

Execute

Memory

Write back

data out

Registerfile

Registerfile

A BM

E

Registerfile

Registerfile

A BM

E

Bch

dstE dstM srcA srcB

icode ifun rA

PC

valC valP

valBvalA

Data

valE

valM

PC

newPC

Page 11: Sequential Design

11

Is this equivalent to our tables? Explicit control over sequencing,

PC CC Date memory Register file

The key idea: The processor never needs to read back the state updated by an instruction in order to complete the processing of this instruction!

Examples: Pushl does not use the updated %esp No operation set and read the Condition Codes

Page 12: Sequential Design

12

Handling ambiguities What is the result of pushl %esp?

What is the result of popl %esp?

Which port will get priority in popl?