VHDL Programming

(C. Jardin) #1
the resolved value that a particular driver is driving so that it can be
further used in the model. In the example shown here the second com-
ponent instantiation statement would cause an error because input
port a of U2is trying to read the current value of dout. In VHDL93 the
`driving_valueattribute gets around this problem by reading the driving
value of dout.

ENTITY invert IS
PORT( w: IN STD_LOGIC;
dout, doutb : OUT STD_LOGIC);
END invert;
ARCHITECTURE struct OF invert IS
COMPONENT inv
PORT( a : IN STD_LOGIC;
q : OUT STD_LOGIC);
END COMPONENT;
BEGIN
u1 : inv PORT MAP(a => w, q => dout);
--u2 : inv PORT MAP(a => dout, q => doutb);
-- won’t work because port
-- dout cannot be read

u2 : inv PORT MAP(a => dout`DRIVING_VALUE, q => doutb);
-- In VHDL93 this
-- will work
END struct;

`IMAGE AND `VALUE In VHDL87 it was difficult for an error message
to display the actual error value of a signal or a variable in a string. In
VHDL93 the attributes `IMAGEand `VALUEallow the modeler to convert to
and from type values into string values. Attribute `IMAGEconverts a type
value into a string, and attribute `VALUEconverts a string to a type value.

`PATHNAME, `INSTANCE_NAME, AND `SIMPLE_NAME The
other difficulty in VHDL87 of model error reporting was to uniquely
determine exactly which instance of a model was generating a message.
Most VHDL simulators had some mechanism of reporting the instance
information to the modeler, but this information was simulator-specific
and not standard. In VHDL93 three new attributes allow the modeler
access to all parts of the pathname that describes which instance a partic-
ular message is generated from.

`SIMPLE_NAME—returns a string which is the local name of the
calling entity.

`PATH_NAME—returns a string that describes the path to the entity
starting at the root of the design. The `PATH_NAMEattribute does not
include the names of instantiated entities (`INSTANCE_NAMEdoes)

Appendix D: VHDL93 Updates 451

Free download pdf