<@U016EM8L91B> Hi Tim, How does the Magic engine c...
# magic
m
@User Hi Tim, How does the Magic engine create different devices (e.g. NMOS, PMOS, Resistor and so on…)? I’m asking about the code behind it. Is it hardcoded in the source code, or does the Magic fill the “Devices 1” and “Devices 2" menus from some special file?
t
Different devices are defined in the tech file extraction section, and correspond to different tile types as defined by the tech file. If you are talking specifically about the drawn devices in the "Devices" menus, then those come from a script that is basically a companion script to the tech file, which has a bunch of Tcl procedures that draw the devices parametrically. You can find that script in the open_pdks installation at
libs.tech/magic/sky130A.tcl
.
c
@User If we were to use the caravel analog wrapper, would the general process for doing the layout in magic be 1. import a cell such as an NMOS 2. manually change the width and length 3. wire up the schematic? Or we run the tcl file in conjunction with something like spice file loaded in magic (that we create with the sky130A pdk in xschem)?
t
If you have a SPICE netlist exported from xschem, you can use the menu item "File->Import SPICE" in magic to have magic automatically create all the devices with the correct width and height, all of the cell hierarchy, and all of the pins. Wiring it up would have to be done manually.
c
Okay, thanks for the clarification!