Return to previous page Advance to next page
Verilog Reference Guide
Chapter 8: Writing Circuit Descriptions

Propagating Constants

Constant propagation is the compile-time evaluation of expressions that contain constants. Foundation Express uses constant propagation to reduce the amount of hardware required to implement complex operators. Therefore, when you know that a variable is a constant, specify it as a constant. For example, a + operator with a constant of 1 as one of its arguments causes an incrementer, rather than a general adder, to be built. If both arguments of an operator are constants, no hardware is constructed, because Foundation Express can calculate the expression's value and insert it directly into the circuit.

Comparators and shifters also benefit from constant propagation. When you shift a vector by a constant, the implementation requires only a reordering (rewiring) of bits, so no logic is needed.