rcx: wrong OVER/UNDER table used when the rules LayerCount exceeds the routing layer count
メンテナーはふだん 1 日以内に返信
@AcKoucher がすでに取り組んでいます。
2026年11月4日 から。
評価
調査の方向性
Read src/rcx/src/extModelGen.cpp's getMetIndexOverUnder() alongside getOverUnderRC() and getOverUnderFringeRC() in src/rcx/src/extRCmodel.cpp; trace how the rules-file and technology layer counts reach the lookup. Run the public gist's run.sh testcase with the four rules files. Done means the mismatched-layer cases no longer silently use another table, with results matching the intended tables or an explicit warning/error.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
When the extraction rules file declares more layers than the technology has routing layers, OpenRCX stores the Metal m OVER u UNDER o tables with the layer count of the rules file and looks them up with the smaller of the two layer counts.
For u >= 2 the lookup silently returns another table.
This happens with IHP's sg13cmos5l, which has 5 routing layers (Metal1 to Metal4, TopMetal1).
Its LibreLane configuration points RCX_RULES at ihp-sg13cmos5l/libs.tech/librelane/IHP_rcx_patterns.rules, a symlink to the sg13g2 rules, which declare LayerCount 7.
Tables are stored with 8 levels and looked up with 6:
| wire | intended table | stored index | looked-up index | table actually read |
|---|---|---|---|---|
| Metal3 over Metal2, under Metal4 | Metal 3 OVER 2 UNDER 4 | 4 | 2 | Metal 3 OVER 1 UNDER 6 |
| Metal3 over Metal2, under layer 5 | Metal 3 OVER 2 UNDER 5 | 5 | 3 | Metal 3 OVER 1 UNDER 7 |
| Metal4 over Metal2, under layer 5 | Metal 4 OVER 2 UNDER 5 | 3 | 1 | Metal 4 OVER 1 UNDER 6 |
| Metal4 over Metal3, under layer 5 | Metal 4 OVER 3 UNDER 5 | 6 | 2 | Metal 4 OVER 1 UNDER 7 |
The tables actually read describe layers 6 and 7, which this technology does not have.
In the sg13g2 rules, the first and last rows of these tables hold 0.51 to 0.99 times the capacitance of the intended ones, so the affected wires are under-estimated.
For u = 1 both indices coincide, so OVER 1 UNDER o configurations are not affected.
Expected Behavior
The two canary rules files of the test case differ from the 7-layer rules only in one table that involves layer 6 or 7, so they should give exactly the same parasitics as the unmodified rules.
A Metal3 wire over Metal2 and under Metal4 should be extracted with Metal 3 OVER 2 UNDER 4, as it is when the same tables are written for 5 layers.
If a rules file with more layers than the technology is not supported, a warning or an error would be expected rather than a silent lookup of another table.
Environment
OpenROAD 26Q3-2676-g943a4d2c92 (openroad -version), commit 943a4d2c9284cce991a916b67937157d890fe133
kernel: Linux 7.2.9-100.fc43.x86_64
os: Fedora Linux 43 (Cloud Edition)
The code involved is unchanged on master at 85eb56c8d32a29e085cfb5ca6af660d5ef6e1a5e (2026-10-30)
IHP-Open-PDK files from commit cfc0e22b92306178ebb5a5bc4865afe3294654d0, identical on dev at 456dd2dc707331568cbff0dbc27a1a0c4d463cc2
To Reproduce
The test case is in this public gist: https://gist.github.com/jalcim/7a72e17ae39d4fc87baa109a51de216d
It contains:
sg13cmos5l_tech.lef:ihp-sg13cmos5l/libs.ref/sg13cmos5l_stdcell/lef/sg13cmos5l_tech.leffrom IHP-Open-PDK (md5 6de91dee01b042e594c47e667c62e584);IHP_rcx_patterns.rules:ihp-sg13g2/libs.tech/librelane/openrcx/IHP_rcx_patterns.rulesfrom IHP-Open-PDK (md5 bdc5a2bc1a3464df7295eb3ae3f69fb9), withLayerCount 7;canary_m3.rules: the same file with onlyMetal 3 OVER 1 UNDER 6multiplied by two;canary_m4.rules: the same file with onlyMetal 4 OVER 1 UNDER 7multiplied by two;rules_5layers.rules: the same tables written for 5 layers (LayerCount 5), each table kept under its own title;crossings.def: no cell, a 100 um Metal3 wire and a 100 um TopMetal1 wire on one horizontal track, crossed by 100 stacked Metal2 and Metal4 vertical columns at a 0.96 um pitch, so that the Metal3 wire is over Metal2 and under Metal4, and each Metal4 column is over Metal3 and under TopMetal1;make_testcase.py, which wrote the four files above fromIHP_rcx_patterns.rules;flow.tclandrun.sh.
git clone https://gist.github.com/jalcim/7a72e17ae39d4fc87baa109a51de216d openrcx-overunder-testcase
cd openrcx-overunder-testcase
sh run.sh openroad
run.sh runs flow.tcl once per rules file and prints the capacitance of the Metal3 wire, of the TopMetal1 wire, and summed over the Metal2 and Metal4 columns, in pF:
read_lef sg13cmos5l_tech.lef
read_def crossings.def
set_extraction_rules_file $::env(RULES)
define_process_corner -ext_model_index 0 CURRENT_CORNER
extract_parasitics -lef_res
write_spef $::env(SPEF)
Relevant log output
IHP_rcx_patterns n_m3 0.00869129 n_tm1 0.00935967 m2_columns 0.125531 m4_columns 0.130004
canary_m3 n_m3 0.0170547 n_tm1 0.00935967 m2_columns 0.125531 m4_columns 0.130004
canary_m4 n_m3 0.00869129 n_tm1 0.00935967 m2_columns 0.125531 m4_columns 0.141623
rules_5layers n_m3 0.015104 n_tm1 0.00935967 m2_columns 0.125531 m4_columns 0.134083
The same values in fF:
| rules | Metal3 wire | TopMetal1 wire | 100 Metal2 columns | 100 Metal4 columns |
|---|---|---|---|---|
| IHP_rcx_patterns.rules, 7 layers | 8.691 | 9.360 | 125.531 | 130.004 |
| canary_m3.rules | 17.055 | 9.360 | 125.531 | 130.004 |
| canary_m4.rules | 8.691 | 9.360 | 125.531 | 141.623 |
| rules_5layers.rules | 15.104 | 9.360 | 125.531 | 134.083 |
Doubling Metal 3 OVER 1 UNDER 6, a table of a layer that does not exist, takes the Metal3 wire from 8.691 to 17.055 fF.
Doubling Metal 4 OVER 1 UNDER 7 takes the Metal4 columns from 130.004 to 141.623 fF.
The log has no message about the layer count mismatch, only RCX-0114 for the nets of this test case, which have no pins.
extract_parasitics -ext_model_file <rules> -lef_res, as LibreLane calls it, gives the same values.
Additional Context
Links at 943a4d2c9284cce991a916b67937157d890fe133:
extRCModel::getMetIndexOverUnder()computes(layerCnt - met - 1) * (mUnder - 1) + (mOver - met - 1): https://github.com/The-OpenROAD-Project/OpenROAD/blob/943a4d2c9284cce991a916b67937157d890fe133/src/rcx/src/extModelGen.cpp#L369-L384- reading
LayerCount 7sets_layerCnt = 8: https://github.com/The-OpenROAD-Project/OpenROAD/blob/943a4d2c9284cce991a916b67937157d890fe133/src/rcx/src/extRCmodel.cpp#L3635 - the over/under tables are allocated and filled with that count, in
allocOverUnderTable()andreadRulesOverUnder(): https://github.com/The-OpenROAD-Project/OpenROAD/blob/943a4d2c9284cce991a916b67937157d890fe133/src/rcx/src/extRCmodel.cpp#L1615-L1633 and https://github.com/The-OpenROAD-Project/OpenROAD/blob/943a4d2c9284cce991a916b67937157d890fe133/src/rcx/src/extRCmodel.cpp#L1400-L1445 extMain::run()setsm._layerCntto the smaller ofgetExtLayerCnt(_tech) + 1, 6 here, and the model layer count, 8 here: https://github.com/The-OpenROAD-Project/OpenROAD/blob/943a4d2c9284cce991a916b67937157d890fe133/src/rcx/src/netRC.cpp#L1779-L1784extMeasure::getOverUnderFringeRC()andextMeasure::getOverUnderRC()pass that_layerCnttogetMetIndexOverUnder(): https://github.com/The-OpenROAD-Project/OpenROAD/blob/943a4d2c9284cce991a916b67937157d890fe133/src/rcx/src/extRCmodel.cpp#L1981-L2010- the only exception,
techLayerCnt == 5 && modelLayerCnt == 8, covers a technology with 4 routing layers and rules withLayerCount 7, and has been there without a comment since OpenRCX was imported into this repository in 1331f74dda: https://github.com/The-OpenROAD-Project/OpenROAD/commit/1331f74ddafde0f161e43980963bcfce5556173a
A possible fix is to compute the over/under index in getOverUnderRC() and getOverUnderFringeRC() with the layer count the tables were built with, rcModel->_layerCnt, a public member of extMetRCTable set from the rules file, which would make the special case unnecessary: https://github.com/The-OpenROAD-Project/OpenROAD/blob/943a4d2c9284cce991a916b67937157d890fe133/src/rcx/include/rcx/extRCap.h#L452
This change has not been built or tested.
A warning when the rules file declares more layers than the technology has routing layers would at least make the mismatch visible.
The sg13cmos5l rules proposed in IHP-Open-PDK PR #1237 declare LayerCount 5 and avoid this case: https://github.com/IHP-GmbH/IHP-Open-PDK/pull/1237#issuecomment-6511651800
- 主要言語
- Verilog
- スター
- 3.3k
- フォーク
- 1.1k
- 平均マージ
- 3日 11時間
- マージ済み PR(30日)
- 247
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
The-OpenROAD-Project/OpenROAD のほかの issue
-
drt: min-area patch owner search compares the origin-relative patch box with absolute shapes, so patches are dropped対応中かも @bnmfw が 11 日前に担当しました。 オープンbug drt
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
The-OpenROAD-Project/OpenROAD#12191 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
odb LEF58_MINIMUMCUT: per-cut-class form never sets isPerCutClass, so drt silently drops the rule対応中かも @LucasYuki が 25 日前に担当しました。 オープンbug drt odb
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
The-OpenROAD-Project/OpenROAD#12176 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
drt: LEF58_SPACING ENDOFLINE MINLENGTH l TWOSIDES is checked one-sided (io passes the TWOEDGES flag as TWOSIDES)対応中かも @osamahammad21 が 25 日前に担当しました。 オープンbug drt
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
The-OpenROAD-Project/OpenROAD#12173 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
cleanup-opportunity: BUILD files never refer to mockturtle in third-partty/再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbazel enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
The-OpenROAD-Project/OpenROAD#12160 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
odb: Bazel build fails on linux/aarch64 — char fc compared to EOF in def/lef lexers対応中かも @shivarammysore が 32 日前に担当しました。 オープンbazel bug odb
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
The-OpenROAD-Project/OpenROAD#12095 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
The-OpenROAD-Project/OpenROAD の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
superfly/contextwindow#18 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
Lincoln-cn/JAiRouter#1452 ·
メンテナーはふだん 1 日以内に返信
-
accepted
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
future-agi/future-agi#6351 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信