April 10, 1997
Logic
analyzers stamping out bugs at the
cutting edge
DAN STRASSBERG, SENIOR TECHNICAL EDITOR
Once just a hardware engineer's tool, logic
analyzers now aid a more diverse group of users. The
instruments also cope with formidable technical
challenges to their own design--the result of growing
speed and hardware complexity in the circuits under test.
As clock
rates increase and complex µP cores embedded deep within
million-plus-gate ASICs become commonplace, figuring out
what really goes on inside state-of-the-art digital
circuits becomes more difficult. For designers of
instruments such as logic analyzers, creating test
equipment that can indicate how today's leading-edge
digital circuits behave is an enormous challenge. But
that's only one side of the story on logic analysis in
1997. Other test-equipment designers, also working on
logic analyzers, must grapple with much different but,
arguably, equally challenging requirements.
The goal of this second
group of instrument designers is to provide tools for the
many EEs who use--or could use--logic analyzers to
develop standard-technology products. Many such EEs
consider logic analyzers hard to use and simply avoid
them in favor of oscilloscopes, which are best suited
only to an ancillary role in logic analysis. Most
standard-technology products run at clock rates lower
than 50 MHz and don't use core-based ASICs. Engineers who
design these products need rugged, low-cost, easy-to-use
instruments. Instruments targeted at these engineers must
show the skeptics that logic analyzers improve
productivity.
Test-equipment designers
are enjoying success with both user groups. Certainly,
the high-performance tools are more glamorous, but the
lower cost, workhorse instruments may actually affect the
work habits of a larger number of instrument users.
More distinctions
Many other important
distinctions exist between high- and low-end
logic-analysis tools. The development teams that use
high-end tools are usually fairly large. On complex
embedded-system projects, teams typically range from five
to 15 members. According to Hewlett-Packard and
Tektronix, such teams on average include five software
engineers for each hardware engineer. In nearly all
cases, the developers write high-level-language
code--usually in C or C++.
High-performance-system
teams are fairly large, and many of the developers are
software engineers who are somewhat uncomfortable dealing
directly with hardware. Therefore, debugging tools for
this group emphasize networking and connectivity. Many
high-performance logic analyzers attach directly to
networks via connections that conform to the Transmission
Control Protocol/Internet-Protocol (TCP/IP) standard. The
logic analyzer is in a lab with the target hardware; the
users usually sit at workstations in cubicles hundreds of
feet or even thousands of miles away from the logic
analyzers. Although remote users can't move probes,
networking allows these users to do most things that
someone next to the logic analyzer could do.
According to a study that
HP commissioned, users of low-end tools tend to be
smaller teams or even individuals. Some of the systems
under development are not microprocessor-based but
consist of special-purpose logic. Such products don't
qualify as embedded systems; to be called by that name, a
product must include at least one µP. Many other systems
use 8- or even 4-bit µPs. The engineers frequently have
hardware backgrounds, although many are adept at software
design. Usually, such engineers are comfortable writing
assembly-language code and are more likely to write in
assembly language than are developers on larger projects.
Another characteristic of
this market segment is a frequent concentration on
electromechanical systems. Such applications involve
signals that are relatively low in frequency, especially
when compared with signals you encounter in
communications and multimedia applications. Understanding
the behavior of electromechanical systems often involves
capturing long data records (several seconds or even
several tens of seconds).
Long records are not
restricted to electromechanical systems, though. An
increasing number of logic-analysis problems in
high-performance systems also require deep memory.
Fortunately (and not altogether coincidentally),
declining memory cost is bringing the cost of the needed
record length within reach. (See box, "Logic-analyzer specs: some
things to look out for.")
The first logic analyzers
were timing analyzers--essentially DSOs with large
numbers of channels and displays capable of showing only
high and low logic levels. In contrast, most DSOs
digitize analog waveforms into 256 levels. To be useful,
a timing analyzer must trigger on combinations of signals
and sequences of events that you hope relate to the
problem you are troubleshooting.
Triggering is usually the
mission of a state machine, which receives inputs from a
group of pattern-recognition circuits (in essence, AND
gates). Each gate looks at the logic levels on multiple
signal lines. To define a qualifying event, you specify
which lines must be high, which must be low, and which
don't matter. A qualifying event moves the state machine
to its next state but only if the event occurs when
you've told the state machine to look for events of that
type. After a predetermined event sequence, the state
machine enters its last state and triggers data
acquisition. Many logic analyzers' state machines let you
define trigger sequences that comprise 16 or more events,
or levels.
Although oscilloscope
trigger circuits have become more sophisticated in recent
years, logic-analyzer trigger circuits remain more
complex in some ways. Generally, logic-analyzer trigger
circuits accept a larger number of inputs and allow you
to define longer sequences of events that must occur
before triggering takes place. (See box, "Scopes and logic analyzers.")
Different ways to view
data
As digital electronics
grew in complexity, designers demanded an alternative to
timing diagrams for viewing circuit behavior. Timing
diagrams depict two-state data as simulated waveforms on
multiple signal lines as a function of time, with time
progressing linearly from left to right. An alternative
is a state display, which presents binary data as 1s and
0s or as hexadecimal quantities. Each state appears on a
separate line, with time usually running from the top to
the bottom of the display. Because systems generally do
not spend equal time in different states, the time scale
of state displays is inexplicit and usually nonlinear.
Originally, state and
timing analyzers were separate instruments. But the value
of one instrument that presented both types of displays
quickly became apparent, and combination state/timing
analyzers soon became available. The original
state/timing analyzers did not particularly well
integrate their two functions, though. For example, these
instruments required separate probes for the two types of
displays. Sometimes, using separate probes is
advantageous (for example, when you probe different pins
for state and timing data). Usually, though, acquiring
both types of data through one set of probes is
desirable. (See box, "Probing--difficult and
getting worse.")
Even when an analyzer can
acquire state and timing information through one set of
probes, the analyzer often can't simultaneously acquire
both types of data. Customarily, you must select either
the state or the timing mode. However, some recently
introduced analyzers let you choose the display mode
after they have acquired the data. (See box "Combining PCs and logic
analyzers: two approaches.") With such an analyzer, you
can display the same captured information in either
format and switch back and forth between display formats
to better grasp the data's meaning.
More meaningful than
numbers
As µPs grew in
importance, coding in binary, octal, and hexadecimal
values quickly gave way to coding in assembly language.
In assembly language, meaningful names (mnemonics)
represent instructions or operation codes (opcodes). A
state display that traces program execution using opcode
mnemonics is much more intelligible than is one that uses
numbers. To provide assembly-language displays,
logic-analyzer vendors added accessory software tools
called "disassemblers" (or, as HP calls them,
"inverse assemblers"). A disassembler converts
data flowing to and from the µP's memory into opcode
mnemonics. Processor-specific pods usually accompany
disassemblers.
The pods facilitate
connection to µPs and perform functions such as grouping
of related signals onto adjacent logic-analyzer inputs.
Such pods either clamp over the µP on the target board
or plug in in place of the µP and provide a duplicate
µP socket. Even if a µP's address bus does not appear
on sequential pins on the IC, the pod rearranges the
signals so that the bus appears on sequentially numbered
analyzer channels. The analyzer then displays the signals
in a way that is easier to interpret than it would be if
the signals were arranged as they are on the IC.
Gradually, most
µP-based-system developers outgrew assembly language.
Programmers needed languages that were more abstract than
is assembly, which is tightly linked to the µP hardware.
The combination of higher levels of abstraction, more
complex languages, and much more powerful processors
created and is still creating challenges for
logic-analyzer designers.
For example, modern µPs
fetch more instructions from memory than the µPs
execute. Tracing program flow is easier if you don't have
to look at long lists of instructions that the µP didn't
execute. The problem is that when the µP decides whether
to execute an instruction, the instruction already
resides in cache memory within the µP chip. The
logic-analyzer software tools or hardware you use with
the analyzer must determine which instructions did not
execute and exclude them from the program-execution
record (trace).
Logic analyzers vs ICEs
While logic analyzers were
evolving, a related tool, the in-circuit emulator (ICE),
came on the scene. Since ICEs emerged, they have vied
with logic analyzers for supremacy among hardware-based
debugging tools for µP-based systems. ICEs' claim to
fame is that they allow you not merely to observe the
target system's behavior, but also to control
target-system behavior in real time. To use a classic
logic analyzer to control a µP, you must augment the
logic analyzer with additional tools. Generally, even
with those additional tools, the logic analyzer cannot
control the target in real time the way an ICE can.
When you must debug
critical timing-sensitive hardware-software interactions
(usually one of the last steps in debugging), tools that
consist mainly or entirely of software are inappropriate.
At this point, you need a hardware-based debugging tool.
Digital-hardware engineers have historically turned first
to logic analyzers, whereas software engineers have used
ICEs. However, ICEs' strength--the intimacy with which
they interact with the target hardware--can also become
an Achilles' heel.
Over the years, ICE
designers have solved the problems of keeping up with
faster µPs. A half-dozen years ago, working with a
processor clocked at 16 MHz was considered next to
impossible. Now, ICE designers consider 16 MHz and even
33 MHz a piece of cake. For more than a decade, ICE
designers have shrugged off assertions that the next
increase in clock speed would spell certain doom for
their products.
This time, though, those
assertions may well prove true, according to EDN
columnist Jack Ganssle, president of ICE manufacturer
Softaid Inc (Columbia, MD). Conventionally designed
ICEs--in which an emulation processor takes over for the
target µP--will continue for at least a decade to serve
the needs of the tens of thousands of developers who
design with 8- and 16-bit µPs. But newer, faster
processors will force different approaches. The tools may
still use the name "ICE," but the architecture
will be different. Controlling the target processor and
looking at its internal registers increasingly will
depend on debugging facilities designed into the µP
chip.
Chip features offer
visibility
Most recently designed
Motorola (Phoenix) processors include
background-debug-mode (BDM) ports. Newer µPs from Intel
(Santa Clara, CA) and others incorporate IEEE-1149.1
ports. These ports are also known as JTAG ports, for
Joint Test Action Group. JTAG was the predecessor of the
committee that drafted the IEEE-1149.1 standard. Ports of
both types allow you to serially transfer data to and
from points within the µP. But the serial transfer is
relatively slow, requiring more than n clock pulses to
transfer n bits. In general, too, the clock speed at
which you can transfer data is lower than the clock speed
at which the µP normally runs.
So, when debugging tools
use serial ports, the tools sacrifice some real-time
capability for control and for part of their ability to
let you observe system behavior. Currently, the sacrifice
appears unavoidable. Moreover, some industry observers
aver that those who insist that ingenious ways to retain
real-time control will emerge are unwittingly betting on
the repeal of the laws of physics.
A related, albeit far less
important, issue is what you call a debugging tool that
combines logic analysis with support for a BDM or an
IEEE-1149.1 port. Is it a logic analyzer, an ICE, or
something else? According to one school of thought, a
unit that displays timing diagrams deserves the name
"logic analyzer."
No time to develop
tools
Despite ICEs' popularity
among embedded-system developers, logic analyzers, rather
than ICEs, are the mainstay for debugging several classes
of leading-edge products, including PC motherboards and
graphics cards. Developers of these products do not use
ICEs, because the products under development have short
life cycles and use the latest processors. Classic ICEs
for new µPs take too long to develop and so are not
available soon enough. Logic analyzers are more
general-purpose than ICEs are and so are available
sooner. Processor-specific logic-analyzer accessories are
easier to develop than new ICEs are. These accessories
are also available fairly early in the µP life cycle.
The early availability of
logic-analyzer support for new processors is a
logic-analyzer strong point. However, ICEs' delayed
availability has not significantly precluded their use.
Most ICEs are used in embedded-system development, and
embedded systems have historically not been among the
first users of new µPs. Thus, ICEs that support new µPs
have usually become available when embedded-system
developers have needed them.
|