Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Interlock and stall in CPU design?

 
Thread Tools Search this Thread
Old 01-11-2007, 09:35 AM   #1
Default Interlock and stall in CPU design?


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
  Reply With Quote
Old 01-11-2007, 11:09 AM   #2
Jon Beniston
 
Posts: n/a
Default Re: Interlock and stall in CPU design?
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
  Reply With Quote
Old 01-11-2007, 01:00 PM   #3
Ben Jones
 
Posts: n/a
Default Re: Interlock and stall in CPU design?
Hi Davy,

"Davy" <> wrote in message
news: oups.com...
> 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
  Reply With Quote
Old 01-11-2007, 01:12 PM   #4
JoshforRefugee
 
Posts: n/a
Default Re: Interlock and stall in CPU design?
Hi Davy,
Interlock in this case refers to 'dependencies solver'. It might be a
simple stall logic or could be register renaming logic



JoshforRefugee
  Reply With Quote
Old 01-11-2007, 02:01 PM   #5
Yao Qi
 
Posts: n/a
Default Re: Interlock and stall in CPU design?
"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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46