Interlock and stall in CPU design?

Discussion in 'VHDL' started by Davy, Jan 11, 2007.

  1. Davy

    Davy Guest

    Hi all,

    I am new to CPU design and confused with two CPU term. That is
    interlock and stall. What's their difference? Does interlock and stall
    all do insert NOP and remove the data dependency?

    I have copied a sentence from a CPU document "The interlock is
    responsible for detecting read-after-write hazards and stalling the
    pipeline until the hazard has been resolved. This avoids the need to
    insert nop directives between dependent instructions, thus keeping code
    size to a minimum, as well as simplifying assembler-level programming."

    Best regards,
    Davy
     
    Davy, Jan 11, 2007
    #1
    1. Advertising

  2. Davy

    Jon Beniston Guest

    Hi,

    > I am new to CPU design and confused with two CPU term. That is
    > interlock and stall. What's their difference? Does interlock and stall
    > all do insert NOP and remove the data dependency?
    >
    > I have copied a sentence from a CPU document "The interlock is
    > responsible for detecting read-after-write hazards and stalling the
    > pipeline until the hazard has been resolved. This avoids the need to
    > insert nop directives between dependent instructions, thus keeping code
    > size to a minimum, as well as simplifying assembler-level programming."


    In this use, interlock is refering the logic that tracks dependencies
    between instructions, and then stalls (pauses the pipeline from the
    decode stage backwards) when a dependency is detected that cannot be
    resolved by bypassing.

    There are other causes of stall that are not related to the interlock,
    such as stalls that occur on cache misses.

    Cheers,
    Jon
     
    Jon Beniston, Jan 11, 2007
    #2
    1. Advertising

  3. Davy

    Ben Jones Guest

    Hi Davy,

    "Davy" <> wrote in message
    news:...
    > Hi all,
    >
    > I am new to CPU design and confused with two CPU term. That is
    > interlock and stall. What's their difference? Does interlock and stall
    > all do insert NOP and remove the data dependency?


    The data dependency is a property of the program being executed, and is
    never "removed" except by maybe changing the program.

    In a machine where each instruction completes before the following
    instruction starts, data dependencies don't cause any problems. However,
    when a machine is pipelined, data dependencies and anti-dependencies can
    lead to "hazards".

    An interlock circuit detects these hazards. An interlock circuit may stall
    one or more stages of the processor pipeline, often introducing a NOP-like
    "bubble", to avoid the hazard and ensure correct program execution.

    Note that there are other ways to manage hazards that do not involve an
    interlock circuit, and that stalling the processor is only the simplest,
    most basic way to avoid hazards. You may wish to read Hennessy and Patterson
    for a proper description of more advanced techniques.

    Cheers,

    -Ben-
     
    Ben Jones, Jan 11, 2007
    #3
  4. Hi Davy,
    Interlock in this case refers to 'dependencies solver'. It might be a
    simple stall logic or could be register renaming logic
     
    JoshforRefugee, Jan 11, 2007
    #4
  5. Davy

    Yao Qi Guest

    "Davy" <> writes:

    > Hi all,
    >
    > I am new to CPU design and confused with two CPU term. That is
    > interlock and stall. What's their difference? Does interlock and stall
    > all do insert NOP and remove the data dependency?


    I am not a CPU guru, and here are some my cents. Hope they are useful.

    1. "stall" is a term for pipeline, and "interlock" is a method to
    "stall" pipeline.

    2. Both interlock and stall DO NOT insert NOP. It is the work done by
    compiler. Compiler could insert some NOPs in executable to avoid data hazard.
    >
    > I have copied a sentence from a CPU document "The interlock is
    > responsible for detecting read-after-write hazards and stalling the
    > pipeline until the hazard has been resolved. This avoids the need to
    > insert nop directives between dependent instructions, thus keeping code
    > size to a minimum, as well as simplifying assembler-level
    > programming."


    Interlock logic could lock the pipeline when data hazard is detected to
    make sure the right result. So, compiler or assembler do not insert
    NOPs to avoid hazard, so that code size is minimized.

    >
    > Best regards,
    > Davy
    >


    --
    Yao Qi
    GNU/Linux Developer
     
    Yao Qi, Jan 11, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John

    Book on CPU Design

    John, Jun 29, 2003, in forum: VHDL
    Replies:
    3
    Views:
    13,492
    john jakson
    Jul 5, 2003
  2. George Addison

    Unbelievable site stall...

    George Addison, Nov 19, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    378
    Munsifali Rashid
    Nov 20, 2003
  3. Sharon11

    Stall image loading

    Sharon11, Jun 30, 2007, in forum: HTML
    Replies:
    2
    Views:
    393
    dorayme
    Jun 30, 2007
  4. pavunkumar

    How , system cpu and user cpu times calculates

    pavunkumar, Feb 27, 2009, in forum: C Programming
    Replies:
    1
    Views:
    369
  5. Roy Smith

    Debugging thread stall

    Roy Smith, Nov 27, 2009, in forum: Python
    Replies:
    2
    Views:
    629
    Chandrakant Silver
    Nov 27, 2009
Loading...

Share This Page