Package with Bus Resolution Function(Package Declaration)
-- user defined enumerated type
TYPE level IS ('X', '0', '1', 'Z');
-- type for vectors (buses)
TYPE level_vector IS ARRAY (NATURAL RANGE <>) OF level;
-- subtype used for delays
-- resolution function for level
FUNCTION wired_x (input : level_vector) RETURN level;
-- subtype of resolved values
SUBTYPE level_resolved_x IS wired_x level;
-- type for vectors of resolved values
TYPE level_resolved_x_vector IS
ARRAY (NATURAL RANGE <>) OF level_resolved_x;
This is the revised package for the level type with the inclusion of the necessary types, subtypes and the actual resolution function. This example simply illustrates how a bus resolution function is defined.
Note that the resolution function takes in a level_vector, which is really an unconstrained array, and returns a single level value as is required by the language. The subtype level_resolved_x is the signal subtype that is associated with the bus resolution function and level_resolved_x_vector is an array of signals of that subtype.