Robin Tsang
04/02/2024, 4:06 AMsky130_fd_pr__pnp_05v5_W0p68L0p68
as sky130_fd_pr__rf_pnp_05v5_W0p68L0p68
causing LVS to fail when using netgen. If I remove the 'rf_' manually from the Magic-extracted netlist, LVS passes. Anybody seeing the same issue with bipolars?Mitch Bailey
04/02/2024, 4:30 AMRobin Tsang
04/02/2024, 2:24 PMMitch Bailey
04/02/2024, 2:44 PM$PDK_ROOT/$PDK/libs.tech/magic/$PDK.tech
at the top in the version number.
If you’re using LVS in precheck, the pdk associated with may be out of date.Mitch Bailey
04/02/2024, 2:44 PMvolare ls
.Robin Tsang
04/02/2024, 2:46 PMRobin Tsang
04/02/2024, 2:48 PMMitch Bailey
04/02/2024, 3:11 PM1.0.470-0-g6d4d117
but I couldn’t find sky130_fd_pr__rf_pnp_05v5_W0p68L0p68
. That’s why I asked about what version you were using. Are you extracting directly in magic with manual extraction commands or using a script?Robin Tsang
04/02/2024, 3:12 PMextract
and then ext2spice
Robin Tsang
04/02/2024, 3:22 PMsky130_fd_pr__rf_pnp_05v5_W0p68L0p68
either.
I do see the following in the device extraction section of sky130A.tech:
device msubcircuit sky130_fd_pr__pnp_05v5_W0p68L0p68 pnp *pdiff pwell,space/w a1>0.45 a1<0.47
Not sure how the 'rf_' got added. Probably something downstream, or I didn't use a standard script.Mitch Bailey
04/02/2024, 3:28 PMRobin Tsang
04/02/2024, 3:35 PMmagic -d XR -rcfile /usr/local/share/pdk/sky130A/libs.tech/magic/sky130A.magicrc ibias_gen.mag
In the rcfile, I found this line:
source $PDK_ROOT/sky130A/libs.tech/magic/sky130A.tcl
If I then go to the .tcl file above, I find this code where it links non-rf to 'rf_' versions:
proc sky130::sky130_fd_pr__pnp_05v5_W0p68L0p68_draw {parameters} {
return [sky130::fixed_draw sky130_fd_pr__rf_pnp_05v5_W0p68L0p68 $parameters] }
Mitch Bailey
04/02/2024, 3:44 PMRobin Tsang
04/02/2024, 3:54 PMnetgen lvs ibias_gen.spice ibias_gen_wip.spice /usr/local/share/pdk/sky130A/libs.tech/netgen/sky130A_setup.tcl
Xschem netlist:
ibias_gen_wip.spice
Magic extracted netlist that LVS's correctly after manually editing out 'rf_':
ibias_gen.spice
Original extracted netlist that doesn't LVS correctly:
ibias_gen_rf.spice
Mitch Bailey
04/02/2024, 4:11 PMSimulation->LVS netlist: top circuit is a .subckt
option before netlisting. (the actual location of this option may be a little different depending on the xschem version).
and then, since the layout and schematic cell names differ, run netgen with
netgen lvs "ibias_gen.spice ibias_gen" "ibias_gen_wip.spice bias_gen_wip" /usr/local/share/pdk/sky130A/libs.tech/netgen/sky130A_setup.tcl
However, this still doesn’t explain where the rf_
is coming from. I’m thinking that the sky130_fd_pr__rf_pnp_05v5_W0p68L0p68
mag file might have a LEFview
property.
Can you share the ibias_gen.mag
and sky130_fd_pr__rf_pnp_05v5_W0p68L0p68.mag
(if there is one) file? From the looks of the extracted layout, maybe ports haven’t been added either. I only see avss
.
Is this the correct schematic? Just an isolated pnp and resistor?
XQ1 avss avss net2 sky130_fd_pr__pnp_05v5_W0p68L0p68 m=1
XR1 avss net3 avss sky130_fd_pr__res_xhigh_po_1p41 L=0.0007 m=1
Robin Tsang
04/02/2024, 4:18 PMcomp.out
of LVS matching correctly when 'rf_' manually edited out
And comp.out.err
shows what it looks like if I don't edit out 'rf_'
Yes, its the correct schematic, just a resistor and a pnp. I'm working on the layout bit by bit and started with the pnp and resistor. Will add ports later.Tim Edwards
04/02/2024, 8:26 PMDevices1->PNP 0.68 x 0.68
, then it will use a subcircuit called sky130_fd_pr__rf_pnp_05v5_W0p68L0p68
(with the "rf"). But this subcircuit references a "gencell" called sky130_fd_pr__pnp_05v0_W0p68L0p68
(without the "rf") which is the actual device. Extracting a layout with this subcircuit should produce something like the following, where I have a top level called "bipolar_test":
.subckt sky130_fd_pr__rf_pnp_05v5_W0p68L0p68 Base Collector Emitter m=1
X0 Collector Base Emitter sky130_fd_pr__pnp_05v5_W0p68L0p68
**devattr s=18496,544
.ends
.subckt bipolar_test
Xsky130_fd_pr__rf_pnp_05v5_W0p68L0p68_0 B C E sky130_fd_pr__rf_pnp_05v5_W0p68L0p68 m=1
.ends
The lowest level device in this netlist is the PNP without the "rf" in the name, and is the one defined in the PDK library.
I may need to see the layout to understand why you're getting something different.Robin Tsang
04/02/2024, 8:59 PMextract
and then ext2spice
in Magic to get the netlist:
https://github.com/ajcci/sky130_ajc_ip__overvoltage/tree/main/mag/ibias_genTim Edwards
04/02/2024, 9:19 PMibias_gen.mag
file has the PNP cell correctly pointing to the location $PDKPATH/libs.ref/sky130_fd_pr/mag
. So the question seems to be what is in your PDK in file ``$PDKPATH/libs.ref/sky130_fd_pr/mag/sky130_fd_pr__rf_pnp_05v5_W3p40L3p40.mag` ?
For correct handling of the extraction, the tech file for magic has
device msubcircuit sky130_fd_pr__pnp_05v5_W0p68L0p68 pnp *pdiff \
pwell,space/w a1>0.45 a1<0.47
and the version of magic needs to be at least 8.3.411 to handle the syntax in the extraction statement.Tim Edwards
04/02/2024, 9:21 PM$PDKPATH/libs.ref/sky130_fd_pr/mag/sky130_fd_pr__rf_pnp_05v5_W3p40L3p40.mag
should have at the bottom
<< properties >>
string GDS_END 10353166
string GDS_FILE $PDKPATH/libs.ref/sky130_fd_pr/gds/sky130_fd_pr.gds
string GDS_START 10324832
string gencell sky130_fd_pr__pnp_05v5_W3p40L3p40
string library sky130
string parameter m=1
<< end >>
none of which affects the extraction; the extraction is done purely from analyzing the layout geometry. (Sorry, that's the wrong PNP device, but I think you got the idea.)Robin Tsang
04/02/2024, 10:03 PM/usr/local/share/pdk/sky130A/libs.ref/sky130_fd_pr/mag/sky130_fd_pr__rf_pnp_05v5_W0p68L0p68.mag
at the bottom, this is what's there:
<< properties >>
string GDS_END 10361160
string GDS_FILE $PDKPATH/libs.ref/sky130_fd_pr/gds/sky130_fd_pr.gds
string GDS_START 10353234
string gencell sky130_fd_pr__pnp_05v5_W0p68L0p68
string library sky130
string parameter m=1
<< end >>
Robin Tsang
04/02/2024, 10:06 PMdevice msubcircuit sky130_fd_pr__pnp_05v5_W0p68L0p68 pnp *pdiff pwell,space/w a1>0.45 a1<0.47
Looks similar to yours. Maybe I need to start fresh on another computer and install the PDK and try again. Or maybe for now I just write a script to delete the 'rf_' and worry about it after tapeout.Tim Edwards
04/02/2024, 10:11 PMRobin Tsang
04/02/2024, 10:44 PMTim Edwards
04/03/2024, 12:30 AMext2spice hierarchy off
. If you use ext2spice lvs
it sets ext2spice hierarchy on
(among other things). With hierarchy
set to off
, the circuit is supposed to be flattened. For reasons I have not yet delved into, magic is not flattening the PNP subcircuit, but leaves it at the wrapper (the subcircuit with the "rf" in the name). I will log an issue in the github issue tracker for magic about it, but I probably won't get around to it for a few days. You can either stick with the manual workaround, or maybe you can get by with the hierarchical extraction mode?Robin Tsang
04/03/2024, 12:33 AMTim Edwards
04/03/2024, 2:00 AMext2spice hierarchy off
will properly flatten the PNP down to the device level (in the process, however, I discovered that ext2spice subcircuit descend off
is broken, but that will have to wait for another day to be fixed).