Magic

From Vlsiwiki
Revision as of 20:39, 10 March 2015 by Mrg (Talk | contribs)

Jump to: navigation, search

Magic is an interactive system for creating and modifying VLSI circuit layouts. With Magic, you use a color graphics display and a mouse to design basic cells and to combine them hierarchically into larger structures. Magic has built-in knowledge of layout rules - as you are editing, it continuously checks for rule violations. It has a built-in circuit extractor: from the layout, the extractor creates an output file suitable for use with circuit simulation tools such as Spice (for detailed, mixed-signal simulation) or IRSIM (for digital simulation).

Starting Magic, Text and Graphics Windows

Magic must be run from a workstation that supports the Unix X Windows system (although it can be easily compiled for Linux at home. Please contact me if you need help in doing this). Once you login to the Unix machine that runs Magic and setup your environmental variables (using source magic.cshrc), Magic is started by the shell command:

   prompt> magic [-Ttechnology] [file without .mag extension]

where technology is the name of the fabrication technology that the design is intended for, and file is the name of the file that you edit. You could type any file name for file, and Magic would start editing that file. If a file with this name does not exist, Magic will create it. If the technology option is omitted, the layout is done in a default technology. Fortunately, I have set up the default technology as AMI C5N 0.5u which is the technology we plan on using for this class. Therefore, just invoking magic is sufficient. If you wish to learn how to set up the default technology, feel free to contact me.

After starting Magic, a graphics (paint) window pops up, and a ">" prompt appears in the text (shell) window. Magic starts editing the file.

Magic is not a menu-driven program: the layout shows up in the graphics window, but all commands must be entered in the text window. The graphics window is an ordinary X window, and can be moved and resized using the mouse. With a two-button mouse (on a PC with X-server), pressing both buttons at the same time is equivalent to pressing the middle button (which is available on Unix systems). The graphics window is where you draw your layout. To work in this window, move the cursor to the window and click the left mouse button. This makes the graphics window active. The mouse should always point to the graphics window.

The text window is the same window from which you started Magic. It is convenient to position this window under the graphics window so that both windows are visible at the same time. All commands you want to invoke should be typed in the text window. All error messages are also displayed in this window. Commands can be invoked in Magic in three ways:

       By pressing buttons on the mouse;
       By typing long commands on the keyboard at the prompt ">" in the text window. The long commands are preceded by a colon :
       By typing single-character macros on the keyboard at the prompt ">" in the text window.

Before trying to use any command, make sure you have the graphics window active and that the mouse cursor is pointing to the active graphics window. The commands show up in the text window, but affect only the active graphics window.