Hi, I'm interested in creating a kind of "designer...
# magic
a
Hi, I'm interested in creating a kind of "designer" in python that allows us to make layouts in code and generate .tcl or .mag files. Something like what @Weston Braun did in Open Pmic, but more modular and reusable. is there any project with this goal out there?
πŸ‘ 1
t
That's the concept of a "silicon compiler" and there always seem to be multiple such projects around.
w
My approach was a bit different though. More like a "silicon assembler". It just placed the fets based on a script so everything was centered and then added structures like guard rings and power rails. if I took it further I would have had it add some vias to break out some of the fet fingers for me. Unlike a "silicon compiler" the user is still specifying where everything is, but a lot of time is still saved because the placement is semi-automated.
❀️ 1
k
a
I was referring to doing the layout and positioning of the layers and stuff with Python instead of tcl or Magic's interface, not so much compiling a small python program to verilog or make an auto-layout for verilog. Sorry for the confusion.
It does not detract from the fact that it can be extended to something more automatic as mentioned by Tim.
@Krzysztof Herman I'm going to check that, thanks πŸ™‚
j
@Tim Edwards, is this concept also applied to analog circuits? With @aquiles viza and our group we are actually trying to automate a bit more the analog layout part, meaning we can add a bit more specs in the generation or do semi-manual layout with the help of scripts (TCL or python-generated tcl) The first step would be to have a single transistor laid out using a TCL script, do you guys have any basic example or advice on how to get started with this?
t
@Jorge Marin: Well, the problem has been largely solved for digital circuits, although one could build digital circuits transistor by transistor rather than by standard cell; at least historically, when people talk about "silicon compilers", they are referring to automated analog circuit layout. Single transistors are already a solved problem; see the device generators in magic (which can be driven from the Tcl command line or from a script as well as from the GUI window in magic).
πŸ‘ 1
j
@Tim Edwards thanks for your reply... I have already experimented with the magic device generator, but we would like to have good control and be able to replicate layout for a power switch (which may need some more sophisticated structure), but first we need to learn how to give instructions to magic through tcl, and we don't know how to do this, what's your advice on how to learn? are there any tutorials available?
t
@Jorge Marin: Sorry, I have not written a tutorial for the device generator. You can work from example from the Tcl code for the sky130 technology, although much of it is probably not very easy to understand at a glance. Each device has a "draw" routine, although that routine is typically broken into a single device drawing routine, and a higher-up routine that draws N x M devices in an array. I use some simple extra Tcl-scripted routines "pushbox" and "popbox" to save and recall the position of the cursor box in a stack-like manner (last in, first out). Each device has a "defaults" routine that declares parameters that are useful for the device, and generates a Tcl dictionary of parameter key:value pairs, which gets passed to all routines. Along the way, the parameters dictionary gets merged with other dictionaries, such as one that contains a lot of common dimensions like minimum width and spacing rules. So the drawing routine is mostly just a lot of geometry math, figuring out how much space to allow for guard rings and contacts and such, then configuring the cursor box and calling magic's basic paint and erase commands. Most of the drawing routines could be more cleanly written if I spent some time to work on them.
πŸ‘ 1
j
@Tim Edwards thanks a lot for your explanation
m
@aquiles viza You can try https://github.com/idea-fasoc/OpenFASOC Happy to chat more if you would like
πŸ‘ 1
a
That project seems to fit our problem, I will look into it. Thanks @mehdi
πŸ‘ 2
t
OpenFASOC is a "specialty" piece of code, but I think that that is probably the only way to tackle the open-ended problem of analog placement and layout, by working with very specific cases involving specific architectures.
a
Forgive my ignorance but what are the differences between OpenFASoc and the Berkley Analog Generator? Do they support analog design flow? What I've seen is that they both have this concept of setting up a "generator" that produces technology agnostic circuits.
t
BAG is more of a "traditional analog" circuit generator. Also there is currently a sort of schism in BAG, where most of the development is in the version using closed-source tools. There is a branch of BAG using open-source tools, but apparently it has some very experimental bits in it and is not compatible with sky130.
a
If that's the case, i think that we will dig deeper into OpenFASoc. Thanks @Tim Edwards and @mehdi