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

Abierto
#477 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Verilog
Estrellas
658
Forks
299
Merge medio
1 d 12 h
PR fusionados (30 d)
28

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de The-OpenROAD-Project/OpenSTA

Todos los issues de The-OpenROAD-Project/OpenSTA

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.