How do I go about creating parameterized cells in ...
# magic
a
How do I go about creating parameterized cells in magic? I'd like to be able to create a cell, import it and be able to scale them up. I see that this can be done with devices in skywater130 but I'm just not too sure how to create those myself
t
Depends on what you want the parameterized device to do. In some cases it can be pretty simple---The routines to draw vias and guard ring or deep nwell structures just take the existing cursor box dimensions as the "parameters"; that's really just defining a Tcl procedure that runs a bunch of magic and Tcl commands. If you want to do a thorough job of defining a parameterized cell, specifically one representing a modeled device, you need five routines to make sure it's handled correctly by magic's toolkit code: 1. _device__defaults sets default parameters 2. _device__dialog defines the dialog GUI 3. _device__convert describes how to import from SPICE 4. _device__check checks parameter limits 5. _device__draw draws the device. The best way to figure out how it works is to look at the parameterized cells defined in the sky130 implementation, which can be found in the open_pdks repository under
sky130/magic/sky130.tcl
(or the GF parameterized cells in
gf180mcu/magic/gf180mcu.tcl
). Mostly they're just complicated combinations of magic cursor box manipulation and drawing commands, arithmetic and embedded design rules.
a
right now mainly just scaling the size of it really
sounds like the first method you mentioned should do that job for me, i'll look into it. Thank you!
t
"scale up" can mean a lot of things. If you just want magnification of everything equally, you can do
load <cell> scaled <n> <d>
; if you're trying to double the width of a device, you can edit the cell, do an area selection of half of it, and use the
stretch
command to increase the dimensions in one direction.