aquiles viza
01/31/2024, 7:55 PMmake TOP=resistor magic # Open magic and load "resistor.gds" with 72 drc errors that klayout was not reporting
make TOP=resistor magic-lvs # Generates a netlist without parasitics. I have not validated it
make TOP=resistor magic-pex # Generates a netlist with parasitics. I have not validated it
make TOP=waffle_1984 magic # Open layout with +2000 drc errors that klayout was not reporting
make TOP=waffle_1984 magic-lvs # Is not working
make TOP=waffle_1984 magic-pex # Is not working
make TOP=pmos1f magic # Is not working
make TOP=bjt magic # Is not working
make TOP=cap_mim_2f magic # Is not working
make TOP=inv_sample magic # Is not working
All of the gds examples work fine with klayout, and are drc and lvs clean.Tim Edwards
01/31/2024, 8:38 PMTim Edwards
01/31/2024, 8:40 PMaquiles viza
01/31/2024, 9:04 PMmagic-lvs
is a very bad name for the action of generate a netlist without parasitics, since LVS is done with netgen
.
The magic
rule just load the gds into magic, if that fails then no other magic-*
rule will work.
The <http://magic.mk|magic.mk>
makefile has the following instructions. These are declared as variables and passed as heredoc to magic.
# This are the variables
TOP=resistor
TOP_GDS=resistor.gds
TOP_GDS_CELL=resistor
TOP_GDS_DIR=./
# MAGIC_ROUTINE_LOAD
drc off
if { "$(suffix $(TOP_GDS))" == ".gds" } {
# This is expanded to ".gds" == ".gds"
puts "Reading a gds"
gds readonly true
gds rescale false
gds read $(TOP_GDS)
getcell $(TOP_GDS_CELL)
load $(TOP_GDS_CELL)
box 0 0 0 0
} else {
load $(TOP_GDS)
}
# MAGIC_ROUTINE_LVS
$(MAGIC_ROUTINE_LOAD)
extract
ext2spice lvs
ext2spice -o "$(TOP_GDS_DIR)/$(TOP_GDS_CELL)_extracted.spice"
puts "Created netlist file $(TOP_GDS_DIR)/$(TOP_GDS_CELL)_extracted.spice"
quit -noprompt
# MAGIC_ROUTINE_PEX
$(MAGIC_ROUTINE_LOAD)
flatten $(TOP_GDS_CELL)_pex
load $(TOP_GDS_CELL)_pex
box values 0 0 0 0
extract all
ext2sim labels on
ext2sim
extresist tolerance 10
extresist all
ext2spice lvs
ext2spice extresist on
ext2spice cthresh 0
ext2spice -o "$(TOP_GDS_DIR)/$(TOP_GDS_CELL)_pex.spice"
puts "Created pex file $(TOP_GDS_DIR)/$(TOP_GDS_CELL)_pex.spice"
quit -noprompt
The pex routine is making flattening al the beginning, so that should not be the problem
The instructions were originally on the custom magicrc, but that doesn't work eitherTim Edwards
01/31/2024, 9:49 PMgds flatten true
before gds read
. gds flatten
is a common option that works around other layout tools' tendency to put contact cuts in their own cells, which interferes with magic's derived layer definitions. That can also be worked around with some complicated detection and handling of bare contacts in the GDS read routines which apparently I didn't put in the gf180mcu tech file, but gds flatten true
is a quicker/simpler way to deal with the issue.Tim Edwards
01/31/2024, 9:50 PMTim Edwards
01/31/2024, 9:57 PMwaffle_1984
is a similar problem but some of the cells are too complex to be noticed by gds flatten true
(which flattens cells with fewer than 10 rectangles), requiring a bit more targeted read-in:
gds flatten true
gds flatglob pmos*
gds flatglob via*
gds read waffle_1984
load waffle_1984
Then this shows as DRC clean (and will probably extract cleanly, too).Tim Edwards
01/31/2024, 10:02 PMTim Edwards
01/31/2024, 10:07 PMReading "$$$CONTEXT_INFO$$$"
I do not know which tool generates the "$$$CONTEXT_INFO$$$" cell or what it is used for, but it ends up as a top-level cell which then interferes with a lot of processes (such as the script).Tim Edwards
01/31/2024, 10:08 PMaquiles viza
01/31/2024, 10:38 PMgds flatten true
and the glob pattern lines before read gds
Then I remove the line `gds readonly true`` and that fix a lot of problems.
In the resistor, drc errors didn't go away. Some of them are the following
Error area #2:
Diffusion contact width < 0.23um (CO.1 + 2 * CO.6)
Error area #3:
Diffusion contact width < 0.23um (CO.1 + 2 * CO.6)
Error area #4:
Diffusion contact width < 0.23um (CO.1 + 2 * CO.6)
Error area #5:
Diffusion contact width < 0.23um (CO.1 + 2 * CO.6)
Error area #6:
Diffusion contact width < 0.23um (CO.1 + 2 * CO.6)
Error area #7:
Diffusion contact width < 0.23um (CO.1 + 2 * CO.6)
Error area #8:
Diffusion contact width < 0.23um (CO.1 + 2 * CO.6)
Diffusion contact width < 0.23um (CO.1 + 2 * CO.6)
Klayout only drc errors are the density/coverage ones, as always.
The use of gds readonly true
makes magic throw this error
Library name: LIB
Error while reading cell "(UNNAMED)" (byte position 62): Incompatible scale factor of 5e-09, must be 1e-9.
Cannot read this file in read-only mode.
Cell bjt couldn't be read
Removing it allows me to open all the layouts that doesn't work before. bjt has 5 drc errors as you said, cap_mim_2f has 0, inv_sample has 0, pmos1f has 0. It seems that all of them makes lvs and pex extraction.
waffle_1984 has 0 drc errors and extraction without parasitics gives a netlist with1966 fets, not 1984. I have to validate it. Extraction with parastics still don't work and ends with this line Extracting waffle_1984_pex into waffle_1984_pex.ext:
Tim Edwards
01/31/2024, 10:45 PMgds flatten true
worked for me last time, but I can confirm that the errors in the resistor are still showing up. I have to add gds flatglob rectangle*
and gds flatglob compass*
in addition to the gds flatglob via*
to get that one to read correctly.aquiles viza
01/31/2024, 10:46 PMaquiles viza
01/31/2024, 10:49 PMrectangle*
and compass*
stuff. It seems mandatory to have those cells flattened to avoid this kind of problems.Tim Edwards
01/31/2024, 11:06 PMTim Edwards
01/31/2024, 11:06 PMaquiles viza
01/31/2024, 11:16 PMdefine MAGIC_ROUTINE_LOAD =
gds rescale false
gds flatten true
gds flatglob pmos*
gds flatglob via*
gds flatglob compass*
gds flatglob rectangle*
gds read $(TOP_GDS)
getcell $(TOP_GDS_CELL)
load $(TOP_GDS_CELL)
box 0 0 0 0
endef
define MAGIC_ROUTINE_LVS =
drc off
$(MAGIC_ROUTINE_LOAD)
extract
ext2spice lvs
ext2spice -o "$(TOP_GDS_DIR)/$(TOP_GDS_CELL)_extracted.spice"
puts "Created netlist file $(TOP_GDS_DIR)/$(TOP_GDS_CELL)_extracted.spice"
quit -noprompt
endef
define MAGIC_ROUTINE_PEX =
drc off
$(MAGIC_ROUTINE_LOAD)
flatten $(TOP_GDS_CELL)_pex
load $(TOP_GDS_CELL)_pex
box values 0 0 0 0
#box 0 0 0 0
extract all
ext2sim labels on
ext2sim
extresist tolerance 10
extresist all
ext2spice lvs
ext2spice extresist on
ext2spice cthresh 0
ext2spice -o "$(TOP_GDS_DIR)/$(TOP_GDS_CELL)_pex.spice"
puts "Created pex file $(TOP_GDS_DIR)/$(TOP_GDS_CELL)_pex.spice"
quit -noprompt
endef
It seems that for waffle_1984, lvs netlist extraction sometimes work, maybe is related with memory limitations on my machine.
I've run lvs netlist extraction on waffle_1984 and it gives me 1966 pfet_03v3 devices again. I think this could be related with magic version or pdk configuration. I'm using magic 8.3.459 and openpdk commit bdc9412b3e468c102d01b7cf6337be06ec6e9c9a (2024.01.10)aquiles viza
01/31/2024, 11:20 PMmake TOP=waffle_1984 magic-pex
Mitch Bailey
02/01/2024, 12:08 AMflatglob
if they are not. With flatglob
, you’ll need to flatten all the sub-hierarchies too. You can check the ext
files or the final spice
to make sure everything is as expected.Tim Edwards
02/01/2024, 1:38 AMextract all
are executed. I have no idea why. When I said that it worked for me, I had run all the commands on the command line in interactive magic. If I run in batch mode, I get the same thing you're getting.Tim Edwards
02/01/2024, 1:43 AM<http://magic.mk|magic.mk>
, change:
MAGIC_BATCH=$(MAGIC) -nowrapper -nowindow -D -dnull
to
MAGIC_BATCH=$(MAGIC) -dnull -noconsole
and the pex-extraction should work.Tim Edwards
02/01/2024, 1:44 AMgetcell $(TOP_GDS_CELL)
in your script does nothing. It instantiates the loaded cell in the default layout, but the cell does not have to be instantiated to be loaded. That line can be removed from the script.)aquiles viza
02/01/2024, 5:29 AMaquiles viza
02/01/2024, 5:54 AMwaffle_1984
lvs nor pex extraction has ports. I'm sharing only the lvs netlist. This layout uses Metal3 and Metal5 label layers.Mitch Bailey
02/01/2024, 12:25 PMTim Edwards
02/01/2024, 1:44 PMaquiles viza
02/12/2024, 7:44 AMaquiles viza
02/22/2024, 5:10 PMreadspice
directive pointing to a schematic netlist but it is not able to find the labels (M3 and M5 labels).
Annotating port orders from waffle_1984_noprefix.spice
Annotating cell waffle_1984
Crosshair not in a valid window for this command
Couldn't find label S
Couldn't find label G
Couldn't find label D
In the attached files, extraction.sh
performs both clean and parasitic netlist extraction but both ignore the ports.Tim Edwards
02/22/2024, 5:17 PMwaffle_1984
. The labels are defined inside the subcell external-guardring-trck-3-5.5-10-216.0
. That's why the labels cannot be found.Tim Edwards
02/22/2024, 5:23 PMG
is in subcell gate_mesh-5.5-0.5-2.25
) (as an aside, use of dashes and periods in cell names is generally not a good idea.)aquiles viza
02/22/2024, 5:29 PM