Does anyone know how to assign multiple ports to specified positions efficiently? Manually assigning...
y
Does anyone know how to assign multiple ports to specified positions efficiently? Manually assigning ports is really time-consuming.
m
Are you asking for the tcl commands?
y
Is it useful? I was considering editing .mag file directly.
t
If you have a SPICE netlist and/or LEF netlist, you can annotate the layout to create ports and set their properties. The SPICE netlist will set port order and turn labels into ports if needed. The LEF will add ports and specify port direction. Use
readspice <netlist>
to annotate from SPICE. Use
lef read <lef_file>
to annotate from LEF.
y
Thanks. I am gonna try it. Can I place ports to target positions efficiently with this technique? For example, in a crossbar array structure, there are about a hundred of ports. However, because these ports are neatly aligned, I think a programming-like approach works well in this case.
t
Something like this:
Copy code
box size 0.5um 0.5um
for {set i 0} {$i < 100} {incr i} {
    paint m1
    label my_array_$i FreeSans 0.2um 0 0 0 c m1
    select area label
    port make
    box move n 3um
}
It's very useful to be able to write little scripts like this within magic. Often useful to write those in a file somewhere, and then use the
source
command in Tcl to run the commands from the file.
y
Thank you very much! I created a program that directly edit the .mag file by analyzing spice file and using port position information provided manually ( a python code). This code actually worked. But running a code in the magic software is safer.
👍 1