Skip to content

[ENG-2598] Summarize unmatched-register warnings in reg_rename - #296

Closed
akashlevy wants to merge 1 commit into
mainfrom
akash/eng-2598-reg-rename-unmatched-summary
Closed

[ENG-2598] Summarize unmatched-register warnings in reg_rename#296
akashlevy wants to merge 1 commit into
mainfrom
akash/eng-2598-reg-rename-unmatched-summary

Conversation

@akashlevy

Copy link
Copy Markdown

Summary

  • reg_rename logged one Unable to find matching register warning per unmatched FF cell, which produced tens of thousands of lines on large designs even when matching under the power scope was complete.
  • Unmatched cells are collected first, then the pass logs 8 examples plus a total count.

Fixes ENG-2598.

Test plan

  • make -C tests/silimate reg_rename.ys (12 named FFs, VCD dumps one of them → 8 example warnings + total unmatched: 11)
  • Spot-check a large power run: unmatched warnings stay a handful of lines, annotation still proceeds.

Made with Cursor

Per-cell warnings flooded the log on large designs; keep a few examples
and a total count instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@linear-code

linear-code Bot commented Aug 27, 2026

Copy link
Copy Markdown

ENG-2598

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Greptile Summary

The PR changes reg_rename to collect unmatched flip-flop diagnostics and emit at most eight detailed warnings followed by a total count, with a focused RTLIL/VCD regression test.

  • Adds an unmatched-register record and propagates its collection through hierarchical processing.
  • Replaces per-cell warning emission with bounded output and a summary line.
  • Adds a 12-register fixture whose waveform leaves 11 registers unmatched and asserts the resulting warning counts.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking opportunity to bound diagnostic memory usage as well as warning output.

Warning aggregation preserves matching and annotation behavior, and the new regression test exercises the intended output, but retaining three strings for every unmatched cell adds avoidable scaling overhead.

Files Needing Attention: passes/silimate/reg_rename.cc

Important Files Changed

Filename Overview
passes/silimate/reg_rename.cc Correctly bounds warning output, but unnecessarily retains full string records for every unmatched cell rather than counting entries after the first eight.
tests/silimate/reg_rename.ys Adds a harness-discovered regression script that consistently expects eight examples and one summary for eleven unmatched cells.
tests/silimate/reg_rename.il Provides twelve named one-bit flip-flops for the warning-aggregation test.
tests/silimate/reg_rename_unmatched.vcd Dumps only q0 so the test fixture deterministically produces eleven unmatched register cells.

Reviews (1): Last reviewed commit: "[ENG-2598] Summarize unmatched-register ..." | Re-trigger Greptile

if (layout_it == reg_layouts.end()) {
log_warning("Unable to find matching register %s in VCD for cell %s in scope %s\n",
reg.c_str(), log_id(cell->name), vcd_scope.c_str());
unmatched.push_back({reg, log_id(cell->name), vcd_scope});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unbounded diagnostic storage

For a large design with many unmatched flip-flops, this appends three owned strings for every cell even though only the first eight records are displayed; retain only those examples and increment a separate total to avoid unnecessary O(N) diagnostic memory and allocations.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@akashlevy

Copy link
Copy Markdown
Author

I don't think this is critical, having the warnings is good for now, because customer can just share the log

@akashlevy akashlevy closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant