Pranav Lulu
12/22/2022, 10:40 AMMitch Bailey
12/22/2022, 12:31 PMcat > magic.script <<EOF
gds flatglob *$$*
gds read $1
load $2
select top cell
flatten ldoflat
load ldoflat
select top cell
#gds flatglob $2
#flatten $2_flat
#load $2_flat
#gds write ./FLATTEN_GDS/$2_flat.gds
# EOF
# magic -rcfile ./sky130A/sky130A.magicrc -noconsole -dnull << EOF
# gds read ./FLATTEN_GDS/$2_flat.gds
# load $2_flat
# flatten $2
# load $2
# gds write ./FLATTEN_GDS/$2.gds
# EOF
# magic -rcfile ./sky130A/sky130A.magicrc -noconsole -dnull << EOF
# gds read ./FLATTEN_GDS/$2.gds
# load $2
extract all
ext2spice lvs
# ext2spice merge aggressive
ext2spice -o ../spice/$2_lvsmag.spice
gds read $1
load $2
extract all
ext2spice lvs
ext2spice rthresh 0
ext2spice cthresh 0
ext2spice -o ../spice/$2_pex.spice
gds read $1
load $2
extract all
ext2spice cthresh 0
ext2spice -o ../spice/$2_sim.spice
exit
EOF
and then
magic -rcfile $COMMON_VERIF_DIR/sky130A/sky130A.magicrc -noconsole -dnull < magic.script
You can run run_lvspex.sh
and check magic.script
for unexpected substitutions. I expect *$$*
isn’t what you expect.Pranav Lulu
12/22/2022, 12:40 PMPranav Lulu
12/22/2022, 12:45 PMgds flatglob *$$*
is required to solve the hierarchy issue with magic.Mitch Bailey
12/22/2022, 12:45 PM# change to ext/ directory because the extract command generates .ext files
# in the current directory
cd $OBJECTS_DIR/netgen_lvs/ext/
cat > magic.script <<EOF
gds flatglob *$$*
gds read $1
load $2
select top cell
flatten ldoflat
load ldoflat
select top cell
#gds flatglob $2
#flatten $2_flat
#load $2_flat
#gds write ./FLATTEN_GDS/$2_flat.gds
# EOF
# magic -rcfile ./sky130A/sky130A.magicrc -noconsole -dnull << EOF
# gds read ./FLATTEN_GDS/$2_flat.gds
# load $2_flat
# flatten $2
# load $2
# gds write ./FLATTEN_GDS/$2.gds
# EOF
# magic -rcfile ./sky130A/sky130A.magicrc -noconsole -dnull << EOF
# gds read ./FLATTEN_GDS/$2.gds
# load $2
extract all
ext2spice lvs
# ext2spice merge aggressive
ext2spice -o ../spice/$2_lvsmag.spice
gds read $1
load $2
extract all
ext2spice lvs
ext2spice rthresh 0
ext2spice cthresh 0
ext2spice -o ../spice/$2_pex.spice
gds read $1
load $2
extract all
ext2spice cthresh 0
ext2spice -o ../spice/$2_sim.spice
exit
EOF
# generate lvs netlist using magic
magic -rcfile $COMMON_VERIF_DIR/sky130A/sky130A.magicrc -noconsole -dnull < magic.script
# Adapt the extracted spice file to account for errors in Magic
# Importantly, this script is specific in what it looks for,
# so is unlikely to break LVS if Magic improves in the future
# note that --toplevel is optional (specify if you have a top level subckt)
# note also that you must have the global variable "__open_generator_name__" specified to your generator (as described in the python script)
python3 $COMMON_VERIF_DIR/process_extracted_pins.py --lvsmag $OBJECTS_DIR/netgen_lvs/spice/$2_lvsmag.spice --toplevel $2 --generator $__open_generator_name__
# run lvs check using netgen
# netgen lvs $2_lvsmag.spice $2.spice $COMMON_VERIF_DIR/sky130A/sky130A_setup.tcl $3 -full
# Run netgen in batch mode
netgen -batch lvs "$OBJECTS_DIR/netgen_lvs/spice/$2_lvsmag.spice ldoflat" "$OBJECTS_DIR/netgen_lvs/spice/$2.spice $2" $COMMON_VERIF_DIR/sky130A/sky130A_setup.tcl $3
Mitch Bailey
12/22/2022, 12:48 PMTheYes, but you probably need to quote it to use it in a shell script like that.is required to solve the hierarchy issue with magic.gds flatglob *$$*
*\$\$*
Pranav Lulu
12/22/2022, 12:49 PMPranav Lulu
12/22/2022, 1:04 PMFlattening unmatched subcell
and then the cellname. What does this mean? Attaching the lvs report the lines can be seen from line number 88-113.Mitch Bailey
12/22/2022, 1:14 PMFlattening unmatched subcell
<- perfectly normal. It means for some reason, netgen couldn’t match at that level of the hierarchy. That level will be flattened and then compared as part of the parent hierarchy. If your final results match, you should be good.
Looks like you just have the 1 pin mismatch.Pranav Lulu
12/22/2022, 1:15 PMPranav Lulu
12/22/2022, 1:32 PMMitch Bailey
12/22/2022, 2:22 PMVREG
isn’t connected to anything in the layout.Pranav Lulu
01/02/2023, 4:48 AMinvalid command name "then"
invalid command name "else"
Why do these error pop up. Sharing the file below which I am usingMitch Bailey
01/02/2023, 5:32 AM<<
) files - they will be copied as is. Look at the magic.script
file.
You could probably use tcl commands though. This might work.
cat > magic.script <<EOF
gds flatglob *\$\$*
gds read $1
load $2
if { "$2" == "ldoInst" } {
select top cell
flatten ldoInst_flat
load ldoInst_flat
cellname delete ldoInst
cellname rename ldoInst_flat ldoInst
select top cell
} else {
select top cell
}
extract all
ext2spice lvs
ext2spice -o ../spice/$2_lvsmag.spice
load $2
extract all
ext2spice lvs
ext2spice rthresh 0
ext2spice cthresh 0
ext2spice -o ../spice/$2_pex.spice
load $2
extract all
ext2spice cthresh 0
ext2spice -o ../spice/$2_sim.spice
exit
EOF
Pranav Lulu
01/02/2023, 5:28 PM