Hello, I'm trying to run LVS directly in Klayout, ...
# analog-design
n
Hello, I'm trying to run LVS directly in Klayout, however, I haven't been able to do it. It always shows the error in the image. It says I haven't set the schematic, however, I haven't found where to set the schematic netlist.
l
Hi @Nicolas Orcasitas Garcia, the LVS script expects the
schematic
variable to be set. This can be done by running the LVS script using the provided Python script. Another way to run the LVS script from inside the GUI is to install the latest version of this package: https://github.com/efabless/sky130_klayout_pdk It can also be installed using KLayout's package manager. This will add the "Efabless sky130" dropdown menu where you can select "Run LVS". Clicking on that will open the file manager to select a schematic file.
n
Thank you for your response. I don't know in which python script I have to set the variable schematic, because there are two possible scripts to run (as can be seen in the first image). "run_lvs", located in the "Global" folder, and "lvs" located in the "local" folder.
In the "local/lvs" file, I can set the schematic variable to "inv_prueba.spice" which is the netlist generated by xschem. When I run this script, I obtain what's shown in the images. Where there is no layout extraction.
And the "Global/run_lvs" file cannot be edited to set the schematic variable. And when I run this script, I obtained what's shown in the images. Where the layout was extracted (with one undesired net called "sky130_gndsky130_gnd(1)"), but there's is an error that says the schematic wasn't set
I also install "Efabless sky130" package with package manager, but when I run I got this error:
l
Hi @Nicolas Orcasitas Garcia, by Python script I meant the script at
$PDK_ROOT/$PDK/libs.tech/klayout/lvs/run_lvs.py
which runs KLayout in batch mode and passes the necessary variables to KLayout for LVS. (I think you need to install
docopt
to run the script, I don't know why there's no standard library used to parse the command line arguments...) You should be able to run the script from outside KLayout via
python3 run_lvs.py --design=my_layout.gds --net=my_netlist.spice
+ other arguments that you may need (see
python3 run_lvs.py -h
for all arguments). If you would like to run sky130.lvs from inside KLayouts "Macro Development" you can set $schematic or other global variables by writing to the console:
$schematic = "test.spice"
. You do not need to edit the file. "sky130_gnd" is the default name for the substrate, a different name can be set via $lvs_sub. Thanks for giving "Efabless sky130" a try. It seems there's an unexpected issue importing Qt from pya. From what I see you are using the IIC-OSIC-TOOLS. What version does KLayout come with?
n
Hi @Leo Moser, Thank you very much for your help. Finally, I could run LVS inside layout, by setting the variable $schematic. However, it isn't successful. There are 0 matches between layout and schematic, neither pins nor instances. And I strongly believe my layout is well routed because is a simple one (an inverter). Do you know any bugs or problems when running this sky130 LVS script? I found "Efabless sky130" an useful tool, I try it in other PC and it worked pretty well. And yes, I'm using IIC-OSIC-TOOLS, it comes with "klayout 0.29.6", and I'm still having the same issue when using this efabless package. Again thank you very much
l
Hi @Nicolas Orcasitas Garcia, that's great to hear, but there's still some setup to do before LVS will run successfully. I wrote a short tutorial some time ago: https://codeberg.org/mole99/klayout-sky130-inverter It's a bit outdated (a few workarounds are no longer needed), but it still contains important information: 1. Change the names of the transistors from XM to M (e.g. XM1 to M1) This is necessary because the transistor models in the PDK are wrapped inside a subcircuit, KLayout does not expect them to be. 2. Adjust the scaling for width and length by adding
u
for 1e-6, or set the global
scale
option to true. Another peculiarity of the sky130 PDK is that all transistor dimensions are given in um instead of SI units. KLayout expects SI units, therefore we need to scale them using one of the methods. 3. Set the subtrate name via
lvs_sub
. In my case, I have set
lvs_sub
to
VSS
. Note: The cell names should not contain a hyphen (
-
) as this can be problematic for KLayout. In the case of the tutorial, the command to start KLayout is
klayout -e inverter.gds -rd schematic=../netlist/inverter.spice -rd lvs_sub=VSS -rd scale=true
to succesfully run LVS. Regarding the Qt issue, thanks for letting me kow you are working with the IIC-OSIC-TOOLS, then it shouldn't be too hard to reproduce for me.
n
Hi @Leo Moser, it worked !!, thank you very much. I really appreciate your help.
l
@Nicolas Orcasitas Garcia You're welcome, happy to hear that! If you have any recommendation on how we can improve the LVS process, please let me kow. For example, I think it makes sense to enable
scale
by default, as all models in sky130 use 1e-6 as the scaling factor.