Example:
In this example we are modeling an inverter. The draft synthesis standard states that synthesis tools should ignore 'X' and 'U' branches of selected signal assignment statements. The synthesis tool will begin by producing a multiplexor with '1' connected to the I0 input and '0' connected to the I1 input. it will then optimize by eliminating inputs to AND gates tied to '1' and eliminating AND gates with a '0' input by connecting the output signal to '0'. '0' inputs to OR gates are eliminated, and '1' inputs to an OR gate allows elimination of the OR gate. You can easily see that these rules simplify the multiplexor above to a simple inverter.
Example: Multiplexer
while chang_req = '1' loop
wait until ad_valid_a =
'1';
bus_data <= data_src;
msyn <= '1' after 50
ns;
wait until ssyn = '1';
msyn <= '0';
end loop;
In general, while loops have time-varying conditions which do not lend themselves well to synthesis.
Synthesizable FOR loops produce a result similar to concurrent VHDL FOR GENERATE statements.
The synthesis tool will generate a cascade of two input AND gates from the description above. Timing optimization will attempt to compress the circuit into a minimum number of levels, balancing the tree of AND gates and using the largest input AND gates available in the library and useful in the optimization.
for i := 2 to x_in'length loop new_val := new_val and x_in(i) ; exit when new_val = '0';end loop;
Assertions provide information about how the design unit is to be used. This is an aspect of the design interface which has traditionally been relegated to comments. In VHDL an assertion can be used as an executing "monitor" during simulation.
Assertion Examples
assert not clock'event or
(J'Stable(setup) and
K'Stable(setup) )
report "J or K
input changed during setup"
severity Warning;
assert not data_valid'event or Data_bus'Stable ( setup )
report "Data on System
bus not stabilized at use"
severity Warning;
It is also possible to create procedures which check behavior. This permits encapsulation of entire checking "bodies." This is perhaps where sequential assertion statements become most useful. By invoking a concurrent procedure, it is possible to run through a sequence of condition checks without making the simulation tool manage event queues and call many mini-processes to perform the same evaluation.
Check_setup_hold (clk, J, K, Tsetup, Thold);
Rev. 2/19/98 B. Huey