0% found this document useful (0 votes)
226 views3 pages

Magic Tutorial

The document provides instructions for designing and simulating a 31-stage ring oscillator in MAGIC. It involves: 1) Designing the layout of a single inverter cell as the basic stage. 2) Instancing the single cell 31 times to implement the ring oscillator using abutment. 3) Extracting the SPICE netlist from the final layout for simulation.

Uploaded by

Gaurav Saini
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
226 views3 pages

Magic Tutorial

The document provides instructions for designing and simulating a 31-stage ring oscillator in MAGIC. It involves: 1) Designing the layout of a single inverter cell as the basic stage. 2) Instancing the single cell 31 times to implement the ring oscillator using abutment. 3) Extracting the SPICE netlist from the final layout for simulation.

Uploaded by

Gaurav Saini
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

EE 671: MAGIC tutorial

A. Mittal, M. Bose, N. Karanjkar October 7, 2011


Implement a 31-stage ring oscillator, each of whose stages is a 20/10 inverter (in the TSMC 180nm technology). 1. First design the layout of a single stage. The transistors should be implemented as single ngers. The single stage cell should be abuttable (in every direction, including after ips). 2. Use the cell that you have designed in the rst step to implement the 31stage ring oscillator. All connections except the ends must be done using abutment. 3. Extract the SPICE netlist for the nal layout created in step 2.

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

Drawing a single Inverter

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.

Making a ring oscillator

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.

Extracting SPICE netlist

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.

You might also like