RTL to Gates: What Synthesis Really Builds

RTL describes behavior under the language rules. The synthesis flow constructs hardware using the available resources and the constraints it receives.

EDA Academy

RTL to Gates: What Synthesis Really Builds

An RTL review often starts with functionality.

  • Does the state machine handle the intended transactions?

  • Are the resets correct?

  • Does the simulation pass?

Those questions matter. The same review also needs to consider the implementation that the description permits.

  • A compact expression may require a wide arithmetic unit.

  • An ordered decision may introduce a long dependency path.

  • A small change to a memory's reset behavior may prevent the intended memory mapping.

These outcomes are easier to understand when we follow the design through elaboration, inference, optimization, and technology mapping. RTL describes behavior under the language rules. The synthesis flow constructs hardware using the available resources and the constraints it receives.

This discussion applies to both ASIC and FPGA work. Specific resources differ: an ASIC flow uses its cell libraries and available memory macros, while an FPGA flow targets its LUTs, registers, dedicated arithmetic, and memory blocks. Examples of a particular vendor's behavior are identified where the distinction matters.

1. RTL describes behavior before it describes a gate structure

Consider a register that loads a selected input on the next rising clock edge. The RTL specifies when the update occurs and what value it stores. It does not necessarily specify an exact mux cell, drive strength, or physical location.

Synthesis first resolves parameters, generates, widths, and hierarchy. It identifies structures such as registers and selection logic. Later transformations can fold constants, combine equivalent expressions, remove unused logic, and choose cells from the target library.

Two descriptions can therefore reach similar hardware, while the same source can produce different implementations under different targets or constraints.

An RTL sketch is useful for predicting architecture. The mapped netlist is the evidence of the implementation selected for a particular run. Keep that distinction when reviewing a schematic produced before technology mapping.

2. Priority logic can create a long dependency

An if/else chain gives the first true condition precedence. When conditions can overlap, that ordering is part of the required function.

For example, a request arbiter may select request 0 before request 1, then request 2. A possible implementation places successive selection decisions on the path to the output. As the number of alternatives grows, that dependency can become a timing problem.

The optimizer may restructure the logic. A source-level chain is therefore a warning to investigate, not an exact prediction of mux count or delay.

Start by asking whether the priority is required.

  • If it is, preserve it and inspect the mapped path.

  • If requests are truly mutually exclusive, express and verify that contract.

Changing the arbitration policy solely to shorten a path would change the design's behavior.

3. If/else and case describe selection semantics

The useful comparison is between priority selection, mutually exclusive selection, and incomplete assignment.Counting keywords does not establish the resulting architecture.

A case over an ordinary binary selector can express distinct alternatives. A casez with overlapping patterns can express priority. The surrounding assignments also determine whether the process specifies combinational logic or requires state.

SystemVerilog unique and priority add semantic intent and simulation checks. Synthesis can use their assumptions during optimization. They must agree with the legal input space. They also do not supply missing assignments to every output.

A review should establish

  • the result for every legal selector value,

  • what happens if conditions overlap,

  • and whether every combinational output receives a value on every path.

Then inspect the elaborated and synthesized implementation.

4. Arithmetic width changes both behavior and cost

Width affects the result that can be represented and the hardware needed to produce it. Full unsigned addition of two eight-bit values can require nine result bits. A full product of two eight-bit unsigned values can require sixteen.

SystemVerilog expression sizing also depends on context. A wider assignment can influence the evaluation width of an expression. It is inaccurate to claim that every addition of two eight-bit operands must lose its carry before assignment.

Consider two eight-bit unsigned inputs, a and b.

  • If a is 255 and b is 1, the full mathematical result is 256. An eight-bit intermediate cannot represent that value, so it retains zero after truncation.

  • Assigning that intermediate to a nine-bit destination still gives zero. The discarded carry is already gone.

  • To preserve the full result explicitly, zero-extend both operands to nine bits before adding them. The resulting nine-bit sum can represent 256.

Use widths derived from the required numeric range. Check intermediate expressions, literals, shifts, and truncation boundaries. Reducing width is only valid when it preserves the required result.

5. Signedness needs an explicit numeric interpretation

The bit pattern 8'hFF can represent unsigned 255 or signed minus one. Mixing signed and unsigned operands can therefore change comparisons, extension, and arithmetic interpretation.

Declaring the destination signed does not repair every operand-level issue. A part select or concatenation can also change the type of an expression. Review the expression that performs the operation, not only the receiving signal.

The $signed function changes interpretation while preserving the input width. Applying $signed directly to an eight-bit unsigned 255 produces an eight-bit signed interpretation of minus one.

Suppose you need to compare an eight-bit signed value with an eight-bit unsigned value.

  • Use an explicitly signed nine-bit representation for both operands.

  • Sign-extend the signed operand by repeating its sign bit.

  • Zero-extend the unsigned operand by adding a leading zero.

The resulting signed values preserve the original ranges: minus 128 to 127 for the signed input, and zero to 255 for the unsigned input. The comparison now uses an explicit common numeric representation.

Test negative operands and boundary values as well as typical positive data.

6. Resource sharing changes the timing path

Suppose an output selects either a + b or c + d.

  • One possible architecture computes both sums and selects the result.

  • Another selects the appropriate operands before using one shared adder.

The shared version reduces the number of adders. It also moves selection ahead of the arithmetic. A late select signal may now pass through a mux and the adder before reaching the destination register.

Whether this improves the design depends on arrival times, widths, target resources, loading, and the optimization objective. AMD's documented automatic resource-sharing setting considers timing. Yosys also documents transformations that move selection from operator outputs to inputs.

Compare the actual critical paths and resource reports. If both operations are needed in the same cycle, reusing one operator across cycles requires a scheduling change and may affect throughput or latency.

7. Constant propagation can remove large sections of RTL

A parameterized module may contain several operating modes, but only the elaborated configuration must be implemented. A constant mode selection can eliminate unused branches and simplify their control logic.

Similarly, a calculation that cannot affect any required observable behavior may disappear. Synthesis tools explicitly perform constant folding, mux simplification, and removal of unused cells and signals.

This is often desirable. Unexpected removal can also reveal a disconnected output, a tied-off enable, a wrong parameter override, or a feature that never became reachable.

Review removed-logic messages against the intended configuration. Do not automatically add preservation attributes to keep every source object alive. First establish why the logic vanished and whether the resulting behavior is correct. Where a debug or test requirement genuinely needs an internal object, preserve it through the supported flow and account for the implementation cost.

8. Memory inference depends on the complete interface

An HDL array describes storage behavior. Mapping it to a particular memory resource depends on more than its width and depth.

Read latency, port count, clocks, write enables, and same-address read/write behavior must fit the target resource or a supported implementation around it. A mismatch may lead to extra logic, a different memory type, or an implementation using registers and muxes.

Reset behavior is a useful example. Altera documents that resetting the contents of an entire RAM during operation prevents mapping to its FPGA memory blocks. Resetting a separate read-data register is a different requirement and may be supported.

For ASICs, available SRAM macros and the configured inference or mapping flow determine the corresponding choices. A plain array declaration does not guarantee a macro instance.

Check the inferred resource, port geometry, read latency, reset semantics, and collision behavior. Also inspect the surrounding bypass or emulation logic, since a successful memory inference message does not describe the entire implementation cost.

9. Clock enables and clock gating have different implementations

The statement if (en) q <= d specifies that q holds its previous value when en is inactive. Depending on the target, that behavior can use a native clock-enable register or a mux feeding back the current value.

An ASIC flow may group suitable enables and insert integrated clock-gating cells. That transformation changes the clock distribution and needs the relevant cell, test-enable behavior, and timing checks. Yosys documents this type of transformation explicitly.

For FPGA designs, AMD recommends inferring clock enables rather than placing general logic in the clock path.

Writing clk & en as an ordinary combinational expression is not a safe general substitute for a qualified clock-gating implementation. An enable transition can disturb a clock pulse unless the gating structure and control timing prevent it.

Review the inferred enable structure and the implemented clock path separately. Power benefit also depends on switching activity, the amount of gated logic, and the overhead of the chosen structure.

10. Retiming changes internal register positions

Retiming can move registers across combinational logic to distribute work more evenly between register boundaries. A legal transformation preserves the specified sequential behavior and the relevant interface latency. It is not permission to add arbitrary pipeline cycles.

The initial state, reset behavior, enables, clock domains, and observable boundaries affect which movements are valid. Tool settings and preservation constraints can further limit the available transformations. AMD documents latency-preserving retiming, while Altera's Hyperflex guidance provides concrete examples of movement restrictions.

A conceptual path with three logic blocks before one register and one block before the next may be balanced differently when the transformation is legal. Physical delay, rather than merely the number of drawn boxes, determines whether the result helps timing.

After a retiming change, use the flow's appropriate sequential equivalence and timing checks. A changed register name or location does not by itself show that the functional contract changed.

11. High fanout makes a small control signal expensive

A one-bit enable may reach many registers spread across a block. The logical source is small, but the implementation must drive the aggregate load through a physical network.

Buffering, driver sizing, and sometimes logic replication can change the distribution. They also consume area and can affect power. AMD's methodology guidance discusses replicating high-fanout drivers to improve implementation flexibility.

The fanout count is a starting point. Examine load, transition time, routing distance, congestion, and the actual endpoint paths. Several closely placed loads can behave differently from the same number spread across the floorplan.

Control duplication also needs care. Do not casually clone registers whose special purpose, such as synchronization across clock domains, depends on a reviewed structure. Fix the distribution problem while preserving the control protocol and the verification assumptions.

12. RTL simulation and implementation analysis answer different questions

Functional RTL simulation evaluates the behavior in the model. It can expose a signedness mistake, missing assignment, or incorrect latency when the tests exercise the relevant conditions.

It generally does not contain the mapped cell delays and routed parasitics needed to determine physical timing. A passing regression therefore says little about whether a particular implementation meets its clock period, area budget, or routing constraints.

  • Use synthesis to inspect the inferred structure and early estimates.

  • Use static timing analysis with complete, correct constraints to evaluate timing paths.

  • Continue the review after placement and routing, when the physical implementation provides better interconnect information.

Equivalence checking addresses whether transformations preserve the required function. It does not replace timing analysis. These checks provide different evidence, and their results must agree with the same design contract.

13. Synthesis reports explain what the code became

Start with the conditions of the run. Confirm the intended top level, parameters, source versions, target libraries, clocks, and I/O assumptions. An impressive number from a different configuration is not a meaningful comparison.

Then review the following evidence:

  • Elaboration and inference: Confirm the expected registers, memories, and arithmetic resources. Investigate unintended latches.

  • Removed or constant logic: Check that eliminated behavior matches the selected configuration.

  • Cell or resource utilization: Identify where area is concentrated and whether the intended resources were used.

  • Critical timing paths: Examine the startpoint, endpoint, path type, logic depth, cell delay, and interconnect contribution.

  • Constraint coverage: Review clocks, I/O delays, timing exceptions, and any unconstrained paths.

  • High-fanout and electrical checks: Inspect distribution cost, loading, transition time, and applicable capacitance limits.

  • Equivalence results: Confirm that the implementation preserves the required behavior under the flow's stated assumptions.

Unconstrained paths need explicit attention. AMD documents that some paths are not timed when relevant constraints are absent, and its timing-summary command does not include unconstrained paths by default unless requested.

Do not remove a violation by adding a false-path or multicycle exception unless the functional protocol justifies it. A constraint changes the analysis assumption, not the speed of the circuit.

When comparing revisions, keep the library, corners, constraints, and reporting stage consistent. Early synthesis estimates and routed results serve different purposes.

14. Hardware awareness belongs in RTL review

A useful RTL review records both the intended behavior and the expected implementation.

  • For a selector, identify whether priority is required.

  • For arithmetic, define the numeric range and every deliberate truncation.

  • For storage, specify the expected latency and reset behavior.

  • For a broad control, consider how its sinks will be reached.

These expectations give synthesis reports something concrete to confirm. A mismatch becomes a focused question: why did this array become registers, why did sharing move the critical path, or why did this feature disappear?

Engineers do not need to predict every final gate while writing RTL. They do need enough hardware understanding to recognize when the implementation is inconsistent with the architecture or the budget.

For your next review, choose one small RTL block and compare three things:

  1. the intended structure,

  2. the synthesized netlist,

  3. and the timing path through it.

The differences are often more instructive than another round of source-level cleanup.

A question for the next design review

What hardware do we expect this RTL to create, and what evidence will confirm that expectation?


Download the carousel: RTL to Gates: What Synthesis Really Builds (PDF)

Comments