Hi, I was wondering how to speed up the pex simula...
# ieee-sscs-dc-23
a
Hi, I was wondering how to speed up the pex simulations by controlling the
cthresh
and
rthresh
magic commands. This is what I've got now.
Copy code
extract all
ext2sim labels on
ext2sim
extresist tolerance 10
extresist all
ext2spice lvs
ext2spice extresist on
ext2spice cthresh 0
ext2spice -o "$(LAYOUT_NETLIST_PEX)"
I though there may be tests that could be unaffected by the presence of a type of parasitics, like a simulation that behaves in the same way with or without capacitive parasitics. Could anyone give me some advice on how to filter parasites and whether having
pex_cap
,
pex_res
variations from the netlist would be useful anywhere?
t
You are not going to get much change in simulation time due to
cthresh
, although I often set
cthresh
to something like
0.1
just so I don't get lots of trivially small parasitics in the output. Never use
rthresh
.
rthresh
produces "lumped resistances" which only get written to .sim files, and are only meaningful to applications which understand what a lumped resistance is (to my knowledge, only IRSIM reads .sim files, and even IRSIM doesn't handle lumped resistances). Parasitic resistances are produced by
extresist
and are unrelated to
rthresh
. To change the number of parasitic resistances, change the
extresist tolerance 10
line. But the value
10
is a ratio, not a resistance value. Magic does not just set a cutoff for resistance, because a series chain of small resistances could add up to something quite large. So it's not easy to determine what the effect of changing the tolerance will be. You need to try a few different values and see what output it produces.
Make sure you only apply your recipe above to a flat layout. Do not flatten the layout permanently, just for doing the extraction. That's why I like to add at the top of what you have, something like (assuming you have a cell named "$CELLNAME"):
Copy code
load $CELLNAME
flatten ext_flat
load ext_flat
select top cell
cellname delete $CELLNAME
cellname rename ext_flat $CELLNAME
Exit after generating the netlist, and don't save the flattened layout.
Another comment: I found recently when working with a layout in deep nwell that my schematic had an isolated ground and no connection to substrate. But the parasitics couple far away from the cell boundary, so the parasitics have implicit connections to the global substrate. In magic, the startup script has the command
set SUB VSUBS
which names the global substrate
VSUBS
. For parasitic extraction of circuits with isolated ground nets, I recommend adding
set SUB 0
so that the substrate will be the default SPICE global ground node.
a
Hi Tim, thanks a lot for the feedback. I'm updating my scripts but there's still some questions • If I want to set a default value for
extresist tolerance
, may I use 100 to allow most of the resistive componets to be on the net? • The recommendation of setting
set SUB 0
should be put everytime pex extraction is done, or just for gf180mcu pdk?
t
You can use
extresist all
to ignore the tolerance and run resistance extraction on every net. But as I said above, whether "10" or "100" is a "good" value to use is not really knowable _a priori_; "10" has been used as a reasonable all-purpose number, but you really have to run the extraction with different values and see what you get. The
set SUB 0
is recommended any time PEX extraction is done. It is not PDK-specific.
a
What do you think about this script? I'm using makefile variables as functions •
MAGIC_ROUTINE_LOAD
loads a gds into magic •
MAGIC_ROUTINE_PEX__TOLERANCE
set a tolerance if specified, by default
extresist all
Thanks a lot for the feedback, I'm going to evaluate if this is not broken
Copy code
drc off
gds drccheck off

set SUB 0

$(MAGIC_ROUTINE_LOAD)

flatten $(GDS_CELL)_pex
load $(GDS_CELL)_pex
box values 0 0 0 0

extract path extfiles
extract all
ext2sim labels on
ext2sim
$(MAGIC_ROUTINE_PEX__TOLERANCE)
extresist all
ext2spice lvs
ext2spice extresist on
ext2spice cthresh 0.1
ext2spice -p extfiles -o "$(LAYOUT_NETLIST_PEX)"

puts "Created pex file $(LAYOUT_NETLIST_PEX)"

quit -noprompt
t
That looks good except that
extresist all
ignores the tolerance value, so if you pass
$(MAGIC_ROUTINE_PEX__TOLERANCE)
, you should follow it with just
extresist
.
a
Uhh, the should not be there. I will remove it. I've found that almost all capacitances in the m=1984 waffle transistor are gone, except the ones with over 1pF. I don't understand which change is causing this because with and without
cthresh 0
the capacitances are gone. I'm not sure if the ext files were removed before doing the last pex extraction. I'm redoing it with cap threshold 0 to see if they are still missing