【正文】
bBch : pValC。amp。 We will not discuss the detail of Bcond ? Though it is also a control unit – 18 – Processor Memory Logic Memory ? Reads or writes memory word Control Logic ? Mem. read: should word be read? ? Mem. write: should word be written? ? Mem. addr.: Select address ? Mem. data.: Select data D atam em oryD atam em oryM em .readM emaddrr e a dw r i ted a ta o u tM emda t av al Ev al Mv al A v al PM em .w rit ed a ta inicod e– 19 – Processor Memory Address OPl rA, rB Memory rmmovl rA, D(rB) popl rA jXX Dest call Dest ret No operation M4[valE] ? valA Memory Write value to memory valM ? M4[valA] Memory Read from stack M4[valE] ? valP Memory Write return value on stack valM ? M4[valA] Memory Read return address Memory No operation int mem_addr = [ icode in { IRMMOVL, IPUSHL, ICALL, IMRMOVL } : valE。 icode in { ICALL, IPUSHL } : 4。t need register ]。– 1 – Processor SEQ CPU Implementation – 2 – Processor What we will discuss today? The implementation of a sequential CPU SEQ ? Every Instruction finished in one cycle. ? Instruction executes in sequential ? No two instruction execute in parallel or overlap An revised version of SEQ SEQ+ ? Modify the PC Update stage of SEQ ? to show the difference between ISA and implementation – 3 – Processor Some Macros Name Value Meaning INOP 0 Code for nop instruction IHALT 1 Code for halt instruction IRRMOVL 2 Code for rrmovl instruction IIRMOVL 3 Code for irmovl instruction IRMMOVL 4 Code for rmmovl instruction IMRMOVL 5 Code for mrmovl instruction IOPL 6 Code for integer op instructions IJXX 7 Code for jump instructions ………… …… …………………………… IPOPL B Code for popl instruction RESP RENONE 6 8 Register ID for %esp Indicates no register file access ALUADD 0 Function for addition operation – 4 – Processor Instruction memory Instruction PC increment increment CC CC ALU ALU Data memory Data memory Fetch Decode Execute Memory Write back icode , ifun rA , rB valCRegister file fi A B M E Register file A B E PC valP srcA , srcB dstA , dstB valA , valB aluA , aluB Bch valE Addr , Data valM PC valE , newPC valM – 5 –