rcx: wrong OVER/UNDER table used when the rules LayerCount exceeds the routing layer count

Abierto
#12,072 2 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@AcKoucher ya está trabajando en esto.

Desde el 4/11/2026.

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
Stack tecnológico
cpp
Área
backend

Línea de trabajo

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.

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

Descripción

bug rcx
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.lef from IHP-Open-PDK (md5 6de91dee01b042e594c47e667c62e584);
  • IHP_rcx_patterns.rules: ihp-sg13g2/libs.tech/librelane/openrcx/IHP_rcx_patterns.rules from IHP-Open-PDK (md5 bdc5a2bc1a3464df7295eb3ae3f69fb9), with LayerCount 7;
  • canary_m3.rules: the same file with only Metal 3 OVER 1 UNDER 6 multiplied by two;
  • canary_m4.rules: the same file with only Metal 4 OVER 1 UNDER 7 multiplied 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 from IHP_rcx_patterns.rules;
  • flow.tcl and run.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:

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

Lenguaje dominante
Verilog
Estrellas
3.3k
Forks
1.1k
Merge medio
3 d 11 h
PR fusionados (30 d)
247

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.