prepared by P. Bakowski
Signals values are changed by signal assignment statements. The simplest form of a signal assignment is:
signal_name <= value; -- assigned after delta delay
This expression assigns the value of the signal at the beginning of the next simulation cycle. The left hand side of the signal assignment is referred to as target. When no explicit delay time is provided, the default time is a delay called delta delay.
The target signal may be assigned an explicit delay:
signal_name <= value after time_expression; -- called inertial delay
signal_name <= reject value after time_expression; -- called reject inertial delay
or
signal_name <= transport value after time_expression; -- called transport delay
For example, the simple signal assignment:
It is possible to apply multiple transactions in one signal assignment. In this case the delay times must be specified in ascending order.
The selected signal assignment represents an action in which the signal target is assigned the value chosen from a list of provided assignments.
with op_code select
VHDL provides two different models of time delay that correspond to the different sorts of delay encountered in the real word.
The following are the actions performed by the simulator when an inertial delay transaction is added to a driver.
Remember that the inertial delay deletes all transient impulses which are shorter than the proposed delay. Suppose a signal sin carrying a transient impulse '0' => '1' => '0' with '1' lasting 3 ns; and following signal assignment:
The second kind of the delay provided by VHDL is transport delay. This kind of delay is useful to model transit delays. For example the integrality of an input signal carried by an ideal transmission line is received at its output.
Inertial delay versus transport delay
The following examples show the output waveform in response to an input waveform entree using inertial assignment (a <= ..) and transport assignment (b <= ..).
In the first case , the inertial delay is probably the right choice because we wish to suppress transient perturbation.
In the second case, when we are going to model serial transmission line, the transport delay is more appropriate because the output waveform must mimic the input waveform exactly, regardless of the delay.
An example of a complete description of horloge entity:
The `stable attribute is a boolean signal whose value is TRUE when an event has not occurred on the signal for the given time; otherwise is FALSE.
Detection of spikes (transients):
The `transaction attribute is a bit signal which toggles every time when a transaction has occurred on the signal. Note that the `transaction attribute produces events even if the value of the signal has not changed.
The `active attribute is a boolean signal which is TRUE when a transaction has occurred on the signal during the current simulation cycle. The `event attribute is a boolean signal which is TRUE when an event has occurred on the signal during the current simulation cycle. The following excl_process is sensitive to two input signals but its behavior depends on whether or not each of the inputs has changed.
entity buffer is port(in1,in2: in bit; output: out bit); end buffer;
architecture exclusive of buffer is begin excl_process: process
The `last_active attribute returns the amount of time that has elapsed since there was a transaction on the signal. The `last_event attribute returns the amount of time that has elapsed since there was an event on the signal. The `last_value attribute returns the value of the signal before the last event.
entity sh_reg is port(inbit,clk: in bit; outbit: out bit); end sh_reg;
architecture pfalling of sh_reg is begin shift_process: process
Resolution function
The signals can have multiple drivers. The value of the signal is a function of all the drivers of that signal. The following figure shows an example of a bus signal which is driven by four independent signals. The value bus is computed by a bus resolution function (brf in this example).
The drivers are labeled s1,s2,s3, and s4. The value of the signal dbus is computed by a bus resolution function (brf in our example). Bus resolution functions are user-defined and are evaluated when one of the drivers of the signal receives a new value (event). The 'resolved' value is then generated by the bus resolution function.
Let us take a three-valued (tri-state) logic called TSL as follows and declare the bfr function;
In general this assumption is to strong while in reality more than one signal may be active at the same moment. That is why we need a more complete resolution function able to detect the potential conflicts.
The variable assignments:
In our example the next value for signal a will be ready after a delta time. This in turn will activate the second process and generate a new value for signal b after a following delta time. Note that the order of execution of signal assignments is independent of their typographic order. This kind of execution is called non-procedural.
The following tables provide the comparison between variable and signal evaluations for a given example.
Now we can consider an example of a simple rs flip-flop. The process below describes the operations of this flip-flop using two signal assignments.
Is it possible to describe the function of this rs flip-flop using variable assignments ?