Hi people. I'm doing LVS with netgen on a metal resistor and it's giving me this warning. ```Subcir...
a
Hi people. I'm doing LVS with netgen on a metal resistor and it's giving me this warning.
Copy code
Subcircuit pins:
Circuit 1: resistor_metal                  |Circuit 2: resistor_metal_clean            
-------------------------------------------|-------------------------------------------
b                                          |b                                          
r0                                         |(no matching pin)                          
r1                                         |r1                                         
(no matching pin)                          |r0                                         
r0                                         |(no matching pin)                          
---------------------------------------------------------------------------------------
Cell pin lists for resistor_metal and resistor_metal_clean altered to match.
Device classes resistor_metal and resistor_metal_clean are equivalent.

Final result: Top level cell failed pin matching.
I've already performed lvs on a poly resistor and the two mimcaps, none of them gives something like this.
m
@aquiles viza This is actually a poly resistor. The layout only has text at the top level and no text or pin shapes at the lower level. If you’re extracting from gds, you can specify
flatglob *res_poly
before
gds read
. The extracted layout shows that the subcircuit
res_poly$1
is only extracted with 2 terminals and that the node names are auto generated.
Copy code
* NGSPICE file created from resistor_metal_clean.ext - technology: sky130A

.subckt res_poly$1 a_n703_n1362# a_n573_796#
X0 a_n573_796# a_n573_n1232# a_n703_n1362# sky130_fd_pr__res_high_po_5p73 l=8.12
.ends

.subckt resistor_metal_clean r0 r1 b
Xres_poly$1_0 b r1 res_poly$1
.ends
If you’d rather not use flatglob, you might try adding
met1
squares under
r0
and
r1
and a
li
square under
b
at the top level. My preference is to flatglob all levels that do not contain text, though.
a
Adding boxes of met1 and li1 solved the port problem and now it indicates
Circuits match uniquely
and
Property errors were found.
The schematic and layout has L=8 but the extracted netlist has L=8.12. This could be related with the use of guard ring? Magic command:
Copy code
drc off
gds drccheck off
gds rescale false

gds flatten yes
gds read /workspaces/Chipalooza2024_TempSensor_AC3E/modules/resistor_poly_hi/layout/resistor_poly_hi.gds
load resistor_poly_hi
box 0 0 0 0

readspice /workspaces/Chipalooza2024_TempSensor_AC3E/modules/resistor_poly_hi/output/extraction/schematic/resistor_poly_hi_noprefix.spice

puts "layout loaded :)"

cellname rename resistor_poly_hi resistor_poly_hi_clean

extract
ext2spice lvs
ext2spice -o "/workspaces/Chipalooza2024_TempSensor_AC3E/modules/resistor_poly_hi/output/extraction/layout_clean/resistor_poly_hi_clean.spice"

puts "Created netlist file /workspaces/Chipalooza2024_TempSensor_AC3E/modules/resistor_poly_hi/output/extraction/layout_clean/resistor_poly_hi_clean.spice"
quit -noprompt
Extracted spice:
Copy code
* NGSPICE file created from resistor_poly_hi_clean.ext - technology: sky130A

.subckt res_poly$1 a_n703_n1362# a_n573_796# a_n573_n1232#
X0 a_n573_796# a_n573_n1232# a_n703_n1362# sky130_fd_pr__res_high_po_5p73 l=8.12
.ends

.subckt resistor_poly_hi_clean r0 r1 b
Xres_poly$1_0 b r1 r0 res_poly$1
.ends
The flatglob commands didn't affect the output
Doing lvs with klayout returns the same 8.12 on the extracted circuit
Copy code
* Extracted by KLayout with SKY130 LVS runset on : 11/03/2024 04:24

.SUBCKT resistor_poly_hi r0 r1 B
R$1 r0 r1 B sky130_fd_pr__res_high_po_5p73 R=453.189528796 L=8.12 W=5.73
+ A=46.5276 P=27.7
.ENDS resistor_poly_hi
It seems that the klayout support for sky130 has a bug here, adding 0.12um. EDIT: This gap is totally intentional, line 156 in file
res_poly_child.py
, method
res_poly_draw.poly_res
. Hi @Amro Tork, do you know why is required to add 0.12 um to the resistor?
m
The actual layout length is 8.12. Why 0.12um is added when you use the device generator, I don’t know. The flatglob command needs the name of the cell as magic interprets it. From your extracted netlist above, maybe
flatglob res_poly*
would work.
@Tim Edwards In regards to text without a corresponding drawing layer, is it possible that magic moves the text? The gds in the
lvs-problem.zip
file above consists of a pcell with no text and a top level with the pcell instance and text only. With only text on the upper level, the extraction misses a connection. (no
r0
connection at the top level, resistor only has 2 ports).
Copy code
* NGSPICE file created from resistor_metal_clean.ext - technology: sky130A

.subckt res_poly$1 a_n703_n1362# a_n573_796#
X0 a_n573_796# a_n573_n1232# a_n703_n1362# sky130_fd_pr__res_high_po_5p73 l=8.12
.ends

.subckt resistor_metal_clean r0 r1 b
Xres_poly$1_0 b r1 res_poly$1
.ends
By adding small rectangles of the appropriate layers at the top level, extraction is correct.
Copy code
* NGSPICE file created from resistor_poly_hi_clean.ext - technology: sky130A

.subckt res_poly$1 a_n703_n1362# a_n573_796# a_n573_n1232#
X0 a_n573_796# a_n573_n1232# a_n703_n1362# sky130_fd_pr__res_high_po_5p73 l=8.12
.ends

.subckt resistor_poly_hi_clean r0 r1 b
Xres_poly$1_0 b r1 r0 res_poly$1
.ends
Is there an option to prevent magic from moving text?
t
@Mitch Bailey: Within magic, declaring the label as "sticky" (
setlabel sticky
) will prevent magic from reassigning the layer type. For GDS read, the input style needs to have
options no-reconnect-labels
. I am not sure why the tech file for magic for sky130 doesn't have this option set.
👍 1
a
setlabel sticky
and
options no-reconnect-labels
are instructions that should be set on the magicrc for all designs?
t
@aquiles viza: No.
setlabel sticky
should be applied to individual labels when they're created in magic (it's also a checkbox in the text GUI window under
Edit-->Text...
).
options no-reconnect-labels
has to be applied to the magic tech file; it's a setting in the
cifinput
section, and it doesn't have a command equivalent (there are a number of things in the tech file that ought to have command-line equivalents, but don't).
The easier solution, though, is just to never create label text without its underlying metal in the same cell as the label text.