Skip to content

Add ReportFieldExtension plugin API for report_checks -fields#434

Closed
dsengupta0628 wants to merge 1 commit into
parallaxsw:masterfrom
dsengupta0628:report-field-extensions
Closed

Add ReportFieldExtension plugin API for report_checks -fields#434
dsengupta0628 wants to merge 1 commit into
parallaxsw:masterfrom
dsengupta0628:report-field-extensions

Conversation

@dsengupta0628
Copy link
Copy Markdown
Contributor

@dsengupta0628 dsengupta0628 commented May 11, 2026

Motivation

report_checks -fields {...} currently supports a fixed set of column
keywords (capacitance, slew, fanout, input_pin, net, src_attr).
Tools layered on top of OpenSTA (resizer, clustering passes, etc.) often
want to surface tool-specific per-pin data alongside timing in the same
report. Today that requires patching OpenSTA core for each new column.

What this adds

A plugin interface so external producers can register columns without
modifying OpenSTA core:

  cpp
  class ReportFieldExtension {
   public:
    virtual std::string_view name() const = 0;   // -fields token
    virtual std::string_view title() const = 0;  // column header
    virtual size_t width() const = 0;
    virtual std::string value(const Path*, const Pin*, const Instance*) const = 0;
  };

  // Sta.hh
  void Sta::registerReportFieldExtension(ReportFieldExtension *ext);  // owns ext

Behavior

  • report_checks -fields {...} tokens not matching a built-in keyword are
    forwarded to C++ as StringSeq extension_names. ReportPath::setReportFields
    resolves each against registered extensions. Unmatched → STA-0168 warn.
  • A ReportField is created once per registered extension (disabled by
    default); setReportFields toggles enable + assigns a buffer slot.
  • reportPathLine/reportPath6 call collectExtensionValues(path, pin, inst, buf) per row, which invokes ext->value(...) for each enabled extension-backed field.
  • The inner reportLine dispatches via field->extensionIndex() (O(1) per
    field; no name lookup on the hot path).
  • Duplicate registration of the same extension name is a silent no-op
    (tolerates re-init in long-lived Sta hosts).
  • Zero overhead when no extensions are enabled (enabled_extension_count_
    short-circuits the per-row collect).

Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
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