Hello, I work with custom setup on my PC. Just for...
# sky130-pv-workshop
j
Hello, I work with custom setup on my PC. Just for curiosity and maybe directly to @Tim Edwards: which versions of Magic have "Import layout" menu entry (by default)? Magic compiled from current "master" branch on Github does not have it, as well as the Debian version of magic ... I imported with (undocumented!) command: "netlist_to_layout inverter.spice sky130" Are there any plans to "mark" Magic and other tool versions like LTS (to bring some stability/predictability to the flow), is there any list of recommended versions (maybe those currently used by efabless?), or setting the stable dev environment over a lifetime of a project is (and should be) currently more-or-less just iterative process ๐Ÿ™‚ ?
s
@Jan Belohoubek Whenever the soft link to the PDK gets created the imported spice and various options come up. Please try and see.
j
@SUMANTO KAR thank you, but I think, zthat my setup is correct. That should be defined in the magicrc? Well, the latest pdk is installed (I pulled and re-"make" it yesterday), thus I presume, that I'm using the correct rcfile (/usr/share/pdks/sky130A/libs.tech/magic/sky130A.magicrc) ... nothing like the definition of import command is there ...
s
Yes @Jan Belohoubek import option is dependent on magicrc. But default its absent.
j
@SUMANTO KAR Aha, thank you! Could you provide the definition line as an example?
s
Didn't get you. Which definition line?
j
How to define menu-entry to import SPICE netlist in magicrc?
t
@Jan Belohoubek: It's a Tcl procedure
netlist_to_layout
defined in one of the script files that magic loads on startup. It's not in the menu by default because it won't work unless you have a PDK device generator script, which defines how to translate from a SPICE netlist to each device type in the technology, and defines procedures to draw each parameterized device. So if you look at the sky130 PDK device generator script, which is in
${PDK_ROOT}/sky130A/libs.tech/magic/sky130A.tcl
, you'll see that it defines procedure
importspice
, which calls the Tk file loading GUI and makes a callback to the above-mentioned
netlist_to_layout
procedure. Then the
importspice
procedure is added to the menu using a Tk menu command; it just gets inserted directly into the middle of the existing menu (pretty easy to do with Tk).
@Jan Belohoubek: So any version of magic will support the SPICE import function, but you need to invoke the parameterized device generation script. If you start magic using the option
-rcfile /path/to/sky130A.magicrc
, then the startup script loads the
sky130A.tcl
device generator script, which in turn adds the new menu item for reading SPICE.
@Jan Belohoubek: And yes, it's undocumented. . . I was going to write a long tutorial on writing toolkits (device generators) but it's a huge job and I haven't done it yet. I should just add
netlist_to_layout
to the list of commands in the HTML documentation, instead of assuming I'm going to get around to writing the full toolkit tutorial.
j
@Tim Edwards Thank you for a comprehensive clarification! I completely understand you are overloaded. Yes, I just missing the command in the reference :-) Ough, I've it: something is missing in my setup, while I use the rcfile from your open_pdks repo, but I pulled NOT from the master branch but from some reason from some old "fom_fill" branch ๐Ÿ˜ž ... And there is no "importspice" procedure in "/usr/share/pdks/sky130A/libs.tech/magic/sky13A.tcl" ...
s
@Jan Belohoubek anyway can you try rerunning or maybe just replacing the .tcl file?
j
@SUMANTO KAR Well, I was too fast - after fetching the master branch and re-installing the pdk, it works as expected.
๐Ÿ‘ 1