Magic Tutorial
Magic Tutorial
Starting MAGIC
1. Save the technology le SCN6M DEEP.09.tech27 in your working directory. 2. Invoke MAGIC by typing magic -T SCN6M DEEP.09.tech27 <filename> at the command prompt 3. In the layout window go to Options menu and select Toolbar and Window Command entry checkboxes 4. In TechManager under options menu, verify if the correct technology le is selected 5. Following hotkeys will be useful for editing within the layout window: g: Toggle the grid display (Each square on the grid has dimensions lambda by lambda Z: Zoom out z: Zoom in u: Undo last action U: Redo 1
Note: The instructions below assume that you are using a 3-button mouse.
Basic Drawing
1. Select a rectangular region by clicking the left mouse button on one corner, and the right mouse button on the diagonally opposite corner. Size of the selected rectangle is displayed on the top right corner of the layout window. 2. To paint a selected area, either type :paint <name of layer> in the command window or, place cursor on the appropriate layer in the toolbar and press middle mouse button 3. To erase all the layers in a selected area, click the middle mouse button on an empty portion in the layout window 4. Selecting, Copying, Pasting and Moving: Select a rectangle and press a to highlight a selection. Place the cursor on a point that will be the bottom left corner of the destination and press c to copy and paste m to move
Layout of an inverter involves multiple layers such as nwell, pdiusion(pdi), ndiusion(ndi), polysilicon(poly), metal(metal1), and various contacts between these layers. Order of drawing these layers is not important. You can use the following steps to draw an inverter: 1. Make an n-well 2. Draw ndiusion and pdiusion regions and poly to make the NMOS and PMOS transistors 3. Draw metal1 VDD and ground lines 4. Connect the drains of the transistors and make appropriate contacts 5. Make a contact between nwell and VDD and p substrate and GND While drawing these layers, you have to pay attention to DRC errors - indicated by a red square in the DRC status window. Areas with DRC errors are hashed using white dots. In order to label a layer, click on it and type : label <labelname> in the command window. Use label names Vdd! and GND! for global nets. Save the layout using :save. Layout for the inverter cell should be abutable.
To make a 31 stage ring oscillator, you need to instantiate the single inverter cell 31 times. This can be done by pasting an abutable instance of an inverter 15 times in a row and 16 times in the next row upside down. Save the single inverter cell as say Inverter in the working directory. Invoke magic with a new le, say RingOsc To paste a single instance of the Inverter, type :getcell Inverter in the command window. To paste an array of Inverter instances type :getcell Inverter followed by :array <columns> <rows>, example :array 2 3 creates a 3 by 2 array of cells. The instance is visible as a white box. To view the contents inside this box, press x pointing the cursor on the instance To ip a selection vertically, select a rectangular area and press s to select it, and type :upsidedown in the command window. Make metal 1 connections manually between the two rows of inverters.
Save the layout and type :extract all. This will generate a .ext le. Type :ext2spice -c cmin in the command window to generate a spice netlist in the working directory. The -c option means do not extract capacitances smaller than cmin femto farads.