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

Aperta
#477 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Verilog
Stelle
655
Fork
296
Merge medio
1g 12h
PR unite (30g)
28

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di The-OpenROAD-Project/OpenSTA

Tutte le issue di The-OpenROAD-Project/OpenSTA

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.