MAGIC TUTORIAL Getting Started: Login to one of the workstations located in ECEE 253 using login name iclab. There is no password so just hit [enter]. The local directory on each machine is /home/sp98/iclab. This is the directory you ll be in when you login. However, in order to access any files you create from another machine in the room you will need to change your working directory to cd /mnt/home2/sp98/iclab. This directory can be accessed from any of the machines in the VLSI lab. This is also the directory where you will find your personal directory. Everybody has a directory they are to do their own layout in. The directory names are the same as the individuals name. In addition, everybody already has a magic file (*.mag) in there personal directory. The file contains an area of 350x550 microns surrounded by 12 contact pads of length and width 100 microns, therefore the total are is 550x750 microns. When doing the layout you should never go beyond the border enclosed by the contact pads. If extra area is needed, unwanted contact pads can be removed to free up additional space. If this still doesn t work, you should talk to Professor Van Zeghbroeck or myself. When the layout is complete, you should copy all of your *.mag files generated to the following directory using the cp command: cp *.mag /mnt/home2/sp98/iclab/project. Background Info: Magic is a graphics program that you can use to draw and color rectangular shaped boxes. Each color corresponds to a different mask level, i.e. diffusion, gate oxide, via hole, and metal wiring. By drawing boxes with the appropriate colors you can create transistors and connect them together to form a circuit. When your layout is completed a file will be generated that extracts the different colors into four sets of data points. The data points give the positioning and size of each box you draw so that these patterns can be put onto chromium masks. Magic is run in a X-windows environment. To start X-Windows simply type startx [enter]. Six X-windows will appear. For our purposes, we really only need one window. Choose a window of your liking and type magic filename [enter], (assuming you ve already changed to your personal directory). This X-window will be the window where all magic commands are to be entered. Magic will open a graphics window and will display the contact pads. At this point you can start doing your layout provided you ve read the directions below on magic Commands and layout Rules. Note, if you re already familiar with magic you will still definitely want to read the layout rules and what the colors mean sections. For our purposes we have changed what the colors mean and changed the layout rules from what you re probably used to if you ve used magic in the past. 1
Magic Commands: Drawing a box: Drawing a box is done with the mouse. The left mouse button defines the lower left corner of the box while the right mouse button defines the upper right corner of the box. Coloring a box: The middle mouse button can be used to color a box by clicking on the appropriate color (Assuming the colors are already on the screen). When you first start only the blue contact pads will be present, therefore the only colored boxes you can create will be blue. However, there is another way to color boxes, by typing :paint red [enter] for instance the box will become red. Blue, Purple, Green, and Red boxes can be made in this fashion. Once the colors are already on the screen all you have to do is click the middle mouse button on the color you want. Drawing and coloring in boxes is all you have to do assuming you can somehow visualize the entire layout in your head and you never make mistakes! However, if for some reason you do make a mistake, the following is a list of basic magic commands to make your life a little simpler. Command Description magic filename Opens a new/already existing magic file :save Saves the work you ve done. Don t forget to save before exiting! :paint [color] Colors a box either blue, green, red or purple.. :zoom number or z (shortkey) Zooms in or out depending on the number. For example, :zoom 0.1 will zoom in a factor of 10 while :zoom 10 will zoom out a factor of 10. To zoom into a particular area of your layout, enclose it in a box (do not color the box) and hit z. :view or v (shortkey) Displays the entire layout in the graphics window. This is useful if you get lost and forget where you are or you just want to admire your beautiful layout. scrolling Clicking the middle mouse button on the scroll bars can be used to scroll up/down or left/right. :undo or u (shortkey) Will undo the last step. You can repeatedly hit u to undo up to the past 10 events (I think 10). :select or s (shortkey) Selects the object under the cursor. Repeatedly hitting s will select larger and larger areas assuming that they are electrically connected. selecting an area by boxing This is very useful! You can move, rotate clockwise, flip sideways, etc. any arbitrary chunk of layout by selecting it. To select an area enclose it in a box (don t color it in, just put the box around it) and type A, i.e. hit [shift] and the letter a. Every object inside the box will be outlined in white. :move [direction] [distance] Once in area is selected you can move the object u (up) d (down) l (left) or r (right) a specified distance. The distance is the number of grid spacings, each grid spacing is 1 micron. For example, :move r 10 will move the selected area 10 microns to the right. You can also just type :move [enter] and the bottom left corner of the selected area will move to where your cursor is located. :grid [number] Changes the grid sizing. The default is one micron, i.e. :grid 1. :grid 10 means that each grid spacing is 10 microns. Note, you will 2
:clockwise [degrees] :sideways :copy :box or b (shortkey) :del :quit not be able to see the grid when you first load the contact pads. This is because the grid spacing is too small to be seen on such a large scale. To see the grid you can :zoom in or change the grid sizing. Rotates a selected object a specified number of degrees, i.e. :clockwise 90 will rotate the object 90 degrees while :clockwise 180 will rotate 180 degrees. Will flip the selected object about the vertical axis. This is different than :clockwise 180! Copy a selected area, the bottom left corner of the copy is placed where the cursor is located. Will tell you the size of the box in microns. Deletes a selected object/area. Exits magic, if the layout has been modified since you last saved it magic will ask you whether you really want to exit. Advanced Commands: (These commands can save a lot of time!) :getcell Imports another layout as a subcell into the current layout. :expand Makes the imported subcells visible :array x y Arrays a selected area x number of times in the x direction and y number of times in the y direction. :edit Allows a subcell to be edited if it has already been selected. :writeall SAVES any changes made to the layout including the subcells. :stretch stretches an object in the x or y direction a specified amount. Example of Using Advanced Commands: If you re designing a logic circuit your layout will include numerous invertors, nand gates, nor gates, etc. Instead of drawing each gate separately you can open up a new magic file and design one invertor for example. This file should have a unique name. To make sure that it is unique give it a name like rlw-invertor.mag, i.e. your initials and a description of the layout. You can now close this magic file and open up your *.mag file which includes the contact pads. The invertor layout can be imported into the contact pad cell by typing :getcell rlw-invertor [enter]. A box will appear where the cursor was located with the description rlw-invertor. To see the layout type :expand [enter]. This subcell can now be arrayed using the array command or copied to a new location using the copy command. Once you have generated files for each type of gate in your circuit all you need to do is array and order the subcells and make the appropriate connections using the blue (metal) boxes. Note, a subcell cannot be directly edited once it is imported. To edit the subcell within the contact pad layout you must select it and type :edit [enter]. At this point only the subcell can be edited. To go back and edit the contact pads or metal layering levels you must select the top layer by placing your cursor in an open area and hitting s for select. Now by typing :edit [enter] you will again be able to edit the *.mag file. Note, if you have edited a subcell you cannot just :save the file, you must use the :writeall command described above. What the Colors Mean: 3
Each color corresponds to a different mask level. There will be four mask levels in all. The following is a list of the mask levels with the corresponding colors: Area Color Description diffusion green green rectangles will open up holes in the oxide for Boron diffusion gate oxide red red boxes select areas where the thin gate oxide is to be grown. aluminum metal blue blue boxes will define the Al connections between devices. Via holes purple purple boxes are areas where the diffusion oxide will be etched so that the Aluminum metal blue boxes can make contact to the p-type diffused regions. Note, to those of you who have used magic before, these colors are different than the ones you normally use. Layout Rules: The following rules will hopefully ensure that no matter how bad the alignment between layers the circuits will still work. Obviously gross misalignment can never be accounted for in design rules. 1. All diffusion areas green must be at least 5 microns (gridlines) apart. 2. All other colored boxes must be at least 10 microns apart. 3. All rectangles must be at least as large as the minimum feature size of 10 microns. Therefore a transistor with a W/L ratio of 1/1 must have a gate length of 10 microns! However, a transistor with a W/L ratio of 3/1 can have a width of 15 microns and a length of 5 microns. 4. The gate oxide must overlap both the source and drain diffusion areas by 10 microns. 5. The width of the diffusion region must be 10 microns wider than the width of the gate oxide on both sides. 6. Both diffusion and metal must overlap the via holes by 10 microns in every direction. 7. Metal contacts should overlap the via hole by 10 microns on every side. 8. Use common sense when laying the circuit out. Try to draw it with one power strip at the top and one ground strip at the bottom with your circuit in the middle. Layout out your circuit sequentially from one stage to the next going from left to right. 9. Remember, each small grid spacing is 1 micron!! Remember when your done to copy your *.mag files to the PROJECT directory. Printing the Layout: You may print the finished layout by going to a new x-window and typing: xgrabsc -o filename -s 3 -click -b 120 -cps -compress [enter] wait for the cursor to turn into an eye then click on the magic window with the middle mouse button. This will save the window in the file filename. Make sure the magic window is fully in view or you will print the obstruction in front of the window. The file can be printed to the local color printer by typing: lpr -Pvlsi filename [enter] Example transistor W/L=1: 4
Al metal inside of box G gate oxide S D 30 microns Diffusion regions Via holes 110 microns Example of a minimum sized invertor with a 3/1 ratio of driver/load: Gnd in Vdd 50 microns out 170 microns Note, gate length of the driver can be reduced to 5 microns, thus decreasing the gate width to 15 microns and the overall width to 35 microns. The total length in this case will be 165 microns. 5