Contents Up << >>

Resolved signals

Resolved signals are used to model a bus where many signals could possibly drive the value of the bus. Every signal assignment constitutes a single driver and every process constitutes a single driver for every signal assigned within that process. Unresolved signals can only have one driver. If a signal is declared of a resolved subtype, then it is a resolved signal and may have more than one driver. The drivers of a resolved signal can be disconnected at any time and re-connected at any time. If more than one driver is connected at any given time, then there is a conflict which must be resolved to chose a value for the signal. The value of the signal is resolved with a resolution function. The resolution function takes as input all the connected drivers and calculates the resolved value of the signal.

If a null transaction occurs on a signal driver, then that driver is disconnected. A signal null transaction can be schedule explicitly with statements like or with a guarded signal assignment, described in the concurrent signal assignment and block statement sections.

A resolved subtype can be declared by declaring a subtype that includes the function name part. This function is the function that will be used as the resolution function. It should have one input parameter of an unconstrained array type with the resolved signal type as the element type. The following source code fragment shows how to declare a resolved bit signal that uses an or resolution function. First, the resolution function is declared that accepts an array of the current active drivers and returns the resolved value of the drivers. The resolution function computes the resolved value by or'ing all the drivers together. The subtype resolved_bit is a resolved subtype because it contains a resolution function. The two signals a and b are resolved signals because they are declared with a resolved subtype. Whenever a driver of a resolved signal changes value, the resolution function is called to compute the new value of the resolved signal.

The declarations of the a and b signals and the two signal assignment examples in this section illustrate two different kinds of resolved signals. One is the bus kind and the other the register kind. If a signal of the bus kind has no connected drivers, then the resolution function is still called with an empty array. In this case, the resolution function must return some default value. In the example, it returns 0. A signal of the register kind will never call the resolution function if there are no connected drivers. Instead, the signal retains its last value. If the two assignments above are the only drivers for a and b, then both a and b will be '1' for 1ns, and then a will be '0' and b will remain '1'. The signal a becomes '0', because after 1ns the only driver is disconnected and the resolved function returns the default value, '0'. The b signal's only driver is also disconnected, but since it is a register kind it retains its last value, '1'.