Stephen
09/20/2023, 6:26 PMTim Edwards
09/20/2023, 6:27 PMStephen
09/20/2023, 6:29 PMTim Edwards
09/20/2023, 6:31 PMStephen
09/20/2023, 6:48 PMTim Edwards
09/20/2023, 7:48 PMsky130/magic/sky130.tcl
and gf180mcu/magic/gf180mcu.tcl
. Every defined device needs to define five procedures:
<device>_defaults
sets default parameters
<device>_dialog
defines the dialog GUI
<device>_convert
describes how to import from SPICE
<device>_check
checks parameter limits
<device>_draw
draws the device.
There are basic routines for device types like mos_draw
that handle most basic devices for the process and can be extended by passing local parameters.
The parameterization is handled by passing around a Tcl dictionary variable called parameters
and merging it with local modifications. The base dictionary is ruleset
(mostly DRC rule distances), then each device has a dictionary that comes from the _defaults
procedure, is merged with values captured from the dialog, and passed to the _draw
procedure, where it is combined with a dictionary specific to the device being drawn.
Most of the drawing involves manipulating the "cursor box" in magic and using a stack with the commands pushbox
and popbox
to save and retrieve the box in specific positions.
I could go on, but it would take all day and then I'd be writing the documentation that I'm missing, which is what I really should be doing instead of posting in Slack.