ch 5 processor memory
play

Ch. 5: Processor + Memory December 12, 2008 Ch. 5: Processor + - PowerPoint PPT Presentation

Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Ch. 5: Processor + Memory December 12, 2008 Ch. 5: Processor + Memory Overview of Implementation Combinational Elements Sequential Logic


  1. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design S-R Latch Simplest memory element Output = stored value Change stored value: set-reset Unclocked Figure: S-R Latch Figure: Operation of the S-R Latch Ch. 5: Processor + Memory

  2. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design D Latch Output = stored value Stored value changes based on clock (enable) Figure: D Latch Operation Figure: D Latch Ch. 5: Processor + Memory

  3. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design D Latch Output = stored value Stored value changes based on clock (enable) Figure: D Latch Operation Figure: D Latch Functioning: C = 1 ⇒ Q = D C = 0 ⇒ Q = D previous Ch. 5: Processor + Memory

  4. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design D Flip-Flop Slightly more complicated than the latch Figure: D Flip-Flop and Latch Figure: D Flip-Flop Ch. 5: Processor + Memory

  5. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design D Flip-Flop Slightly more complicated than the latch Figure: D Flip-Flop and Latch Figure: D Flip-Flop Latch: state changes with change in input and clock being asserted ( = 1) Flip-flop: state changes only on clock rise Ch. 5: Processor + Memory

  6. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design D Flip-Flop Slightly more complicated than the latch Figure: D Flip-Flop and Latch Figure: D Flip-Flop Latch: state changes with change in input and clock being asserted ( = 1) Flip-flop: state changes only on clock rise not as transparent as latch Only flip-flops since using edge-triggered clocking Ch. 5: Processor + Memory

  7. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Registers Figure: Simple register made with flip-flop Ch. 5: Processor + Memory

  8. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Register File Design Set of registers Read / write by supplying register no. (and data) Uses D Flip-Flop as building block Ch. 5: Processor + Memory

  9. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Register File Design Set of registers Read / write by supplying register no. (and data) Uses D Flip-Flop as building block Figure: Register File Design 2 read ports, 1 write port Ch. 5: Processor + Memory

  10. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design MIPS Register File 32, 32-bit registers Figure: MIPS registers 5-bit read and write lines 32-bit data lines Ch. 5: Processor + Memory

  11. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Reading from Register Files Figure: Reading from RF - the lines Figure: Reading from RF - internals Ch. 5: Processor + Memory

  12. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Writing to Register Files Figure: Writing to RF - the lines Figure: Writing to RF - internals Ch. 5: Processor + Memory

  13. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Introduction Two technologies S tatic R andom A ccess M emory D ynamic R andom A ccess M emory both volatile Constructed from smaller chips Each chip has a configuration: 128M*1 : 128M addressable locations of 1-bit each 16M*8 : 16M addressable locations of 8-bit each Ch. 5: Processor + Memory

  14. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Memory Chip Design read / write: 8 bits wide 32K addressable locations Functioning: CS (Chip Select): 1 for r / w R = 0, W = 0 ⇒ chip not being accessed R = 0, W = 1 ⇒ write data in D in at Address location R = 1, W = 0 ⇒ read into D out the value from chip at location Address Figure: A 32K*8 RAM Ch. 5: Processor + Memory

  15. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design SRAM Structure Figure: Bsic Structural Design of 4X2 SRAM Chip Ch. 5: Processor + Memory

  16. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Outline Overview of Implementation 1 Two more details Combinational Elements 2 Sequential Logic Elements 3 Clock Latches and Flip Flops Register File Memory Design MIPS Processor Design 4 Pipelining Example: Load Instruction Ch. 5: Processor + Memory

  17. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Introduction Implementation of MIPS System Datapath : MIPS Processor + Memory also control unit Single cycle design : all instructions take one clock-cycle Ch. 5: Processor + Memory

  18. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Introduction Implementation of MIPS System Datapath : MIPS Processor + Memory also control unit Single cycle design : all instructions take one clock-cycle long clock period (accomodate slowest instruction) cannot reuse resources in a single cycle ⇒ duplication Ch. 5: Processor + Memory

  19. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Datapath Elements Figure: Elements used in MIPS Datapath Ch. 5: Processor + Memory

  20. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Edge-triggered Methodology Figure: Edge-triggered Methodology Ch. 5: Processor + Memory

  21. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Edge-triggered Methodology Figure: Edge-triggered Methodology Execution strategy: read content of a state element at beginning of clock cycle send values through a combinational element write result to a state element at end of clock cycle edge-triggered ⇒ read and write in same cycle Ch. 5: Processor + Memory

  22. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design PC Increment Figure: PC Increment Circuit Ch. 5: Processor + Memory

  23. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Datapath for R-type Instructions Ch. 5: Processor + Memory

  24. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Datapath for load / save Instructions Control signals: lw, sw : ALU control = 0010 (for address calculations) sw : Memread = 0, Memwrite = 1, Regwrite = 0 lw : Memread = 1, Memwrite = 0, Regwrite = 1 Ch. 5: Processor + Memory

  25. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Datapath for lw, sw and R-type Instructions Ch. 5: Processor + Memory

  26. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Datapath for beq Instruction Ch. 5: Processor + Memory

  27. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Datapath for R-type, lw / sw, beq Instructions Ch. 5: Processor + Memory

  28. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Datapath and Control Circuit Ch. 5: Processor + Memory

  29. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Control Signals and Opcode Figure: Control signals depend on the Opcode Ch. 5: Processor + Memory

  30. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Control Signal Generation Ch. 5: Processor + Memory

  31. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Datapath for R-type, lw / sw, beq, j Instructions Figure: The complete datapath Ch. 5: Processor + Memory

  32. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Control Circuit with Jump Included Ch. 5: Processor + Memory

  33. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design About Single-cycle design Ine ffi cient design Single-cycle design ⇒ CPI = ? Ch. 5: Processor + Memory

  34. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design About Single-cycle design Ine ffi cient design Single-cycle design ⇒ CPI = ? CPI = 1 Slowest instruction ≡ Longest possible machine path Ch. 5: Processor + Memory

  35. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design About Single-cycle design Ine ffi cient design Single-cycle design ⇒ CPI = ? CPI = 1 Slowest instruction ≡ Longest possible machine path the load instruction; uses 5 functional units: instruction memory register file ALU data memory register file Ch. 5: Processor + Memory

  36. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design About Single-cycle design Ine ffi cient design Single-cycle design ⇒ CPI = ? CPI = 1 Slowest instruction ≡ Longest possible machine path the load instruction; uses 5 functional units: instruction memory register file ALU data memory register file Fastest? Ch. 5: Processor + Memory

  37. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design About Single-cycle design Ine ffi cient design Single-cycle design ⇒ CPI = ? CPI = 1 Slowest instruction ≡ Longest possible machine path the load instruction; uses 5 functional units: instruction memory register file ALU data memory register file Fastest? probably jump Ch. 5: Processor + Memory

  38. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design About Single-cycle design Acceptable if fewer instructions Ch. 5: Processor + Memory

  39. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design About Single-cycle design Acceptable if fewer instructions used in older, simpler ISA implementations Ch. 5: Processor + Memory

  40. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design About Single-cycle design Acceptable if fewer instructions used in older, simpler ISA implementations terrible for ISA with complex instructions, such as floating point operations Ch. 5: Processor + Memory

  41. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design About Single-cycle design Acceptable if fewer instructions used in older, simpler ISA implementations terrible for ISA with complex instructions, such as floating point operations Dual problems: violates ”make the common-case faster” principle (performance) need to duplicate hardware (cost) Ch. 5: Processor + Memory

  42. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Improvements over Single-cycle Design Two ways to improve (performance and cost): multi-cycle design : some instructions run faster than others Ch. 5: Processor + Memory

  43. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Improvements over Single-cycle Design Two ways to improve (performance and cost): multi-cycle design : some instructions run faster than others Pipelining : Overlap execution of instructions Ch. 5: Processor + Memory

  44. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Ch. 5: Processor + Memory

  45. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Pipelining : Introduction Run multiple instructions in parallel Improves performance and hardware utilization similar to assembly line , laundry cleaning Ch. 5: Processor + Memory

  46. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Example of Pipelining Ch. 5: Processor + Memory

  47. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Introduction First: identify steps in instruction execution Ch. 5: Processor + Memory

  48. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Introduction First: identify steps in instruction execution Five steps in any MIPS instruction: Fetch instruction Read registers (while simultaneously decoding) Execute operation / calculate address Access data memory Write results to register Ch. 5: Processor + Memory

  49. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Execution Time Improvement with Pipelining Figure: Total time for each instruction Figure: Single-cycle non-pipelined execution Ch. 5: Processor + Memory

  50. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Execution Time Improvement with Pipelining Figure: Total time for each instruction Figure: Single-cycle non-pipelined execution Total execution time: 800 * 3 = 2400 ps Ch. 5: Processor + Memory

  51. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Execution Time Improvement with Pipelining Figure: Pipelined execution Total execution time: << 2400 ps Ch. 5: Processor + Memory

  52. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Pipelined Execution Clock cycle relates to single operation, rather than an instruction Accomodate the slowest operation : 200 ps Read and write to register can happen in di ff erent halves of same cycle Ch. 5: Processor + Memory

  53. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Pipelining the Datapath Figure: Datapath without pipelining Data flows left-to-right through stages, except write to register and write to PC does not a ff ect current instruction Ch. 5: Processor + Memory

  54. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Instruction Execution in Pipeline Figure: Instruction execution in single-cycle datapath with pipeline Virtually every instruction has its own datapath, but staggered Ch. 5: Processor + Memory

  55. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Pipelinig the Datapath Need to store data for an instruction as it passes through the datapath for e.g., the value read from IM must be stored so it’s available for later stages ⇒ add registers at every stage Each instruction advances to next stage on clock cycle Ch. 5: Processor + Memory

  56. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Pipelining the Datapath Figure: Pipelined Datapath Ch. 5: Processor + Memory

  57. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Ch. 5: Processor + Memory

  58. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design First Stage Figure: Instruction Fetch Ch. 5: Processor + Memory

  59. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design First Stage Figure: Instruction Fetch Fetch instruction; Increment PC (save in IF / ID register also) Ch. 5: Processor + Memory

  60. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Second Stage Figure: Instruction decode and register read Ch. 5: Processor + Memory

  61. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Second Stage Figure: Instruction decode and register read Store in ID / EX registers: Incremented PC address 2 register values sign extended o ff set Ch. 5: Processor + Memory

  62. Overview of Implementation Combinational Elements Sequential Logic Elements MIPS Processor Design Third Stage Figure: Execute or Address Calculation Ch. 5: Processor + Memory

Recommend


More recommend