MMI-MAX Tutorial 3.x
Copyright (c) 1996, 1997, 1998, 1999 Micro Magic, Inc. All rights reserved.
Welcome to MAX, the full custom layout editor from Micro Magic, Inc. MAX is more than just a simple layout editor. It is a complete layout environment.
| - | Interactive viewing and editing of hierarchical layout |
| - | Continuous DRC feedback during layout |
| - | Hierarchical and incremental DRC |
| - | Built in netlisting |
| - | Interactive connectivity tracing |
| - | Interactive wiring tool with flylines to show connections not yet completed |
| - | Layout generator for gates (using MAX-LS) |
| - | Generators for large regular structures such as SRAMS, ROMs, PLA's, and DRAM's (with the optional MegaCell Compilier) |
| - | Interfaces to other tools, including schematic capture (for example SUE), and batch DRC and LVS (for example Dracula or Calibre). |
| - | Smart palette for easy control and feedback on layers |
| - | Full customization and extension via Tcl/Tk scripting language and API |
| - | Technology independence via technology description files |
| - | Optimized for large databases |
| - | Very Fast Redisplay for Whole Chip Viewing and Inspection |
| - | Reads/writes GDSII |
| - | Runs on Solaris and Linux operation systems. |
This tutorial will introduce you to many of these features. Consult the MAX Manual and on-line documentation for further information.
|
In this document, the following conventions will be used:
Headings from the initial outline are shown in bulleted bold text: Chapter Headings in Large Text Subheadings in Smaller, Underlined Text All hot-keys will be shown in boldface type, in upper or lower case, as they should be typed:
Menu items are underlined; selections within menus shown in bold underline:
Text strings given by the program are shown in special typeface:
Text strings to be entered (typed in) by the user are given in boldface special type:
Instructions for the user to follow are shown with "open" bullets:
Special information, explanations, or asides, are designated through colored "TIP!" or "NOTE:" paragraphs. Always, throughout this document, Left Mouse Button = Button 1, Middle Mouse Button = Button 2, and Right Mouse Button = Button 3. Generically, "Click" means "click with the left mouse button (Button 1).
|
Before we get started make sure someone has already installed MAX at your site.
Several files have been provided by Micro Magic that you will need to run this tutorial. You should copy these files into your own directory BEFORE starting up MAX. To accomplish this, go to whichever directory you wish to run the tutorial in and type:
This command will create a directory called max.
A window should come up that looks something like this:
![]() |
| MAX Tutorial Fig. 01 |
On the very top of the window the title bar should say max: (UNNAMED).
Next, across the top you should see the menu bar which contains the following menu items: File, Edit, View, Mask, Tools Misc, Local, and Help. These are pull down menus much like any PC or Mac application.
Directly to the right of the Help menu is the MAX Message Area. It currently says something like "main mode, BUT-1 selects, BUT-2 moves selection...". The MAX Message Area is a sort of mini help feature. It tells you what each mouse button does, and when you have pulled down one of the menus from the menu bar the message area will give you a short explanation of what the selected menu item does.
Then simply click the left mouse button (Button-1) on either Make new list box, or Close this list box.
Your .maxrc file can specify library directories to be autoloaded at startup time. The .maxrc file contains several other useful pieces of information. (See the MAX Manual for more details.)
You can adjust the width of the list boxes by moving the mouse pointer over the vertical bar just to the left of the text. The bar will change to a little line with arrows on both the left and right sides. When the arrows appear you can adjust the width by simply clicking the left mouse button (Button-1) and dragging the mouse to the left or right.
Below the list boxes is the Navigator Window. For large designs you can use the Navigator Window to control the view you see in the main MAX window.
The small colored buttons on the right of the Navigator Window allow you to do several things.
The top button always toggles to the last view. If you desire you can add additional buttons to save views. Both the number of view save buttons and their colors can be changed in your .maxrc file.
Scroll bars are laid across the bottom and right side of the layout window (and on the right side of the list boxes). These work like the scroll bars in most other applications.
Below the bottom scroll bar is the Zoom Bar. Pulling it to the left zooms in and to the right zooms out.
In the lower right hand corner the Box Size (in microns) is always displayed. This is useful when you wish to make an object a precise size. It is also useful for when you select an object and want to know how big it is.
Just to the left of the Box Size is the Mouse Coordinates display. Mouse coordinates are with respect to the top level cell.
In the lower left corner is the DRC Status Box. It tells you the current status of the continuous interactive DRC which runs in MAX. The DRC Status Box also has a small radio button to turn the interactive DRC on or off.
Down the left side of the window is the Smart Palette.
Just above the palette are several buttons (Active:, -cells-, -all-).
Active lets you select the "active" layer.
Cells controls whether or not sub-cells, or gcells, can be selected.
All allows you to make all of the layers visible or invisible at the same time.
Before we go any further, here is how to get help if you ever need it.
There are several levels of help available "on-line" to MAX users. You already know about the quick Help listed in the MAX Message Area. In addition, you can access the complete on-line manual, the complete list of active hot-keys, and complete documentation on text commands at any time.
This should pop up a sub menu as shown:
![]() |
| MAX Tutorial Fig. 02 |
About MAX
max -tech mmi25.
mmi25 is a generic 0.25um CMOS technology provided by MMI. It is similar (although not exactly the same) to many current 0.25um technologies and is a good place to start if you need to generate your own technology file.
About MAX will also tell you where $MMI_TOOLS points to. (This is the directory where the MMI tools are installed at your site.)
Current Hot Keys gives you a list of all available hot keys. You can also hit the space bar to bring up this list.
MAX Manual
Text Commands brings up documentation for the MAX text commands. Text commands are useful for writing scripts, generators, and other helpful programs. Text commands and the Tcl/Tk interface are the MAX API. They allow the user to add their own features to the local menu and tool menus.
MMI Documentation Guide brings up all of the documentation for all Micro Magic Tools. This document has links to items like the SUE manual, the MAX manual, other MMI tools, and even to this tutorial.
Max Tutorial brings up this tutorial.
Before proceeding you should bring up the MAX Manual and see what's there. The manual is the reference to MAX and it contains lots of information that you will not find in this simple tutorial. You might also want to look at the menu items just to familiarize yourself with what's there.
| TIP! |
Sometimes it is convenient to make a menu its own window.
For example: Going back to the Help menu: when you hold down the left mouse button (Button-1) over the Help menu notice that there is a dotted line just before the About Max menu item (not shown in the above figure).
If you release the button while over the dotted
line the menu will "tear off". The menu then becomes a full-fledged window, like any other on your desktop.
|
If you are running another window manager, your windows might behave a little differently. Consult your window system documentation for more details.
| TIP! | The Menu will stay pulled-down until you select a menu item, or another menu. |
OK, let's get started on some layout.
The "(UNNAMED)"
at the top of your MAX window should now say "foo" .
This means that you are
now editing the cell foo . When you save it out it will be saved as
foo.max .
Also, notice that "foo" now appears in the Cell List box on the right side
of the MAX window.
MAX can do very low level full custom layout. It also has a complete Tcl/Tk interpreter built in. Tcl is a language developed by John K. Ousterhout at UC Berkeley. Tk is the windowing tool kit. Books on both can be found at your local bookstore. Using Tcl you can write some high level generators.
At Micro Magic we have written full SRAM generators and pad ring generators in MAX. We have also written some more simple generators like those to drop nfet's.
![]() |
| MAX Tutorial Fig. 03 |
Contacts allows you to put contacts on the left side, the right side, both sides, between the devices, or no contacts at all.
If you click the left mouse button (Button-1) on the word both it will change to the next option. Clicking the left mouse button (Button-1) on the little bar on the right of the button will bring up all of the possible options.
![]() |
| MAX Tutorial Fig. 04 |
Notice that the letter M appears to the left of "foo" in the Cell List box. This tells you that "foo" has been Modified.
| TIP! | You can undo whatever you have just done in MAX. Use the u hot key or select Undo from the Edit menu. You can also Redo what you have just undone using the Shift-u hotkey. There are 99 levels of undo in MAX. If you can remember back more than 99 items please call us, we would love to meet you! |
There are several methods for zooming found in the View menu.
One easy way to zoom to the exact region you want is by using the zoom hot key.
One often used technique for zooming is to use the t hotkey to zoom in by a factor of two centered on the mouse. Then use shift-z to zoom out also by a factor of two.
There are two items you can select and move in MAX: objects and paint.
Paint is basically flat layout. Think of paint as if you were painting something with a paintbrush. You can apply paint, remove paint, you can even stretch and drag paint. Paint is similar to flattened objects in other layour editors, but more flexible.
There are several methods for selecting objects and paint.
Typing r 3 more times will rotate the object back to its original position.
You can also select objects or paint by clicking on them.
| TIP! | All of the zoom, duplication, move, cut and paste, rotate, etc. features that we just executed using hot keys also have menu equivalents which can be found in the Edit and View menus. |
We now wish to create a couple of pfets. We could go back to the list box and select the fet generator again, but there is another way.
Now you will begin to see the power of gcells.
![]() |
| MAX Tutorial Fig. 05 |
As you have seen, gcells can be used to create fets and vias. The wiring tool can also automatically drop gcell vias. You can change the size of a gcell fet by:
This trick also works on vias, except the outcome is placing multiple vias!
| TIP! |
You can wire in layers like well contact to help you with things like quickly building guard rings. |
We are now going to see a really cool feature in MAX, real-time DRC.
![]() |
| MAX Tutorial Fig. 06 |
If you move the pfet too close to the nfet, little white dots will appear.
These little white dots tell you that there is a Design Rule Check
error (DRC error).
Notice that as you move the pfet closer or further away the DRC errors show up in "real" time! This is one of the powerful features in MAX.
The continuous DRC means you don't even have to learn the DRC rules, or count grids. Just move things closer together until you see the white dots, and then back off a little.
![]() |
| MAX Tutorial Fig. 07 |
We are now going to "paint" a piece of poly to connect the pfet and left nfet gates together.
![]() |
| MAX Tutorial Fig. 08 |
| TIP! |
|
A few more words about the smart palatte. Remember down the left side of the window is the Smart Palette.
The Smart Palette provides many features. It allows you to control what you see, what you can select, what's under the cursor, what you can paint, and what the layers look like. Remember the max status box (directly to the right of the Help menu) will tell you what the availble options are if you place the mouse over the palette.
| TIP! | While the grid color is changed in the color/stipple editor, if you wish to change the grid from lines to dots you must do that in the grid setup found in the Grid Menu... under View or by typing the shift-G hotkey. |
| TIP! |
You can also paint by clicking the right mouse button (Button-3) over any existing paint of
the type you wish to paint with. That is, you can click the right mouse button (Button-3) over
an existing piece of poly in the layout window and it will paint with that layer just
as if you clicked on that layer in the palette.
NOTE, however, that if you click over a place with NO layout then the area under the box will be erased. Remember, undo u can recover from this :-) |
Main Mode
We just painted poly within a region we dragged out. That region, "the box", is very important in MAX. It is mostly used for painting, but is also used to determine where you are going to place, or do, something.
Assuming you were in "main mode" (the default), any paint within the box is selected. This is the way we have done things thus far.
Box Mode
"Box mode" is useful when you need to do detailed layout. You can resize the box to the exact size you want, and place it exactly where you want it, without having to worry about corrupting any existing paint that you might have inadvertently selected.
Now to route up the next poly. We could route the poly as we did before, by drawing rectangles and then filling them with red (poly) paint, but that's a lot of work.
There's a much easier way - use MAX's built-in wiring tool.
Notice the cursor has changed to a little pointing finger. Remember, that's to let you know you are in a different mode. In this case "wire" mode.
| NOTE: | Ctrl-c always aborts any sub-mode and returns you to main mode. |
As the pfet is not directly above the nfet we need a "kink" in the wire. You do this by simply clicking the left mouse button (Button-1) where you want the kink.
In fact, MAX does even better than that. If you click either the left or middle mouse button over the poly but are not exactly in the middle of the wire, MAX will actually snap the wire into place for you and end it. How about that? :-)
| TIP! |
If you didn't put the wire exactly where you wanted it don't worry.
You can always undo. While in wire mode, undo (u) will back up one segment at a time. |
Move, and Stretch, can be found under the Edit menu along with Extend.
The arrow keys will do a "stretchy" move.
If you do NOT want the wires to stretch, hold down the shift key when moving the selected layout.
Now wire up the metal just as you did the poly.
![]() |
| MAX Tutorial Fig. 09 |
| TIP! |
When starting a new wire the Active Layer box (remember it's on the top left just under the File menu) tells you what layer the wire (or cirle or polygon) is going to be drawn in. If it is set to "auto" it picks the layer under the mouse.
|
Save
Let's say we were laying out this NAND gate for a standard cell library. Furthermore, assume that the power and ground rails are run in metal 1 (M1) and that they are 2um wide.
If the box isn't the size you want it (see the lower left corner for the box size) you can make the box exactly 3um tall.
You can also place the box exactly where you want it by selecting Box Coordinates from the Misc menu.
| TIP! |
Once you have painted the top power line you can move the box, or simply
duplicate the top power and move it down.
If you duplicate it and hold the shift key down while moving it, the duplicated metal will remain lined up with the top metal. |
| TIP! |
You can also stretch an edge of any width using the Edit Edge command a a found in the Edit menu. Simply type a. The cursor changes to a little pointing finger to let you know you are in Edit Edge mode. Now move the finger over the edge you wish to stretch. A little select box will show you which edge you are over. Once you have the edge you want hold down the left mouse button (Button-1) and move the mouse in the direction you wish to stretch the edge. Release the button when the edge is where you want it. |
![]() |
| MAX Tutorial Fig. 10 |
Notice that the inputs and outputs are all found within the power straps. What if they need to be brought out so a router can get to them?
Let's assume the router requires all signals to be at the top of the cell and in M1. You need to route the poly wires over the M1 power straps and then change to M1.
Wire mode in MAX can make this job easier since it can change layers for you.
Notice that the contact tracks the vertical location of the mouse for you.
Also notice that the DRC is working while you are moving the contact.
Whenever you get too close to the M1 Vdd line, the little white DRC dots appear.
As you continue dragging the mouse upward notice that you are now in M1.
The generic technology file we have included (mmi25) has four layers of metal.
| TIP! |
Typing d in wire mode drops a contact and brings you up to the
next higher layer.
If you want to go down a layer simply type Shift-d and the wiring tool will drop a contact or via and bring you down to the next lower layer. |
There are LOTS of other options in the wiring tool, such as "snap to grid", "wire in 45's", "change wire layer", etc.
One of the options is w which brings up a more extensive Wire Tool Menu (also found as Wire Menu... Shift-w under the Edit menu). This menu gives you options like the Active Layer (which can also be set via the Active Layer box in the upper left corner of MAX), the default layer, snap options, and you can even override any or all of the wiring parameters.
| TIP! |
Remember, for a list of all the options (hot-keys) while in wiring mode, hit the space-bar, or select hot-keys in the Help menu.
Space-bar works for ALL modes in MAX. |
Your cell should now look like this:
![]() |
| MAX Tutorial Fig. 11 |
We are getting ready to finish this cell and your boss has just informed you that the power rails have been changed from M1 to M2.
But wait! You also have some poly within the box. If you erase everything inside the box your poly will also go away.
MAX allows you to selectively erase layers.
Like the painting function, erasing works from both the palette and by clicking the layer on the actual layout.
Once you have erased the M1 layer notice that your box is exactly the size it needs to be for the M2.
| TIP! |
There are several ways to accomplish what you just did.
For example, rather than drawing a box around the M1 power lines - which also selects the poly crossing over it - you could click the left mouse button (Button-1) over the M1 power line to select it. Once selected hit the delete key to delete the selected item. Or click the right mouse button (Button-3) over blank space. |
| NOTE: | "Delete" will delete whatever you have selected including paint, polygons, gcells, and sub-cells. |
| TIP! | There are several options to mouse selection. |
Once you have selected the layer, rather than delete it and replace it with another layer, you can also use the nifty little "Change Layer" feature found in Object Properties under the Edit menu.
Now go ahead and attach the power and ground lines to the new M2 straps.
To do this simply use the wire mode.
| NOTE: | This will introduce a DRC error if your layout looks exactly like this demo. |
![]() |
| MAX Tutorial Fig. 12 |
|
You could also jog the M1 output, or the poly lines going under the
M2 as well. It's up to you.
However you do it, your design should now be DRC correct and look similar to this: |
![]() |
| MAX Tutorial Fig. 13 |
One last thing before we are finished with our Nand gate.
It would be very useful to have labels on our layout.
In the max label edit box you can choose for the labels to be either a point or a box. You can also set the label's direction (N,S,E,W, etc.) to place it on one side or another for easier viewing, and you can choose to make the label an input, output, comment, etc.
Marking labels as inputs, outputs, global, label, etc. can be useful for other tools.
At this point our little NAND gate example should be done, and yours should look something like the following:
![]() |
| MAX Tutorial Fig. 14 |
A few more advanced selection techniques before we go on.
Under the Edit menu live a few other interesting items.
We already know that we can select pieces of layout by:
To select instances or gcells:
Another way of duplicating layout is by using the Copy Cell Buffer command in the Edit menu. This command will copy the current cell buffer to a new file.
Rename Cell Buffer and Delete Cell Buffer, (both under the Edit menu) are two other useful commands for changing the name of or deleting the cell you are currently working on. In fact, the Copy Cell Buffer command was used to create an Inverter cell (INV.max) from the NAND cell we just finished.
Also, the Rename Cell Buffer command was used to rename "foo" to "NAND2.max".
Now let's use our NAND gate and an inverter cell to build something a little bigger.
You should now be editing "row.max".
This will give you four NAND2 cells in a row.
| TIP! |
A list of text commands can be found under the Help menu.
Double-click on a command in this list to bring up detailed documentation on it. |
| TIP! | You can zoom in while you are moving an object using z or t. Or, you can place the object and then zoom in and use the arrow keys for more precise placement. |
Your layout window should now look like the following:
![]() |
| MAX Tutorial Fig. 15 |
You can now see what's inside of the NAND2 cells and the inverter.
Ctrl-i will hide internals.
OK, now that we are here, let's say our boss comes over again and says "sorry but you need to bring the outputs to the bottom of the cells".
There are two ways to do this. We will use one method on the INV cell and the other (just to be different) on the NAND2 cell.
Once inside the cell you can add the output wire as you did before using the wire mode.
Now let's edit the NAND2 cell. To do this one we are going to use the Edit in Place option from the View menu.
Notice that the NAND2 cell you selected should
now appear darker than the other cells.
This tells you that you are now editing
that cell.
Your row cell should now look like this:
![]() |
| MAX Tutorial Fig. 16 |
Now, just for grins, let's wire up two of the gates. Since we wish to wire them up in row.max and NOT in NAND2.max , we must first make row.max our edit cell once again.
There are several ways to do this.
Then simply type e. This will make row.max the edit cell.
In general, push, pop, and edit in place work well for cells in the same hierarchy, while using the Cell List boxes is the preferred method for traversing larger, less connected databases.
| NOTE: | You can also tell which cell you are editing because it tells you in the MAX title bar. |
Notice that these wires are once again darker than the wires in the cells.
Here we have zoomed in to show a couple of gates wired up within row.max . You can see that the wires in row.max (the current edit cell) are darker than the wires contained within NAND2.max and INV.max.
![]() |
| MAX Tutorial Fig. 17 |
If you purchased MAX-LS, you have several added powerful features. These features include:
One reason for the power of MAX-LS is that both MAX and SUE have complete Tcl/Tk interfaces. This means that you can write and execute full Tcl programs in either tool. Tcl also provides a means for inter-program communication.
SUE and MAX use the notion of "send" commands to talk to each other. Cross-probing is one example of this inter-program communication. Automatic layout generation and fly-lines are also features gained by using both SUE and MAX.
We are going to use MAX-LS for this next example. Don't worry if you used SUE before. SUE and MAX are both from Micro Magic, so they have similar interfaces. You can also bring up the SUE tutorial if you wish to learn more about SUE.
To see how SUE and MAX can work together we are going to bring up a simple NAND gate in SUE.
This will bring up SUE and automatically load in the MyNAND.sue circuit.
Your SUE window should look like this:
![]() |
| MAX Tutorial Fig. 18 |
This will launch a new Xterm and start up MAX from that window.
The Layout Generator window should now come up.
This window has several options.
If you click on the Edit Per-Cell Options button you have various options like using gcells or paint for fets, enabline flylines, and automatically folding fets larger than a specified size.
If you turn share_contacts on the Layout Generator will automatically share contacts and diffusions for you.
(For now we don't want to change anything so just hit Cancel.)
The Edit Stdcell Options box gives you several options for producing standard cell-like layout.
The Edit Layers to Generate box gives you control over what layers the Layout Generator will automatically generate for you. This gives YOU, the designer, the ability to control what the tool does for you and what you want total control over.
![]() |
| MAX Tutorial Fig. 19 |
Notice that the devices have already been placed and correctly sized. Where possible the Layout Generator has even shared contacts and diffusions for you. Also, notice that there are fly-lines that connect the various nodes together. These fly-lines tell you how to wire things up correctly.
Now let's wire things up. First, let's wire up the left-most poly gates.
Did you notice that the fly-line tracked your wire as you drew it?
![]() |
| MAX Tutorial Fig. 20 |
This feature makes it easy to hook up cells correctly. All you need to do is
follow the fly-lines!
Your circuit should now look something like this:
![]() |
| MAX Tutorial Fig. 21 |
Making sure your circuit is wired up correctly is very important. MAX-LS provided flylines to help you accomplish this. But what if you imported some layout from another tool, or created the layout without the flylines and you want to make sure it's correct?
MAX-LS has a powerful feature known as cross probing. This allows you to select a piece of layout and highlight the corresponding object in the schematic, or vice versa. You can initiate cross probing from either SUE or MAX.
To start the cross probe from SUE you would select max cross probe init from the Sim menu just as you did to start up MAX. This time let's set up cross probing from the MAX side.
To do this simply:
Once MAX and SUE are done communicating, SUE will highlight the nodes it and MAX agree upon in blue, and MAX will highlight the same nodes in white.
![]() |
| MAX Tutorial Fig. 22 |
![]() |
| MAX Tutorial Fig. 23 |
You can also cross probe from MAX to SUE.
This is yet another way SUE and MAX help you keep track of your design.
There are several advanced features found in MAX which were NOT covered in this tutorial.
For example, customizations are possible over a wide range, from minor user preferences (controlled by the .maxrc file) to megacell generators. See the MAX Manual under Help for more details.
To learn more about MAX go to the MAX Manual.
To learn more about SUE go to the SUE Tutorial.
For documentation on any MMI tools use mmidoc.
And, as always, the best way to really learn a program is to use it. We at Micro Magic hope that both SUE and MAX help you do better designs in less time.