Does anyone know how to assign multiple ports to specified positions efficiently?
Manually assigning ports is really time-consuming.
m
Mitch Bailey
03/27/2024, 11:54 AM
Are you asking for the tcl commands?
y
Yusuke Sakemi
03/27/2024, 11:59 AM
Is it useful? I was considering editing .mag file directly.
t
Tim Edwards
03/27/2024, 1:00 PM
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
Yusuke Sakemi
03/27/2024, 1:19 PM
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
Tim Edwards
03/28/2024, 12:58 PM
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
Yusuke Sakemi
03/29/2024, 2:24 AM
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.
Linen is a search-engine friendly community platform. We offer integrations with existing Slack/Discord communities and make those conversations Google-searchable.