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

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

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

@dsengupta0628 がすでに取り組んでいます。

2026年10月22日 から。

  • #11841 @DeepDataFlow による — マージされずにクローズ

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
cpp

調査の方向性

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.

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

説明

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).
主要言語
Verilog
スター
3.4k
フォーク
1.1k
平均マージ
3日 11時間
マージ済み PR(30日)
245

環境構築

はじめの一歩

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

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

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

似ている issue

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

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

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