Page 199 - A Practical Guide from Design Planning to Manufacturing
P. 199
172 Chapter Six
performance, but from this set of documents there is no easy way to deter-
mine whether the processor will actually produce the correct result for dif-
ferent programs. The task of logic design is to turn a microarchitectural
specification into a logical model that can be tested for correctness.
Very early computer designs used few enough transistors in their com-
ponents that circuit design could be performed directly from the design
specification. The march of Moore’s law has led to the use of vastly more
transistors and more complexity, making it critical to simulate the cor-
rectness of the logic before attempting to create a transistor-level design.
Indeed, modern microprocessors could not be successfully designed with-
out microprocessors to simulate their designs.
These simulation models are created using HDL. These are computer
programming languages specifically intended to simulate computer hard-
ware. The processor design is divided into smaller and smaller logical
blocks until the functionality of one block is simple enough to allow HDL
for that block to be written easily by a single person. HDL code for these
different blocks is then combined to create models of large pieces of the
processor microarchitecture and eventually a model of the behavior of
the entire processor. In addition, an HDL model of the processor’s envi-
ronment must be created to allow the processor model to be stimulated
with the proper inputs and to check the processor outputs for correctness.
HDLmodels can be written to be relatively abstract or extremely detailed.
Ultimately, a structural model must be created with sufficient detail to
be implemented easily in transistors. Design automation tools allow high-
level HDL code to be automatically converted into structural HDL models
and eventually layout. The ability of logic synthesis tools to do this has
been critical to keeping design times under control; all modern processors
rely upon this automation for at least part of their design. However,
because hand tuning provides performance benefits, the structural models
of at least parts of many processors are still created by hand.
The logical description of a modern microprocessor can require a mil-
lion of lines of HDL code, turning a hardware design problem into a sig-
nificant task of software engineering. All the problems faced when creating
any large piece of software must be addressed. When will interfaces
between different parts of the design be defined? How will changes in one
block impact the rest of the design? How will code revisions being turned
in simultaneously by dozens of programmers be handled? What func-
tionality will be available at different stages of the project?
Hardware simulations have the added problem of distinguishing between
logical and simulation errors. If the HDL model of the processor produces
the wrong result, the problem may be a logical bug in the design. If not
corrected, this bug would cause the hardware to produce the same error.
However, the problem could be with just the simulation of the processor.
Perhaps the simulation does not accurately model what the behavior of