<s>
In-circuit	B-Application
emulation	I-Application
(	O
ICE	O
)	O
is	O
the	O
use	O
of	O
a	O
hardware	O
device	O
or	O
in-circuit	B-Application
emulator	I-Application
used	O
to	O
debug	O
the	O
software	O
of	O
an	O
embedded	B-Architecture
system	I-Architecture
.	O
</s>
<s>
It	O
was	O
historically	O
in	O
the	O
form	O
of	O
bond-out	B-Application
processor	I-Application
which	O
has	O
many	O
internal	O
signals	O
brought	O
out	O
for	O
the	O
purpose	O
of	O
debugging	O
.	O
</s>
<s>
More	O
recently	O
the	O
term	O
also	O
covers	O
JTAG-based	O
hardware	O
debuggers	B-Application
which	O
provide	O
equivalent	O
access	O
using	O
on-chip	O
debugging	O
hardware	O
with	O
standard	O
production	O
chips	O
.	O
</s>
<s>
In	O
this	O
common	O
case	O
,	O
the	O
in-circuit	B-Application
emulator	I-Application
term	O
is	O
a	O
misnomer	O
,	O
sometimes	O
confusingly	O
so	O
,	O
because	O
emulation	O
is	O
no	O
longer	O
involved	O
.	O
</s>
<s>
Embedded	B-Architecture
systems	I-Architecture
present	O
special	O
problems	O
for	O
programmers	O
because	O
they	O
usually	O
lack	O
keyboards	B-Device
,	O
monitors	B-Device
,	O
disk	B-Device
drives	I-Device
and	O
other	O
user	B-Application
interfaces	I-Application
that	O
are	O
present	O
on	O
computers	O
.	O
</s>
<s>
These	O
shortcomings	O
make	O
in-circuit	O
software	O
debugging	B-Application
tools	I-Application
essential	O
for	O
many	O
common	O
development	O
tasks	O
.	O
</s>
<s>
An	O
in-circuit	B-Application
emulator	I-Application
(	O
ICE	O
)	O
provides	O
a	O
window	O
into	O
the	O
embedded	B-Architecture
system	I-Architecture
.	O
</s>
<s>
The	O
programmer	O
uses	O
the	O
emulator	O
to	O
load	O
programs	O
into	O
the	O
embedded	B-Architecture
system	I-Architecture
,	O
run	O
them	O
,	O
step	O
through	O
them	O
slowly	O
,	O
and	O
view	O
and	O
change	O
data	O
used	O
by	O
the	O
system	O
's	O
software	O
.	O
</s>
<s>
An	O
emulator	O
gets	O
its	O
name	O
because	O
it	O
emulates	O
(	O
imitates	O
)	O
the	O
central	B-General_Concept
processing	I-General_Concept
unit	I-General_Concept
(	O
CPU	O
)	O
of	O
the	O
embedded	B-Architecture
system	I-Architecture
's	O
computer	O
.	O
</s>
<s>
ICEs	O
attach	O
a	O
computer	B-General_Concept
terminal	I-General_Concept
or	O
personal	B-Device
computer	I-Device
(	O
PC	O
)	O
to	O
the	O
embedded	B-Architecture
system	I-Architecture
.	O
</s>
<s>
The	O
terminal	O
or	O
PC	O
provides	O
an	O
interactive	O
user	B-Application
interface	I-Application
for	O
the	O
programmer	O
to	O
investigate	O
and	O
control	O
the	O
embedded	B-Architecture
system	I-Architecture
.	O
</s>
<s>
For	O
example	O
,	O
it	O
is	O
routine	O
to	O
have	O
a	O
source	O
code	O
level	O
debugger	B-Application
with	O
a	O
graphical	O
windowing	O
interface	O
that	O
communicates	O
through	O
a	O
JTAG	O
adapter	O
(	O
emulator	O
)	O
to	O
an	O
embedded	O
target	O
system	O
which	O
has	O
no	O
graphical	O
user	B-Application
interface	I-Application
.	O
</s>
<s>
Notably	O
,	O
when	O
their	O
program	O
fails	O
,	O
most	O
embedded	B-Architecture
systems	I-Architecture
simply	O
become	O
bricked	O
.	O
</s>
<s>
Embedded	B-Architecture
systems	I-Architecture
often	O
lack	O
basic	O
functions	O
to	O
detect	O
signs	O
of	O
software	B-Error_Name
failure	I-Error_Name
,	O
such	O
as	O
a	O
memory	B-General_Concept
management	I-General_Concept
unit	I-General_Concept
(	O
MMU	O
)	O
to	O
catch	O
memory	O
access	O
errors	O
.	O
</s>
<s>
Without	O
an	O
ICE	O
,	O
the	O
development	O
of	O
embedded	B-Architecture
systems	I-Architecture
can	O
be	O
extremely	O
difficult	O
,	O
because	O
there	O
is	O
usually	O
no	O
way	O
to	O
tell	O
what	O
went	O
wrong	O
.	O
</s>
<s>
Most	O
modern	O
microcontrollers	B-Architecture
use	O
resources	O
provided	O
on	O
the	O
manufactured	O
version	O
of	O
the	O
microcontroller	B-Architecture
for	O
device	O
programming	O
,	O
emulating	O
,	O
and	O
debugging	O
features	O
,	O
instead	O
of	O
needing	O
another	O
special	O
emulation-version	O
(	O
that	O
is	O
,	O
bond-out	O
)	O
of	O
the	O
target	O
microcontroller	B-Architecture
.	O
</s>
<s>
Even	O
though	O
it	O
is	O
a	O
cost-effective	O
method	O
,	O
since	O
the	O
ICE	O
unit	O
only	O
manages	O
the	O
emulation	O
instead	O
of	O
actually	O
emulating	O
the	O
target	O
microcontroller	B-Architecture
,	O
trade-offs	O
must	O
be	O
made	O
to	O
keep	O
prices	O
low	O
at	O
manufacture	O
time	O
,	O
yet	O
provide	O
enough	O
emulation	O
features	O
for	O
the	O
(	O
relatively	O
few	O
)	O
emulation	O
applications	O
.	O
</s>
<s>
Virtually	O
all	O
embedded	B-Architecture
systems	I-Architecture
have	O
a	O
hardware	O
element	O
and	O
a	O
software	O
element	O
,	O
which	O
are	O
separate	O
but	O
tightly	O
interdependent	O
.	O
</s>
<s>
A	O
pin	B-Protocol
header	I-Protocol
and	O
cable	O
assembly	O
connects	O
the	O
adaptor	O
to	O
a	O
socket	O
where	O
the	O
actual	O
central	B-General_Concept
processing	I-General_Concept
unit	I-General_Concept
(	O
CPU	O
)	O
or	O
microcontroller	B-Architecture
mounts	O
within	O
the	O
embedded	B-Architecture
system	I-Architecture
.	O
</s>
<s>
Recent	O
ICEs	O
enable	O
programmers	O
to	O
access	O
the	O
on-chip	O
debug	O
circuit	O
that	O
is	O
integrated	O
into	O
the	O
CPU	O
via	O
JTAG	O
or	O
background	B-Application
debug	I-Application
mode	I-Application
interface	I-Application
(	O
BDM	O
)	O
to	O
debug	O
the	O
software	O
of	O
an	O
embedded	B-Architecture
system	I-Architecture
.	O
</s>
<s>
They	O
are	O
sometimes	O
called	O
in-circuit	B-Application
debuggers	I-Application
or	O
ICDs	O
,	O
to	O
distinguish	O
the	O
fact	O
that	O
they	O
do	O
not	O
replicate	O
the	O
functionality	O
of	O
the	O
CPU	O
,	O
but	O
instead	O
control	O
an	O
already	O
existing	O
,	O
standard	O
CPU	O
.	O
</s>
<s>
In	O
the	O
context	O
of	O
embedded	B-Architecture
systems	I-Architecture
,	O
the	O
ICE	O
is	O
not	O
emulating	O
hardware	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
Linux	B-Application
PC	O
might	O
be	O
used	O
to	O
develop	O
software	O
for	O
a	O
system	O
using	O
a	O
Freescale	B-Device
68HC11	I-Device
chip	O
,	O
a	O
processor	O
that	O
cannot	O
run	O
Linux	B-Application
.	O
</s>
<s>
The	O
programmer	O
usually	O
edits	O
and	O
compiles	O
the	O
embedded	B-Architecture
system	I-Architecture
's	O
code	O
on	O
the	O
host	O
system	O
,	O
as	O
well	O
.	O
</s>
<s>
The	O
host	O
system	O
will	O
have	O
special	O
compilers	O
that	O
produce	O
executable	O
code	O
for	O
the	O
embedded	B-Architecture
system	I-Architecture
,	O
termed	O
cross	B-Application
compilers	I-Application
or	O
cross	O
assemblers	B-Application
.	O
</s>
<s>
On-chip	O
debugging	O
is	O
an	O
alternative	O
to	O
in-circuit	B-Application
emulation	I-Application
.	O
</s>
<s>
To	O
support	O
in-circuit	B-Application
emulator	I-Application
(	O
ICE	O
)	O
debugging	O
on	O
Intel	B-General_Concept
286	I-General_Concept
,	O
five	O
additional	O
pins	O
were	O
available	O
on	O
the	O
processor	O
:	O
one	O
input	O
pin	O
to	O
externally	O
force	O
an	O
ICE	O
breakpoint	O
,	O
(	O
ICEBP#	O
)	O
and	O
two	O
alternative	O
pairs	O
of	O
output	O
pins	O
to	O
select	O
operations	O
via	O
the	O
ICE-bus	O
instead	O
of	O
user	O
memory	O
.	O
</s>
<s>
On	O
the	O
80286	B-General_Concept
two	O
instructions	O
(	O
0F	O
04	O
,	O
0F	B-Device
05	I-Device
)	O
exist	O
to	O
dump/restore	O
the	O
complete	O
CPU	O
state	O
to	O
memory	O
offset	O
0x800	O
,	O
along	O
with	O
a	O
single-byte	O
override	O
prefix	O
(	O
F1	O
)	O
to	O
enable	O
ICE-mode	O
to	O
access	O
user-memory	O
.	O
</s>
