read_spef drops coupling capacitors at pin nodes of nets that cross a hierarchy boundary

オープン
#477 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発

調査の方向性

Start in parasitics/SpefReader.cc, especially makeCapacitor around the lines cited in the issue, and compare its pin-node membership check with the hierarchy-aware checks in findParasiticNode. Reproduce with the supplied Verilog, SPEF, and Tcl files, both with and without -keep_capacitive_coupling, including hierarchical linking. Done when the reported wire capacitance is 3.0 fF in every case.

索引モデルが issue の本文から書いたものです。

説明

Description

Without -keep_capacitive_coupling, read_spef grounds each coupling capacitor at whichever of its two nodes belongs to the *D_NET being read. For a pin node, SpefReader::makeCapacitor decides that by testing parasitics_->net(node, network_) == net_ (parasitics/SpefReader.cc:554-557 on master 6183ae7, :541-544 at ef17b3fd). In a hierarchical network, a pin's net is its local net inside its module, not the net that the *D_NET names. The test then fails and the coupling capacitance at that pin is dropped without a warning. Ground capacitance, and coupling at internal net:N nodes, are kept. The missing capacitance makes load-dependent delay and switching power too low.

Reproducer

nangate45 from ORFS (PLATFORM_DIR=<ORFS>/flow/platforms/nangate45). Net n1 runs from u1/Z at the top level to m/u2/A inside module m. Its SPEF has 2.0 fF of ground capacitance at n1:1 and two 0.5 fF coupling capacitors to net out, one at u1:Z and one at m/u2:A.

top.v
module sub(input a, output y);
  BUF_X1 u2(.A(a), .Z(y));
endmodule
module top(input in, output out);
  wire n1;
  BUF_X1 u1(.A(in), .Z(n1));
  sub m(.a(n1), .y(out));
endmodule
top.spef
*SPEF "IEEE 1481-1998"
*DESIGN "top"
*DATE "x"
*VENDOR "x"
*PROGRAM "x"
*VERSION "x"
*DESIGN_FLOW "x"
*DIVIDER /
*DELIMITER :
*BUS_DELIMITER [ ]
*T_UNIT 1 NS
*C_UNIT 1 FF
*R_UNIT 1 KOHM
*L_UNIT 1 HENRY

*PORTS
in I
out O

*D_NET n1 3.0
*CONN
*I u1:Z O
*I m/u2:A I
*CAP
1 n1:1 2.0
2 u1:Z out:1 0.5
3 m/u2:A out:1 0.5
*RES
1 u1:Z n1:1 0.01
2 n1:1 m/u2:A 0.01
*END

*D_NET out 1.0
*CONN
*I m/u2:Z O
*P out O
*CAP
1 out:1 0.0
2 out:1 u1:Z 0.5
3 out:1 m/u2:A 0.5
*RES
1 m/u2:Z out:1 0.01
2 out:1 out 0.01
*END
repro.tcl
# PLATFORM_DIR: ORFS flow/platforms/nangate45. KEEP=1 adds -keep_capacitive_coupling.
# In openroad, HIER=1 links with -hier (standalone OpenSTA always keeps the hierarchy).
set p $::env(PLATFORM_DIR)
if {[info commands read_lef] ne ""} {
  read_lef $p/lef/NangateOpenCellLibrary.tech.lef
  read_lef $p/lef/NangateOpenCellLibrary.macro.mod.lef
}
read_liberty $p/lib/NangateOpenCellLibrary_typical.lib
read_verilog top.v
if {[info exists ::env(HIER)] && $::env(HIER)} { link_design -hier top } else { link_design top }
if {[info exists ::env(KEEP)] && $::env(KEEP)} {
  read_spef -keep_capacitive_coupling top.spef
} else {
  read_spef top.spef
}
report_net -digits 4 n1

sta repro.tcl, then KEEP=1 sta repro.tcl. In OpenROAD, also run with HIER=1.

Binary Link read_spef report_net n1 wire capacitance
OpenSTA (standalone, master) hierarchical (always) default 2.5 fF: the coupling at m/u2:A is dropped
OpenSTA (standalone, master) hierarchical -keep_capacitive_coupling 3.0 fF
openroad 943a4d2c and master e43fc43b6 link_design top default 3.0 fF
openroad 943a4d2c and master e43fc43b6 link_design -hier top default 2.0 fF: both coupling ends are dropped
openroad 943a4d2c and master e43fc43b6 link_design -hier top -keep_capacitive_coupling 3.0 fF

Expected: 3.0 fF in every case. The coupling capacitance is grounded at its ends on n1, as the flat link does and as -keep_capacitive_coupling totals show. Hierarchy should not change a net's capacitance.

In OpenROAD's hierarchical dbNetwork, even the top-level pin u1/Z resolves to its dbModNet, so both ends are dropped there. read_db turns hierarchy on whenever the database has modules, so this affects any SPEF read onto a hierarchical ORFS result. On ORFS gf180/jpeg (151 modules), 13,908 of 51,318 nets lost 19.7 pF in total, and report_power came out 1.2% low.

Suggested fix

Decide membership with the hierarchy-aware test that findParasiticNode already uses for its warnings: network_->isConnected(net_, pin) for pin nodes (SpefReader.cc:478) and network_->isConnected(net, net_) for net:N nodes. Comparing highestConnectedNet of both sides would also work.

Related, but a different code path: The-OpenROAD-Project/OpenROAD#11574, which covers -hier net/modnet mismatches in the pin-node external flag and in top-level-port nets.

Versions

OpenSTA ef17b3fd (as built in openroad 26Q3-2676-g943a4d2c92) and OpenROAD master e43fc43b6 (its src/sta is 42d5f38, plus a standalone opensta built from it). makeCapacitor is unchanged on OpenSTA master 6183ae7.

主要言語
Verilog
スター
658
フォーク
299
平均マージ
1日 12時間
マージ済み PR(30日)
28

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

The-OpenROAD-Project/OpenSTA のほかの issue

The-OpenROAD-Project/OpenSTA の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。