https://open-source-silicon.dev logo
Title
p

proppy

02/14/2023, 7:29 AM
is there a way to make magic matches port ordering from an existing spice netlist during extraction? (i.e: having it parse the .spice file) or does one should carefully craft matching
port
definition with explicit index in an extraction script?
๐Ÿ‘ 1
l

Luis Henrique Rodovalho

02/14/2023, 8:20 AM
Sometimes I change the .mag file directly. Sometimes I just give up and change the spice netlist.
m

Mitch Bailey

02/14/2023, 8:24 AM
@proppy A relatively simple solution might be to use a subckt wrapper. Normal source netlist
.SUBCKT TOP A B C D 
...
.ENDS
Extacted netlist
.SUBCKT TOP D C A B
...
.ENDS
Like this you canโ€™t swap the extracted netlist for the source netlist because the ports are in the wrong order. However, if you rename the extracted netlist (e.g. TOP_ext) and use a wrapper, you can
.SUBCKT TOP_ext D C A B
...
.ENDS
.SUBCKT TOP A B C D
X0 D C A B TOP_ext
.ENDS
p

proppy

02/14/2023, 8:28 AM
seems that doing some
port NAME index NUMBER
before running the extract does the trick
but maybe I'm just being lucky ;)
๐Ÿ‘ 1
t

Tim Edwards

02/14/2023, 2:02 PM
Stop having long discussions while I'm sleeping. . . I have a direct and simple answer for you! : ) The answer is that you can use the scripted command
readspice
to make all the pins match a netlist. See the documentation: http://opencircuitdesign.com/magic/commandref/readspice.html
๐Ÿ‘ 3
๐Ÿคฉ 1
l

Luis Henrique Rodovalho

02/14/2023, 8:35 PM
hey, can it also renumber instances?
t

Tim Edwards

02/14/2023, 9:37 PM
@Luis Henrique Rodovalho: It's much harder to renumber instances, because that implies knowing which instances are which, and that implies running (and passing) LVS. One possibility would be to have netgen dump a complete list of matching net names, instance names, and pin names, and use that output file to annotate any of the three.
l

Luis Henrique Rodovalho

02/14/2023, 10:14 PM
Is there a way to name a custom made transistor inside a cell before extracting it?
t

Tim Edwards

02/14/2023, 10:17 PM
Place a label on top of the gate and give it a name ending with the character
^
. That will become the transistor instance name.
e.g., the label
20^
should generate device
X20
.
l

Luis Henrique Rodovalho

02/14/2023, 10:22 PM
I'll try it. Thanks!