RTimothyEdwards / magic

Magic VLSI Layout Tool
Other
495 stars 103 forks source link

extresist : output of TOP.res.ext halts at 98,304 bytes with a segmentation fault error message. #301

Closed 3zki closed 7 months ago

3zki commented 7 months ago

I am using Magic 8.3 revision 473.

When performing parasitic resistance extraction (extresist) on a complex layout, "Segmentation fault" was displayed and failed.

I modified the layout and tried several times, but TOP.res.ext always stops outputting at 98,304 bytes with a "Segmentation fault" error message.

Here are the last two lines of the TOP.res.ext (98,304 bytes) that I got.

resist "a_n14759_31476.n138" "a_n14759_31476.t112" 43.6286
resist "a_n14759_31476.n150" "a_n1

The other files (TOP.ext, TOP.sim, TOP.spice) could output more than 98,304 bytes.

d-m-bailey commented 7 months ago

@3zki Can you at least share the magic commands that you are using to extract the layout.

3zki commented 7 months ago

(sorry I made a mistake)

@d-m-bailey Here are the commands I ran

% gds read "layout_flatten.gds"
% load TOP
% select top cell
% expand
% extract all
% ext2sim labels on
% ext2sim
% extresist tolerance 10
% extresist simplify on
% extresist

Log:

user@DESKTOP:~$ magic -dnull -noconsole

Magic 8.3 revision 473 - Compiled on Sun Apr 14 01:22:16 JST 2024.
Starting magic under Tcl interpreter
Using the terminal as the console.
Using NULL graphics device.
Processing system .magicrc file
Sourcing design .magicrc for technology gf180mcuD ...
10 Magic internal units = 1 Lambda
Input style import: scaleFactor=10, multiplier=2
The following types are not handled by extraction and will be treated as non-electrical types:
    obsactive mvobsactive filldiff fillpoly m1hole obsm1 fillm1 obsv1 m2hole obsm2 fillm2 obsv2 m3hole obsm3 fillm3 m4hole obsm4 fillm4 m5hole obsm5 fillm5 glass fillblock lvstext obscomment
Scaled tech values by 10 / 1 to match internal grid scaling
Loading gf180mcuD Device Generator Menu ...
Using technology "gf180mcuD", version 1.0.470-0-g6d4d117
% gds read "layout_flatten.gds"
Warning: Calma reading is not undoable!  I hope that's OK.
Library written using GDS-II Release 6.0
Library name: LIB
Reading "TOP".
% load TOP
% select top cell
Topmost cell in the window
% expand
% extract all
Extracting TOP into TOP.ext:
% ext2sim labels on
% ext2sim
exttosim finished.
% extresist tolerance 10
% extresist simplify on
% extresist
Port: name = vdd exists, forcing drivepoint
Location is (-20546, -3587); drivepoint (-20547, -3588)
Port: name = vout exists, forcing drivepoint
Location is (18504, 70628); drivepoint (18504, 70628)
Port: name = vss exists, forcing drivepoint
Location is (-20379, -7397); drivepoint (-20380, -7398)
Adding  a_n4171_8677#; Tnew = 0.02ns, Told = 0.00ns
Adding  a_n3884_17415#; Tnew = 0.02ns, Told = 0.00ns
Adding  a_n16913_8764#; Tnew = 0.14ns, Told = 0.00ns
Adding  w_n17293_8626#; Tnew = 20.04ns, Told = 0.00ns
Adding  a_n10549_8764#; Tnew = 0.09ns, Told = 0.02ns
Adding  w_8627_2519#; Tnew = 7.29ns, Told = 0.00ns
Adding  a_n7393_5583#; Tnew = 0.18ns, Told = 0.00ns
Adding  a_n14675_11203#; Tnew = 0.19ns, Told = 0.00ns
Adding  a_n14759_31476#; Tnew = 0.46ns, Told = 0.00ns
Segmentation fault
user@DESKTOP:~$

Then magic crashed leaving 98,304 bytes of TOP.res.ext.

RTimothyEdwards commented 7 months ago

@3zki : There is a known issue in extresist for non-manhattan geometry of a device; I have seen this cause a segfault when extracting the ESD transistors (with flanged 45 degree gates) in the sky130 I/O pads. I'm not aware of any non-manhattan device geometry in gf180mcuD, though. Can you please share the layout?

3zki commented 7 months ago

@RTimothyEdwards Here it is. https://github.com/ishi-kai/Chipathon2023_ADC/blob/main/noritsuna/ldo/waffle/ldo_pex_7_waffle.zip

Labels are placed on the metal1 34/0 layer (instead of the metal1_label 34/10 layer) in the bipolar transistors, but removing them had the same result.

This layout contains non-manhattan geometry in the metal layer so probably they are the same issues.

RTimothyEdwards commented 7 months ago

@3zki : I ran extraction on my computer and it completed without crashing; This could be due to some changes that I made the last time when I was working with a database that crashed on the non-Manhattan gate of the ESD device, but I am rather doubtful about it. I did not commit those changes because the changes were a quick patch to prevent crashing and do not fix the root of the problem. However, I will go ahead and commit the change now in the hope that you might be able to get a completed extraction. Note that while the extraction completed, I have not checked whether it is valid.

One thing I noted about your layout: I do not know how you created it, but the flattened labels are not being prepended with the instance name, and so labels in the bipolar transistors "B", "E", and "C" are forming direct shorts. You should at least run "extract unique" to make sure the labels are not shorting the nets and preventing them from extracting resistance properly.

RTimothyEdwards commented 7 months ago

Magic version 8.3.474 possibly solves the crash issue. I have pushed to opencircuitdesign.com and the github mirror will update in about 6 hours.

Please note that even with the fix, the waffle geometry of the power transistor is a worst-case scenario for extresist and running extresist takes several hours.

3zki commented 7 months ago

The extraction worked correctly. Thank you.