write_spef: tool-created objects inside a sub-module are written without their module path (hierarchical db)

Abierto
#11,839 1 comentario 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@dsengupta0628 ya está trabajando en esto.

Desde el 22/10/2026.

  • #11841 de @DeepDataFlow — cerrado sin fusionar

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
cpp

Línea de trabajo

Start in extSpef, where the issue says instance and net names are written, and trace how module ownership is represented in dbNetwork. Reproduce the hierarchical case from src/rcx/test using hier.v and repro.tcl, then compare names in out.spef with the module placement in out.v. Done means standalone OpenSTA matches the inserted buffer and clock net names, with parasitics annotated; linked PR #11841 is already open.

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

Descripción

bug rcx
Describe the bug

In a hierarchical db (read_verilog + link_design -hier), read_verilog stores instance and net names as full paths, e.g. u_sub/n1. Objects that a tool creates later inside a sub-module, such as CTS clock buffers and clock nets, keep a plain db name and record their module through dbInst::getModule().

write_verilog places such an object in its module, so the netlist names it u_sub/clkbuf_0. write_spef writes the plain db name clkbuf_0. In the same SPEF, nets of the same module that came from read_verilog are written with their path (u_sub/n1), so the output is inconsistent.

A standalone STA that reads the written Verilog plus the SPEF, the usual signoff setup, cannot match these names. Every CTS buffer and clock net inside a sub-module ends up without parasitics. OpenROAD's own read_spef on the same db does not show the problem, because it looks names up in the db.

On an OpenTitan earlgrey chip (sky130, hierarchical flow), OpenSTA on the written .v + .spef reported 48,926 "instance not found" and 431,493 "net not found" warnings, and the clock tree was unannotated.

Expected Behavior

write_spef names every instance and net the way write_verilog places it. For an object owned by module instance u_sub, that is u_sub/clkbuf_0 and u_sub/clknet_0, like u_sub/n1.

Environment
Git commit: 99bd6268d82d13c42d430c6bf205c86e9172a8a3 (upstream master, 2026-10-20)
OpenSTA commit: 3ebab02e2e6572925962bb157f9a406e30a38c3a
Build: CMake, Release, GNU 11.4.0, in an ubuntu:22.04 container
       (etc/DependencyInstaller.sh -all -cmake)
Run on: Ubuntu 25.04, Linux 6.14.0 x86_64
To Reproduce

Files from src/rcx/test (Nangate45). hier.v:

module sub (clk_in, d, q);
  input clk_in;
  input d;
  output q;
  wire n1;

  BUF_X1 u_root (.A(clk_in), .Z(n1));
  DFF_X1 ff (.CK(n1), .D(d), .Q(q));
endmodule

module top (clk, d, q);
  input clk;
  input d;
  output q;

  sub u_sub (.clk_in(clk), .d(d), .q(q));
endmodule

repro.tcl (run in src/rcx/test). It inserts a buffer the way CTS does: a plain name, owned by module sub.

source helpers.tcl
source Nangate45/Nangate45.vars
read_lef $tech_lef
read_lef $std_cell_lef
read_liberty $liberty_file
read_verilog hier.v
link_design top -hier
initialize_floorplan -site $site -utilization 10 -core_space 0.0
source $tracks_file
place_pins -hor_layers $io_placer_hor_layer -ver_layers $io_placer_ver_layer

set block [ord::get_db_block]
set buf [odb::dbInst_create $block [[ord::get_db] findMaster BUF_X1] clkbuf_0]
[$block findModule sub] addInst $buf
set clknet [odb::dbNet_create $block clknet_0]
set ck [[$block findInst u_sub/ff] findITerm CK]
$ck disconnect
$ck connect $clknet
[$buf findITerm A] connect [$block findNet u_sub/n1]
[$buf findITerm Z] connect $clknet

set x 0
foreach name {u_sub/u_root clkbuf_0 u_sub/ff} {
  set i [$block findInst $name]
  $i setLocation $x 0
  $i setPlacementStatus PLACED
  incr x 5700
}
detailed_placement
set_routing_layers -signal $global_routing_layers
global_route
detailed_route -verbose 0
define_process_corner -ext_model_index 0 X
set_extraction_rules_file $rcx_rules_file
extract_parasitics
write_spef out.spef
write_verilog out.v

Then in standalone OpenSTA:

read_liberty Nangate45/Nangate45_typ.lib
read_verilog out.v
link_design top
read_spef out.spef
report_parasitic_annotation
Relevant log output

SPEF name map: the synthesized net has its path, the inserted buffer and net do not.

*4 u_sub/n1
*5 clknet_0
*6 u_sub/ff
*7 u_sub/u_root
*8 clkbuf_0

out.v puts both inside module sub:

module sub (clk_in, ...
 wire clknet_0;
 BUF_X1 clkbuf_0 (.A(n1),
    .Z(clknet_0));

OpenSTA:

Warning 1650: out.spef line 43, net clknet_0 not found.
Warning 1648: out.spef line 46, instance clkbuf_0:Z not found.
Warning 1648: out.spef line 81, instance clkbuf_0:A not found.
Found 2 unannotated drivers.
Found 1 partially unannotated drivers.
Additional Context
  • The fix is in extSpef (instance and net names); a PR follows. It adds a lookup fallback in dbNetwork, so OpenROAD's own read_spef still matches the new names on the same db.
  • Related: CTS dummy loads in hierarchical designs (separate issue).
Lenguaje dominante
Verilog
Estrellas
3.4k
Forks
1.1k
Merge medio
3 d 11 h
PR fusionados (30 d)
245

Preparar el entorno

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/OpenROAD

Todos los issues de The-OpenROAD-Project/OpenROAD

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.