Precomputing Logic

One of the most powerful optimizations is the ability to make assumptions about inputs to a system. In this article, timing is met when a comparison is precomputed. This basic method often improves timing. The cost is that assumptions on the inputs be met.

Compare, Select Increment

Comparison Appears in Longest Path

The easiest input that can be pre-computed is the counter. It is simple to determine what value the counter will have on the next cycle based on its value this cycle. When the counter’s output appears in the longest timing path, it may be possible to remove it by precomputing that portion of the path.

The schematic above is of an accumulator that selects between one of two inputs based on the value of a counter. The counter is compared to a constant to make the determination. Post-PAR results show that the longest path is 2.6 ns.

Precomputing the Select

Precomputed Select Logic

In order to improve timing, the comparison can be done against N-1, and this result can be registered. On the next cycle, the counter will actually be equal to N. The output of the register is correct for the comparison of the counter with N.

This method provides more benefits when the comparison to N is used in many places. In this case, a register can be used and timing can be vastly improved. Post-PAR results for this simple version show that the circuit will run with a 2.0 ns constraint.

There are some dangers to this method. The primary one is that it’s very specific. It requires some assumptions about the input. Whenever these assumptions are incorrect, the design fails. Further, it reduces reusability when these assumptions can’t be met or aren’t documented.

This entry was posted in Fundamentals and tagged . Bookmark the permalink.

Comments are closed.