```magic -rcfile /usr/local/share/pdk/sky130B/libs...
# magic
p
Copy code
magic -rcfile /usr/local/share/pdk/sky130B/libs.tech/magic/sky130B.magicrc -dnull -noconsole << EOF
drc off
box 0 0 0 0
cellname rename "(UNNAMED)" nfet_1v8_7x015
gencell sky130::sky130_fd_pr__nfet_01v8 nfet_1v8_7x015 w 7 l 0.15 guard 0 botc 0
gds write nfet_1v8_7x015.gds
quit -noprompt
EOF
t
Does that work for you?
p
it does! I barely know what I'm doing but a gds comes out in the end
t
You sure look like you know what you're doing!
The "compatible" list in the defaults really should be named "group" or something; it's just a way to group a bunch of similar devices together that all have the same parameters. So that for the interactive version, you can just say you want an "nFET" from the device menu, and then when the parameter window is up, you can choose if you want that to be a low-Vt or high-Vt device without having to quit and select another device from the menu.
If you want explanations of any of the other parameters, just let me know.
p
There isn't anything that controls to which layer the gate/drain/source are brought up, right? All of them pretty much correspond to the fields in the GUI. I'm more curious to understand all the other commands I kinda just copy-pasted from the the manual script example. Do I actually need the box and drc stuff? Is there a way to skip the rename part, and export just the pcell? Now it's a pcell wrapped in a top level.
t
The
viasrc
,
viadrn
,
viagate
bring the ports up to metal1; I don't have any methods for going higher than that. The values can run from -100 to +100. 0 means no via, while + values anchor the contact at top or right, - values anchor the contact at bottom or left, and unsigned values anchor the contact at center (Tcl treats all values as strings, so "+100" and "100" are different strings and can be handled differently). The value is the percentage of the total width of the source, drain, or gate that is taken up by the contact. That way, you can specify all sources in a multi-finger device to be contacted at the top, and all drains to be contacted at the bottom, so that you can run metal strips horizontally across top and bottom to connect all drains and all sources.
1
🙌 1
The cells are done with a level of hierarchy so that the set of parameters can be hashed into a 6-character suffix. Every device that has exactly the same parameters has the same suffix, so the same cell will be re-used. For what you want to do, try this script:
Copy code
drc off
box 0 0 0 0
gencell sky130::sky130_fd_pr__nfet_01v8 tempcell w 7 l 0.15 guard 0 botc 0
select cell tempcell
pushstack
cellname rename nfet_1v8_7x015
gds write nfet_1v8_7x015
quit -noprompt
🙌 1
1