TDEB Top Bar

Trending
Semiconductor Industry News — The Digital Electronics Blog
Follow Us

TDEB Masthead

The Semiconductor Hub

Semiconductors.  Chips and Systems.  Innovation.

Indexed by leading Search Engines, AI and referenced by Engineers worldwide 500+ Articles 10M+ Pageviews 30+ Reports 50+ Citations

Reading Real Reports, Part 10: The Synthesis Log Warnings You Must Never Waive

The Semiconductor Hub
by
0
Share Facebook X LinkedIn WhatsApp Email
Yosys-style synthesis log excerpt showing an inferred latch, a resized port, constant register bits, removed cells and an undriven wire.

A synthesis log for a real block runs to thousands of lines, and most of it is the tool describing routine work. Somewhere in the middle are a handful of warnings that decide whether the netlist does what the RTL says. Juniors learn to search the log for "Error" and move on. Seniors also read every warning in four families, because each one means the hardware you are about to build differs from the hardware you think you designed.

This is Part 10 of Reading Real Reports. Part 9 compared two synthesis QoR reports and found eight unexpected latches. Today we open the log behind that run, in the format printed by the open-source Yosys synthesizer, and read the four kinds of message that should never be waived without a reason written down: inferred latches, unconnected ports, constant registers and removed logic.

Key takeaways

  • Read the warning summary at the end of the log first, then find each warning in context.
  • An inferred latch in a flip-flop design is almost always an incomplete assignment in combinational code.
  • A port width mismatch or an undriven input means simulation and the netlist can disagree.
  • A register turned into a constant, or a block removed as unused, often means a connection is missing upstream.
  • A waiver that survives review names the exact message, the exact count and the reason, and the flow fails if either changes.

In this post

What the synthesis log is

Synthesis runs a script of passes: read the RTL, build the hierarchy, convert processes, optimize, map to cells, check. Each pass writes a numbered section header and a few lines about what it did. Warnings are printed as they happen, inside the pass that found them, so a single problem can show up far from the summary. In OpenROAD-flow-scripts the warnings and errors from the check step are also collected in synth_check.txt, as the flow tutorial lists.

The four warning families

Latches. When a combinational block does not assign a signal on every path, the signal must remember its old value, and the tool builds a latch. Yosys reports this in the proc_dlatch pass, which by default reports each inferred latch as a warning. A latch changes how the path is timed, how it is tested and how it behaves on glitches.

Unconnected ports. An instance port left off, or connected to a signal of the wrong width, leaves bits floating or tied. In simulation a floating input is often X; in the netlist it becomes whatever the tool chose.

Constant registers. If a register's input can never change, the optimizer replaces it with a constant. The Yosys opt_dff help text says the pass can remove a flip-flop altogether and convert it to a constant driver.

Removed logic. Logic whose outputs reach nothing is deleted by opt_clean. That is normal for small leftovers. It is a problem when a whole function disappears because its output was never connected.

What a senior checks first

  1. The summary line at the end. Count of unique and total warnings, compared with the last clean run.
  2. Every latch message. Signal name, process and source line. Was the latch meant?
  3. Width and driver messages. Resized ports and used-but-undriven wires, traced to the instance that caused them.
  4. Constant flip-flop messages. Which register, which bits, and why its input is fixed.
  5. Removal counts. A jump in removed cells between runs, even with no warning attached.

Common traps

  • Grepping only for "Warning". Constant registers and removed cells are reported as ordinary log lines, not warnings.
  • Blanket suppression. Turning a whole message class into plain text hides the next real instance along with the known one.
  • Reading the netlist count instead of the log. A correct cell count does not prove the right cells survived.
  • Fixing the log, not the RTL. A latch is fixed by a default assignment in the RTL, not by a waiver.

Deep dive: the numbers and details

This part holds a sample log, a reading of each message, the arithmetic and the checklists. Skip it if the overview is all you need.

The illustrative sample

The log below is an illustrative sample in the style of Yosys synthesis log output, written for this post. The design, file names, internal cell names, section numbers and counts are invented. Message wording follows the format strings in the Yosys source files proc_dlatch.cc, hierarchy.cc, constbits.cc, check.cc and driver.cc, and the removal line follows the synthesis starter example. The log is shortened to the lines discussed.

4.3. Executing PROC_DLATCH pass (convert process syncs to latches).
No latch inferred for signal `\irq_ctrl.\irq_q' from process `\irq_ctrl.$proc$rtl/irq_ctrl.v:41$402'.
Warning: Latch inferred for signal `\irq_ctrl.\mask_next' from process `\irq_ctrl.$proc$rtl/irq_ctrl.v:58$412': $auto$proc_dlatch.cc:436:proc_dlatch$1203

6.2. Executing HIERARCHY pass (managing design hierarchy).
Warning: Resizing cell port dsp_top.u_fir.coef_in from 16 bits to 12 bits.

9.6. Executing OPT_DFF pass (perform DFF optimizations).
Setting constant 0-bit at position 12 on $flatten\u_fir.$procdff$881 ($dff) from module dsp_top.
Setting constant 0-bit at position 13 on $flatten\u_fir.$procdff$881 ($dff) from module dsp_top.
Setting constant 0-bit at position 14 on $flatten\u_fir.$procdff$881 ($dff) from module dsp_top.
Setting constant 0-bit at position 15 on $flatten\u_fir.$procdff$881 ($dff) from module dsp_top.

9.7. Executing OPT_CLEAN pass (remove unused cells and wires).
Finding unused cells or wires in module \dsp_top..
Removed 214 unused cells and 391 unused wires.

31. Executing CHECK pass (checking for obvious problems).
Warning: Wire dsp_top.\u_crc.seed [0] is used but has no driver.
Warning: Wire dsp_top.\u_crc.seed [1] is used but has no driver.
Warning: Wire dsp_top.\u_crc.seed [2] is used but has no driver.
Warning: Wire dsp_top.\u_crc.seed [3] is used but has no driver.
Found and reported 4 problems.

Warnings: 6 unique messages, 6 total
# previous good run r41: Warnings: 0 unique messages, 0 total; first OPT_CLEAN removed 37 cells

Line-by-line walk-through

No latch inferred .... Printed for signals that looked like they might need a latch but did not. This is reassurance, not a warning, and it shows the pass ran on the right file.

Warning: Latch inferred for signal .... The signal is mask_next in module irq_ctrl, from the process starting at line 58 of irq_ctrl.v, and the last field names the new latch cell. In the source, this message is a warning under the default policy, an error under -latches error, and always an error when the process came from a SystemVerilog always_comb block. That last rule is worth using: write combinational logic as always_comb and an accidental latch stops the run. These are the eight DLH_X1 cells from Part 9.

Warning: Resizing cell port dsp_top.u_fir.coef_in from 16 bits to 12 bits. The module port is 16 bits wide; the signal connected at the instance is 12 bits. In this sample the four upper bits end up tied to zero. A testbench whose coefficient values never exceed 12 bits would not notice.

Setting constant 0-bit at position 12 to 15. The coefficient register inside u_fir can never load a one into bits 12 to 15, so opt_dff replaces those four flip-flop bits with constant zero. This line is the downstream effect of the resizing warning above. Note that it is not a warning; it is printed with the ordinary log function in constbits.cc.

Removed 214 unused cells and 391 unused wires. Normal in size for a pass that tidies after other optimizations. The comparison line at the bottom is what makes it interesting: the same pass removed 37 cells in the previous run. To list what went, rerun the pass under debug, which enables the per-cell debug lines the clean-up code prints for each removed cell.

The CHECK pass. The check pass looks for combinational loops, conflicting drivers, used wires with no driver, and unknown cell types. Here the four bits of u_crc.seed are read but nothing drives them: the seed port was left off the u_crc instance. Found and reported 4 problems. is the pass total.

Warnings: 6 unique messages, 6 total. The driver prints this summary at the end of the run. One latch, one resize, four undriven bits. Against a previous count of zero, every one of them is new.

Worked arithmetic check

Warning count. 1 latch + 1 resize + 4 undriven bits = 6, matching the summary. The opt_dff lines and the removal line are not in that count, which is why grepping for "Warning" alone misses them.

Latch width. One message, one signal. If mask_next is 8 bits wide, the latch cell is 8 bits wide and maps to 8 single-bit latches, which matches the eight DLH_X1 cells in Part 9.

What the resize costs. A 16-bit unsigned coefficient reaches 2^16 - 1 = 65535. With four bits tied to zero it reaches 2^12 - 1 = 4095. The usable range shrinks by a factor of 2^4 = 16. If the filter needs a gain coefficient above 4095, the silicon cannot be programmed to it.

Removed logic. 214 - 37 = 177 more cells removed than last run. If a hierarchical stat from the previous run showed a debug block of about that size, its output is the first place to look: an unconnected output port lets the whole cone behind it go.

A waiver that survives review

Some warnings are acceptable. A deliberate latch for clock gating, or a spare input tied on purpose, will appear every run. The Yosys logger command gives the tools to accept them precisely instead of hiding them:

logger -expect warning "Resizing cell port dsp_top.u_spare.cfg_in" 1
logger -expect-no-warnings
logger -werror "Latch inferred"

The first line accepts exactly one matching warning. The second, per the help text, gives an error if any warning appears that was not expected. The third turns any latch message into an error that ends the run with a nonzero code. For latches that are intended, SystemVerilog always_latch is the cleaner route: the proc_dlatch help text says such latches are exempt from the policy and reported at info level. Add check -assert at the end of the script so that any check problem fails the run.

Red flags table

Message or patternWhy it mattersWhat to ask
Latch inferred for signalUnintended state element; timing and test changeWhich branch misses an assignment?
Resizing cell portBits tied or dropped at an instanceWhich side has the wrong width?
is used but has no driverFloating input; simulation and netlist can differWhich instance port was left off?
multiple conflicting driversTwo sources fight on one netWhich assignments overlap?
Setting constant on a register meant to be programmableFunction lost, often from an upstream tie-offWhat holds its input constant?
Removed cell count far above the last runA block may have been deleted as unusedWhich outputs lost their loads?
Warning total up with no new waiverNew problems are entering quietlyWho reviewed each new message?

Sign-off checklist

  • Warning summary recorded and compared with the previous clean run.
  • Every latch traced to a source line and either fixed or declared with always_latch.
  • No resized ports or undriven wires without a written reason.
  • Every constant register bit explained by design intent.
  • Removal counts compared with the previous run; any jump traced to the cells removed.
  • Waivers written as exact expected messages with counts, not as blanket suppression.
  • Latch inference set to fail the run, and check -assert at the end of the script.

Next in the series: Reading a Liberty (.lib) File for Cells, Pins, Tables and Units.

Share Facebook X LinkedIn WhatsApp Email

Post a Comment

0 Comments

Your comments will be moderated before it appears here.

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn more
Ok, Go it!