Layout Example # 2 Using KLayout: Transistors and Ring Oscillators

For this example, I’m going to step through building a very simple, nonfunctional electronic device, a “Ring Oscillator”, which is a bunch of transistors connected with some metal wiring. I’m assuming you know how to do the mechanics of creating layers, cells, and objects as described in the first example.

First, I’m starting with a blank layout, and I’ve created 4 layers: p_implant, n_implant, metal, and via. I’ve also set the layers to have different colors and fill patterns, but of course, that’s just a viewing preference (and I describe how to set layer appearance at the bottom of this page.) (And don’t worry if the electronics design reasons for these layer names aren’t meaningful to you, unless of course, you are a device designer, in which case, you should know these terms, or else be worried :)

Next, I define the simplest element in my simple circuit, in this case, a cell, which I’ve called: “Contact Pad”, which is a square of metal with a “Via” hole underneath (in microelectronics, a “Via” is the term for a hole that is etched through an oxide layer to allow different layers of metal to interconnect, much like wiring in a large-scale circuit.)

Next, I design the transistor itself, by creating a new cell, called not surprisingly “transistor”, which contains some P and N-type implants, and some metal connections, shown in red, green and blue respectively, and then three instance of the cell “ContactPad” that I created just above. These ContactPads form the input and output terminals of this transistor with which this transistor will be connected to other elements in my mini-circuit. Note that in this view, the contact pads are shown only as outlines (the “Levels” in the lower left corner is showing only levels 0 through 1.)

The next image is the exact same cell, but with the view level now set to 0 through 2. The view looks almost identical, except that you now see the details inside the cell called “ContactPad” as well, not just the cell outline. This is an extremely important function as you build up hierarchy -- you have to understand that you control how many levels of the hierarchy are displayed, whether you see the details, just an outline, or nothing at all for child cells.

Continuing on my Ring Oscillator build, now that I have a basic building block transistor designed, I create another new cell called “RingOscillator”, and in this cell, I place an array 5x2, of the “Transistor” cell, which looks like this (assuming I have the View Levels set to show the details within the cells I’ve arrayed. Note that the first 5 menu options under KLayout’s “Display” menu deal with which levels of cell hierarchy are being displayed.)

Now I create some smaller cells which contain repeated interconnect wires which connect the different transistors. Each of these wires is created in its own separate cell, and each is placed in an array instance to connect different terminals from the adjacent transistors, as shown below

Finally, I add a few non-arrayed special pieces of writing, such as the input/output terminals on the left-center of the oscillator, and the lower-to-upper bus bar on the right side. So when I view the final RingOscillator cell, it now looks like this, with view level at “2”, which is the full hierarchy, we see all objects. Note also that the cell list on the left side displays the hierarchy as an indented list of cells, complete with the little triangles that let you control how many “child cells” you see in this cell list.

Now, I reduce the view level to 1, here I see only the outline and identification (cell name) for each sub-cell in this hierarchy. I also see the pieces of interconnect metal (blue) that are not hierarchical, but are used to interconnect the hierarchical pieces.

And finally, a top-level, or 0-depth view shows only the outline of my RingOscillator. All of the parts are still there, just not being shown in this view. If I were designing a complex electronics circuit, I would probably just layout out these literal ‘black boxes’ of various components without worrying about the details of what is inside of each box once it has been designed.

OK, we’ve moved pretty quickly from just starting out, to a reasonably complicated, hierarchical device layout. Hopefully you are following along, and this is making some sense. Don’t get too concerned if it’s all still a bit confusing; there’s a steep learning curve when you’re first starting out with layout design, but sometimes you have to dive in and just start making some designs of your own to see how it all fits together. Think about using Microsoft Word or any complicated word-processor for the first time -- there are tons of features, many of which you never use, and at first, even simple tasks seem bewildering. But try things out and you’ll learn the essentials as you go.


Before I move on to some more complex details, I want to show you one more set of views. The previous set of figures showed you the “View Levels” of the hierarchy. There is a completely orthogonal way of looking at layout: by LAYERS instead of LEVELS. Remember that LAYERs in general refer to the different lithographic steps in your device fabrication. Here’s where your wafer process and your design become integrated.

Continuing with the above example of a simple ring oscillator. There are 4 lithographic layers in this example:

1) P-Implant
2) N-Implant
3) Oxide Vias
4) Metal Wires

If all 4 layers are to be exposed by photolithography, you’d have 4 unique photomasks built, one for each layer. Here are views of each mask:



Oxide Vias:


Viewing Controls

Like most everything else in KLayout, you have considerable control over how your design in drawn on the screen.

To view or not view individual layers in your layout, you double-click on the layer specification in the “Layers” palette on the right side of the window. The layers that are visible have the full legend rectangle to the left of their name; layers which are invisible are shown as tiny rectangles with little triangles. With these, you can control the details of exactly what you see and don’t see.

And one more topic, since it’s relevant to viewing layers, the “Layer Toolbox” palette lets you set the color, fill pattern, outline, and other display details for each layer. (If the Layer Toolbox is not visible, you can display it with KLayout’s View: Layer Toolbox menu item. Again, quite a bit of flexibility (but complexity) even in something so simple as setting the viewing palette. For each layer you can set fill color, frame color, frame style, fill style (stipple), animation, transparency, visibility or opacity. You can also save different sets of view settings for your layout.

Do note, though, that your view settings are NOT saved inside your pattern data file. This is because the GDS-II file format does not allow for such data to be included within the file. KLayout (and many other CAD programs) let you save an auxiliary file containing your layer setups. In KLayout, use: File : Save Layer Properties and File : Load Layer Properties to save and load sets of file definitions.

Selection Control

Now that you've seen how shapes can fit into a hierarchy of cells, there's another Object Editor Option that is very important, and can be very frustrating if you don't know it's there. Open the Object Editor Options dialog, via [ Edit : Editor Options...] and you'll see the third section down is labeled "Selection Mode". This controls what objects are selected through the hierarchy when you click. I recommend you Check this option, as shown here. In this case, if you are in Select mode and click on a cell instance, you will select that specific Instance. With this option unchecked, you may end up selecting one of the objects within that instance, and will subsequently edit that object, not the instance. I find this very unintuitive; so I always have "Select top level objects only" selected when I'm using klayout.

If you’re ready for more details, the next page has some picky details and design advice.