<@U017X0NM2E7> I am doing LVS of a particular desi...
# magic
p
@Mitch Bailey I am doing LVS of a particular design. The extracted spice file does not contains certain devices which are actually present when I try to use a script to do the extraction. When I try the same commands seperately in magic the spice file contain those devices. Attaching both the spice file , gds and the script. ldoinst_lvsmag.spice is generated using script and ldo.spice is generated using magic seperately.
m
@Pranav Lulu May have something to do with the shell variables. Can you try this at the beginning of the script.
Copy code
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
and then
Copy code
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.
p
@Mitch Bailey Sorry but I didn't understand where should I put the magic -rcfile $COMMON_VERIF_DIR/sky130A/sky130A.magicrc - nonconsole -dnull < magic.script it should be inside run_lvspex.sh right??
The
gds flatglob *$$*
is required to solve the hierarchy issue with magic.
m
Copy code
# 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
👍 1
The
gds flatglob *$$*
is required to solve the hierarchy issue with magic.
Yes, but you probably need to quote it to use it in a shell script like that.
*\$\$*
p
Okay..
@Mitch Bailey Now the script works. I have a lvs report generated it contains some lines saying
Flattening unmatched subcell
and then the cellname. What does this mean? Attaching the lvs report the lines can be seen from line number 88-113.
m
Flattening 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.
p
Yes!! I can resolve the 1 pin mismatch.
@Mitch Bailey I tried solving the pin mismatch but they appear in different line. What's the issue here? here's the updated report
m
VREG
isn’t connected to anything in the layout.
p
Hello @Mitch Bailey Happy New Year!!🎇 I have shell script that is used for LVS as we discussed above. While implementing if else block in the script I am seeing a error like
invalid command name "then"
invalid command name "else"
Why do these error pop up. Sharing the file below which I am using
m
shell commands don’t work in here (
<<
) files - they will be copied as is. Look at the
magic.script
file. You could probably use tcl commands though. This might work.
Copy code
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
p
@Mitch Bailey Thanks!! The above thing worked I had another doubt I had asked this seperately on magic but asking you here. If I have circuit's layout and I extract a spice netlist using magic without any parasitics. What parameters of devices changes in the extracted spice netlist as compared to it's cdl spice netlist??
👍 1