Hmmmm I'm trying to do LVS and at this point I'm n...
# analog-design
p
Hmmmm I'm trying to do LVS and at this point I'm not sure if I'm having a magic problem, a spice problem, a klayout problem, or some other problem. I'm running @Amro Tork’s https://github.com/mabrains/sky130_klayout_pdk/blob/main/scripts/run_standard_lvs.py script, on my gds file https://github.com/pepijndevos/sky130_lvds which shells out to @Tim Edwards’s magic and netgen. My gds is very incomplete, but I just want to get all the things working before I go all the way and have to ge back and fix a million things. So I made this dummy schematic of just the mosfets I drew
Copy code
* schematic.cir
* .lib /usr/local/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice tt
XM3 cm V- bufneg VDD_IO sky130_fd_pr__pfet_g5v0d10v5 l=0.5 w=10 m=10
XM2 cm V+ bufpos VDD_IO sky130_fd_pr__pfet_g5v0d10v5 l=0.5 w=10 m=10
And then I ran
Copy code
python ../sky130_klayout_pdk/scripts/run_standard_lvs.py lvds.gds output.txt schematic.cir report.txt TOP
which generates some
.ext
files as well as write some spice to
output.txt
Copy code
* NGSPICE file created from TOP.ext - technology: sky130A

.subckt sky130_fd_pr__pfet_g5v0d10v5_VU6JZ7 a_50_n1036# w_n144_n1098# a_n50_n1062#
+ a_n108_n1036#
X0 a_50_n1036# a_n50_n1062# a_n108_n1036# w_n144_n1098# sky130_fd_pr__pfet_g5v0d10v5 ad=2.9e+12p pd=2.058e+07u as=2.9e+12p ps=2.058e+07u w=1e+07u l=500000u
.ends

.subckt TOP
Xpfet_g5v0d10v5_7x05[0|0] m1_n102_n1172# w_n1336_n1674# m1_n66_1210# m1_n102_n1172#
+ sky130_fd_pr__pfet_g5v0d10v5_VU6JZ7
Xpfet_g5v0d10v5_7x05[1|0] m1_n102_1628# w_n1336_n1674# m1_n66_4010# m1_n102_1628#
[...]
But that's where the happiness ends. There was an error message from magic, but maybe it can be ignored?
Copy code
Error while reading cell "$$$CONTEXT_INFO$$$" (byte position 338): Cell "contact" was already defined in this file.
Error while reading cell "$$$CONTEXT_INFO$$$" (byte position 338): Ignoring duplicate definition
But then comes the netgen part and here it completely goes of the rails. If I add a
.lib
statement it just gives an error, and if I don't, it seems to generate a dummy device and then complain that it doesn't have any properties:
Copy code
Netgen 1.5.224 compiled on vr 24 jun 2022 10:27:18 CEST
Warning: netgen command 'format' use fully-qualified name '::netgen::format'
Warning: netgen command 'global' use fully-qualified name '::netgen::global'
Reading netlist file output.txt
Call to undefined subcircuit sky130_fd_pr__pfet_g5v0d10v5
Creating placeholder cell definition.
Reading netlist file schematic.cir
Call to undefined subcircuit sky130_fd_pr__pfet_g5v0d10v5
Creating placeholder cell definition.
Reading setup file /usr/local/share/pdk/sky130A//libs.tech/netgen/sky130A_setup.tcl
Model sky130_fd_pr__pfet_g5v0d10v5 pin 1 == 3
No property mult found for device sky130_fd_pr__pfet_g5v0d10v5
No property sa found for device sky130_fd_pr__pfet_g5v0d10v5
No property sb found for device sky130_fd_pr__pfet_g5v0d10v5
No property sd found for device sky130_fd_pr__pfet_g5v0d10v5
No property nf found for device sky130_fd_pr__pfet_g5v0d10v5
No property nrd found for device sky130_fd_pr__pfet_g5v0d10v5
No property nrs found for device sky130_fd_pr__pfet_g5v0d10v5
No property area found for device sky130_fd_pr__pfet_g5v0d10v5
No property perim found for device sky130_fd_pr__pfet_g5v0d10v5
No property topography found for device sky130_fd_pr__pfet_g5v0d10v5
[...]
And then the report is just
Copy code
Equate elements:  no current cell.

Equate elements:  no current cell.
Verify:  no current cell to verify.
m
OK. First let's make your schematic netlist a subcircuit
Copy code
* schematic.cir
* .lib /usr/local/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice tt
.SUBCKT TOP VDD_IO V- V+ bufneg bufpos
XM3 cm V- bufneg VDD_IO sky130_fd_pr__pfet_g5v0d10v5 l=0.5 w=10 m=10
XM2 cm V+ bufpos VDD_IO sky130_fd_pr__pfet_g5v0d10v5 l=0.5 w=10 m=10
.ENDS
Then add some pins to your layout
V- V+ VDD_IO bufneg bufpos
. Your netgen command to run lvs should be something like
Copy code
netgen -batch lvs "extracted.spice TOP" "schematic.spice TOP" $PDK_ROOT/sky130A/libs.tech/netgen/sky130A_setup.tcl
You can ignore the duplicate cell and missing parameter messages.
p
Then add some pins to your layout
V- V+ VDD_IO bufneg bufpos
.
how do I do that in klayout?
But hey that does look more in the right direction
ohhh you just put text on a label layer apparently?
m
Use a pin layer to define the shape and then place the text on the same layer inside. Make sure the pin layer is totally enclosed within the drawing layer.
1
p
So what's the difference between pin and label?
Because it seems like if I place a text in label it also gets picked up
these are borderline invisible 😞
m
pins are generally extracted as subckt ports. labels can be used to name nets. You can change the border color of the layer to something darker for better text visibility.
1
t
@Pepijn de Vos: I had to do some weird things with pin and text purposes, because there were two SkyWater libraries that used different purposes for pins; one of them may have just been a mistake, but I wrote the tech file for magic to accept both forms so that I could get the pins defined for all of the libraries.
1