Often a process describing a driver for a signal contains only one signal assignment statement. VHDL provides a convenient short-hand notation, called a concurrent signal assignment statement, for expressing such processes. The syntax is:
concurrent_signal_assignment_statement ::=
[ label : ] conditional_signal_assignment
| [ label : ] selected_signal_assignment
For each kind of concurrent signal assignment, there is a corresponding process statement with the same meaning.
A conditional signal assignment statement is a shorthand for a process containing signal assignments in an if statement. The syntax is:
conditional_signal_assignment ::= target <= options conditional_waveforms ;
options ::= [ guarded ] [ transport ]
conditional_waveforms ::=
{ waveform when condition else
}
waveform
Use of the word guarded is not covered in this booklet. If the word transport is included, then the signal assignments in the equivalent process use transport delay.
Suppose we have a conditional signal assignment:
s <= waveform_1 when condition_1 else
waveform_2 when condition_2
else
...
waveform_n;
Then the equivalent process is:
process
if condition_1 then
s <=
waveform_1;
elsif condition_2 then
s <=
waveform_2;
elsif ...
else
s <=
waveform_n;
wait [ sensitivity_clause ];
end process;
If none of the waveform value expressions or conditions contains a reference to a signal, then the wait statement at the end of the equivalent process has no sensitivity clause. This means that after the assignment is made, the process suspends indefinitely. For example, the conditional assignment:
reset <= '1', '0' after 10 ns when short_pulse_required
else
'1',
'0' after 50 ns;
schedules two transactions on the signal reset, then suspends for the rest of the simulation.
On the other hand, if there are references to signals in the waveform value expressions or conditions, then the wait statement has a sensitivity list consisting of all of the signals referenced. So the conditional assignment:
mux_out <= 'Z' after Tpd when en = '0' else
in_0
after Tpd when sel = '0' else
in_1
after Tpd;
is sensitive to the signals en and sel. The process is activated during the initialization phase, and thereafter whenever either of en or sel changes value.
The degenerate case of a conditional signal assignment, containing no conditional parts, is equivalent to a process containing just a signal assignment statement. So:
s <= waveform;
is equivalent to:
process
s <= waveform;
wait [ sensitivity_clause ];
end process;
A selected signal assignment statement is a shorthand for a process containing signal assignments in a case statement. The syntax is:
selected_signal_assignment ::=
with expression select
target
<= options selected_waveforms ;
selected_waveforms ::=
{ waveform when choices , }
waveform when choices
choices ::= choice { | choice }
The options part is the same as for a conditional signal assignment. So if the word transport is included, then the signal assignments in the equivalent process use transport delay.
Suppose we have a selected signal assignment:
with expression select
s <= waveform_1 when choice_list_1,
waveform_2
when choice_list_2,
...
waveform_n
when choice_list_n;
Then the equivalent process is:
process
case expression is
when
choice_list_1=>
s
<= waveform_1;
when
choice_list_2=>
s
<= waveform_2;
...
when
choice_list_n=>
s
<= waveform_n;
end case;
wait [ sensitivity_clause ];
end process;
The sensitivity list for the wait statement is determined in the same way as for a conditional signal assignment. That is, if no signals are referenced in the selected signal assignment expression or waveforms, the wait statement has no sensitivity clause. Otherwise the sensitivity clause contains all the signals referenced in the expression and waveforms.
An example of a selected signal assignment statement:
with alu_function select
alu_result <= op1 + op2 when
alu_add | alu_incr,
op1
- op2 when alu_subtract,
op1
and op2 when alu_and,
op1
or op2 when alu_or,
op1
and not op2 when alu_mask;
In this example, the value of the signal alu_function is used to select which signal assignment to alu_result to execute. The statement is sensitive to the signals alu_function, op1 and op2, so whenever any of these change value, the selected signal assignment is resumed.