
Simulators and Other Tools 37
Simulators and Other Tools
Of course, many other debugging tools are available to you, including simulators,
logic analyzers, and oscilloscopes. A simulator is a completely host-based program
that simulates the functionality and instruction set of the target processor. The
human interface is usually the same as or similar to that of the remote debugger.
In fact, it might be possible to use one debugger frontend for the simulator back-
end as well, as shown in Figure 4-2. Although simulators have many disadvan-
tages, they are quite valuable in the earlier stages of a project when there is not
yet any actual hardware for the programmers to experiment with.
Debugging Tip #2: If you ever encounter a situation in which the tar-
get processor is behaving differently from how you think it should
from reading the data book, try running the same software in a sim-
ulator. If your program works fine there, then you know it’s a hard-
ware problem of some sort. But if the simulator exhibits the same
weirdness as the actual chip, you’ll know you’ve been misinterpret-
ing the processor documentation all along.
By far, the biggest disadvantage of a simulator is that it only simulates the processor.
And embedded systems frequently contain one or more other important peripher-
als. Interaction with these devices can sometimes be imitated with simulator scripts
or other workarounds, ...