逻辑综合 Flattening, Structuring, and Ungrouping

472 阅读1分钟

Flattening

Flattening in Design Compiler is often mistaken for removing the hierarchy
and making a design flat. This is not true. Flattening is actually an
optimization technique for reducing logic levels and improving the speed of
the design. It works by converting the combinational logic into a two-level
sum-of-products form and removing intermediate terms. Flattening is not
performed by default.

Example:

A = b + c;
out = A * d;

After flattening is enabled, the equation is

out = (b + c) * d; => b*d + c*d;

Command:

set flatten true

Structuring

Structuring adds intermediate variables and logic structure to a design. It
is used to reduce design area. During structuring, Design Compiler searches
for subfunctions that can be factored out and evaluates each factor, based
on the size of the factor and the number of times the factor appears in the
design. The tool turns the subfunctions that most reduce the logic into
intermediate variables and factors them out of the design equations.

Example:

y1 = ab + ac
y2 = b + c + d

This requires four logic gates (two AND and two OR gates).

After structuring the equations can be written as

y1 = aT
y2 = T + d

where T = b + c

The structured logic requires only three gates.

Structuring can be either timing driven or Boolean. Timing-driven structuring
is enabled by default; Boolean is not. Timing-driven structuring restructures
only the critical path; it does not affect noncritical paths.

Boolean optimization reduces area (by using dont_care attributes), but this
result may or may not improve timing for area-critical designs. By default
Boolean structuring is disabled, because most designers concentrate on timing
rather than area.

Command:

set_structure

Ungrouping

Ungrouping removes levels of hierarchy in a design. By default, Design Compiler
maintains the original hierarchy of the design. The tool optimizes only within
the logical boundary. By removing the hierarchy and combining two logic blocks,
ungrouping can result in a more optimal solution.

Commands:

ungroup -flatten -all
compile -ungroup