1 / 9

Controllers and Datapaths

Controllers and Datapaths. CS 153, Spring 2007 Ian G. Harris Department of Computer Science University of California Irvine. load. Control bits. Register. reset. Datapath. Controller. Status bits. Implementing Complex Behaviors.

chesna
Télécharger la présentation

Controllers and Datapaths

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Controllers and Datapaths CS 153, Spring 2007 Ian G. Harris Department of Computer Science University of California Irvine

  2. load Control bits Register reset Datapath Controller Status bits Implementing Complex Behaviors • A Datapath is needed to perform arithmetic/boolean operations on data • +, -, *, /, mod, AND, OR, <<, <, >>, >, etc. • A Controller is needed to tell datapath components what to do and when to do it • Status information from the datapath may be needed • A controller drives the control inputs of the datapath components • load, reset, shiftleft, ALUOp, etc.

  3. in1 in2 ldA ldB load load load load load D D D D D Reg B Reg A Reg C Reg E Reg D + Q Q Q Q Q ldC ldD ldA=1 ldC=1 ldB=1 ldD=1 + ldE ldE=1 Simple Controller/Datapath in3 A = in1; B = in2; D = in3; C = A + B; E = C + D; Controller Datapath Behavior • One-to-one mapping from behavior to datapath components • var-reg, op-op

  4. ldA=1 ldB=1 ldD=1 ldC=1 ldE=1 ldA=1 ldC=1 ldB=1 ldD=1 ldE=1 Alternate Controller, Same Datapath A = in1; B = in2; D = in3; C = A + B; E = C + D; Behavior Optimized Controller Controller • Optimize performance by merging many operations into one state • Merging continues until a data dependency (or conditional) is reached

  5. Reg D ld ld ld ld ld Reg B Reg A Reg C Reg E Algorithm to Make Datapath and Controller • Determine all datapath components needed by looking at each step of the behavior • Assume no hardware sharing • 5 Registers - one for each variable • 2 adders - one for each addition A = in1; B = in2; D = in3; C = A + B; E = C + D; + +

  6. ldA ldB + Reg D ld ld ld ld ld ldC Reg B ldD Reg A Reg C + Reg E ldE Datapath/Controller Algorithm Continued • 2. Connect datapath components by identifying connections needed for each step in the behavior. • Be sure to label control inputs, status outputs in1 in2 in3 A = in1; B = in2; D = in3; C = A + B; E = C + D;

  7. A = B + C; If (A > 2) then X = Y + Z; Else P = Q + R; Result = X + P; A = in1; B = in2; D = in3; C = A + B; E = C + D; Datapath/Controller Algorithm Controller Definition • 3. Group steps of the behavior into states • Pack as many steps as possible into a state • No data dependency can exist in a state • No conditional can exist in a state - all ops in state MUST occur together st1 st2 st3 No conditional With Conditional

  8. A = B + C; If (A > 2) then X = Y + Z; Else P = Q + R; Result = X + P; A = in1; B = in2; D = in3; C = A + B; E = C + D; Controller Definition Continued 4. Draw FSM edges based on control flow A>2 !A>2 No conditional With Conditional

  9. A = in1; B = in2; D = in3; C = A + B; E = C + D; Controller Definition Continued 5. Label controller states with outputs ldA=1 ldB=1 ldD=1 ldC=1 ldE=1

More Related