128 Chapter Five
Although VHDL simulators can support any type of resolution that can
be legally written in the language, synthesis tools can only support a
subset. The reason stems from the fact that the synthesis tools must build
actual hardware from the VHDL description. If the Resolution Function
maps into a common hardware behavior such as wired-or or wired-and,
then most synthesis tools allow the user the ability to tag the resolution
function appropriately. For instance, a Resolution Function that performs
a wired-or function is tagged with an attribute that tells the synthesis
tools to connect the outputs together.
COMPOSITE TYPE RESOLUTION For simple signal values such as
the ninevaland fourvaltypes, it is easy to see how to create the resolu-
tion function. But for signals of composite types, it is not so obvious. How
can one value of a composite type be stronger than another?
The answer is that one value must be designated as weaker than all of
the other values. Then the principle is the same as any other type being
resolved. In the fourvaltype, the value Zwas considered the weakest
state, and any of the other values could overwrite this value. In the
ninevaltype, all values with a strength of Zcould be overridden by val-
ues with a strength of Ror F, and all values with strength Rcould be over-
ridden by strength F.
To resolve a composite type, designate one value of the composite type
as unusable except to indicate that the signal is not currently being driven.
The resolution function checks how many drivers have this value and how
many drivers have a driving value. If only one driving value exists, then
the resolution function can return this value as the resolved value. If more
than one driving value is present, then an error condition probably exists
and the resolution function can announce the error.
A typical application for a composite type resolution function is shown
in Figure 5-6.
Signal XBUScan be driven from a number of sources, but hopefully only
one at a time. The resolution function must determine how many drivers
are trying to drive XBUSand return the correct value for the signal.
Following is the type declarations and resolution function for a com-
posite type used in such a circuit:
PACKAGE composite_res IS
TYPE xtype IS
RECORD
addr : INTEGER;
data : INTEGER;