Skip to content

upf: add supply-net commands, upf_version, and supply options (#5617)#10720

Open
saurav-fermions wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
Fermions-ASI:fix/5617
Open

upf: add supply-net commands, upf_version, and supply options (#5617)#10720
saurav-fermions wants to merge 3 commits into
The-OpenROAD-Project:masterfrom
Fermions-ASI:fix/5617

Conversation

@saurav-fermions

Copy link
Copy Markdown
Contributor

Summary

Adds a coherent, tested subset of the UPF supply-net commands, upf_version, and supply options that the UPF reader was missing, mapped onto existing ODB structures. Scoped conservatively: anything requiring new ODB schema is explicitly deferred.

Type of Change

  • New feature

Impact

UPF scripts using the added commands now parse and apply instead of erroring; existing flows unaffected.

Verification

  • Local build succeeds.
  • Relevant tests pass (rebuilt from source): ctest -R '^upf\.' 5/5.
  • Code follows the repository's formatting guidelines.
  • I have signed my commits (DCO).

Related Issues

Fixes #5617


Developed with SAIGE, Fermions' autonomous RTL/EDA debugging agent; root-caused, tested, and signed off by the submitter (@saurav-fermions).

@saurav-fermions saurav-fermions requested a review from a team as a code owner June 21, 2026 05:16

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for UPF supply ports, supply nets, and versioning in OpenROAD. Since the odb schema lacks dedicated objects for these constructs, they are persisted as string properties on the block, power domain, or isolation strategy. The changes include new C++ functions, SWIG/Tcl bindings, and integration tests. Feedback is provided regarding connect_supply_net, which currently overwrites the connection property with the last port specified; it should instead append ports to support connecting a supply net to multiple supply ports.

Comment thread src/upf/src/upf.cpp Outdated
}
}

setStringProperty(block, kSupplyNetConnPrefix + net, port);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Currently, connect_supply_net overwrites the connection property kSupplyNetConnPrefix + net with the last port specified. In UPF, a supply net can be connected to multiple supply ports (e.g., via -ports {VDD1 VDD2}). To support multiple port connections correctly, we should append the port to the existing space-separated list of ports instead of overwriting it.

  const std::string conn_prop = kSupplyNetConnPrefix + net;
  odb::dbStringProperty* prop = odb::dbStringProperty::find(block, conn_prop.c_str());
  if (prop != nullptr) {
    std::string existing = prop->getValue();
    if (!existing.empty() && !port.empty()) {
      existing += " " + port;
    } else if (existing.empty()) {
      existing = port;
    }
    prop->setValue(existing.c_str());
  } else {
    odb::dbStringProperty::create(block, conn_prop.c_str(), port.c_str());
  }

@maliberty maliberty requested review from LucasYuki and removed request for maliberty June 22, 2026 20:25
@maliberty

Copy link
Copy Markdown
Member

Code should be formatted with clang-format

src/upf/src/upf.cpp:84:30: error: code should be clang-formatted [-Wclang-format-violations]
  odb::dbStringProperty* prop = odb::dbStringProperty::find(block, name.c_str());
                             ^
src/upf/src/upf.cpp:220:30: error: code should be clang-formatted [-Wclang-format-violations]
  odb::dbStringProperty* prop

…enROAD-Project#5617)

Implements a conservative, tested subset of the missing UPF surface from
issue The-OpenROAD-Project#5617 that maps onto existing odb structures without a schema bump:

New commands:
  - upf_version        (validate known versions, store as block property)
  - create_supply_port (store as block string-property)
  - create_supply_net  (store as block property, supports -domain/-reuse)
  - connect_supply_net (validate net/port refs, store connection)

New options on existing commands:
  - create_power_domain -include_scope (maps to '.' element) and -supply
    (stored as a property on the domain)
  - set_isolation -isolation_supply / -source / -sink (stored as
    properties on the dbIsolation object)

Supply-net/port constructs have no dedicated odb object, so they are
persisted via the generic dbStringProperty mechanism, keeping them
queryable and round-trippable through DB save/load without new schema.

PST, create_supply_set, set_port_attributes, and add_port_state are
deferred (they require new odb schema). See AGENT_REPORT.md.

Adds src/upf/test/supply.tcl exercising all new commands/options and
asserting the resulting odb state, registered in both CMake and Bazel.

Signed-off-by: Saurav Singh <saurav.singh@fermions.co>
connect_supply_net is invoked once per port (the tcl loops over -ports),
so overwriting the connection property kept only the last port and
silently dropped earlier ones. Store the ports as a space-separated,
de-duplicated list instead, and extend supply.tcl to cover the
multi-port case.

Addresses gemini-code-assist review on The-OpenROAD-Project#10720.

Signed-off-by: Saurav Singh <saurav.singh@fermions.co>
@saurav-fermions

Copy link
Copy Markdown
Contributor Author

Both addressed: clang-format is clean now, and connect_supply_net appends to a de-duplicated, space-separated list instead of overwriting — the tcl wrapper calls it once per port, so multi-port nets were losing all but the last port. I also extended supply.tcl to cover the multi-port case (it fails on the old overwrite behavior and passes now).

@maliberty

Copy link
Copy Markdown
Member

Needs a tclfmt as well. @LucasYuki I'll leave the functional review to you.

Apply tclfmt (spaces-in-braces) to the test per repo Tcl style.

Addresses @maliberty review on The-OpenROAD-Project#10720.

Signed-off-by: Saurav Singh <saurav.singh@fermions.co>
@saurav-fermions

Copy link
Copy Markdown
Contributor Author

Done — ran tclfmt on supply.tcl (it's clean now) and rebuilt + re-ran upf.supply, still passing. Thanks @LucasYuki, over to you for the functional review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing UPF commands and options

2 participants