Back Lectures
Advancements in pipelining

Superscalar pipelining
  Two or more of the part of the data path that causes a bottle neck

  Usually the portions of the aritmetic logic unit.

  Often not identical circuits
    Integer math

    Floating point math
 
  Hepful if compiler arranges code to minimize contention.

Multi-core
  Core (datapath, control support, level 1 cache) duplicated.
  Level 2 cache, and address and data bus interface shared.

  Parallelism of specific tasks require special programming techniques.

General problems with pipelining

Competition for same circuits  (Structural hazard)
  Such as Memory address register or data buffer register
    Ex : Fetching operands of 1st instruction while fetching opcode of 2nd.
   
Dependancy  (Data hazard)
  Add B to A
  Copy A to C

  Add must complete before copy to be valid.
  
  Possible Solutions : 
    insert nop (no operations) to add time.

    run the next instruction if not dependent on these (out of order).

Branching (Branch hazard)
  Compare A to B
  Branch to "here" if less than x
  Set A to zero
  ...
  here: Increment A

  Branch calcuatons may not be complete before next instruction processed. 

     Invalid data or work because next instruction inproperly executed.

     Pipeline full of incorrect leg of branch.     

  Possible Solutions : 

  Compile time :
    Interleave other instructions not involved with branch situation.

    Insert nop (no operations) to add time. 
      More common in RISC where all instructions are fairly simple.

    Rewrite test to favor linear (sequential) branch.
      More used code not in branch block of code.

  Runtime :
    Dynamically analyze and predict preferred branch (run time)
      Ex. setting a flag bit in the opcode if branch is taken.
      And assume same choice more likely the next time branch is encountered.

    Pre-cache both branches (as separate tasks) and discard one not taken.
      Requires additional circuitry.
       (Any time the circuitry of a system increases, its response time will
        slow slightly).