Help using the Magic software package

There are many Magic commands available. This is a brief guide to get you started.


Getting started

Type "magic" at the command prompt. You should see a graphics window pop up. You will be working with it and the text window that you invoked the program with.

If this does not work, try:

csh
setenv CAD_HOME /usr/local/cad-try
$CAD_HOME/bin/magic

Point (and click) on the graphics window. Then type commands, starting with a colon ":". For example ":load filename" and ":save". Note: Magic assumes that the filename has a ".mag" extension. If you type ":load myfile.mag", it will tell you that it cannot find it. When this happens, type ":load myfile", and it should work.

Once Magic is running, you can type ":quit" to quit the program.


Useful commands

Using the "Box" tool, position the bottom-left corner with the left button, and the upper-right corner with the right button. Type ":tool box" to switch to the box tool if you are not sure which tool you are using.

Use the paint command to indicate which layer you want to work with. For example, ":paint ndiff". You can also specify the colors, e.g. ":paint green". This fills in the box appropriately.

The layers (colors) that you will use the most are:
Use ":erase" to clear all layers under the box.

Use ":move (direction) (amount)" to move selected things in the direction you want. For example, ":move up 10" and ":move left 4". Notice that this moves the box. You can also have it move everything under the box as well if you use the select command.

Use the ":label name" command to mark inputs and outputs. You may want to make the box a single point first.

":select clear" clears all selections.

":grid 1 1" resets the grid to be 1x1

Useful shortcuts

In addition to the command above, there are many useful shortcuts.

q moves left 1
w moves down 1
e moves up 1
r moves right 1

u will undo the last command
? (Why?) - provides an explanation of the design rule violated (under the box) (may be y instead)
y (Why?) - provides an explanation of the design rule violated (under the box) (may be ? instead)
o opens a new window
O closes a window
g turns the grid on/off (same as ":grid")
G turns the grid on
b give information about the box

Try using these select commands with the ":move" command.
a selects all things in the box
s selects what is under the box (or adds more to the selection)
d delete the selected item(s)
c copy the selected item(s) to the new cursor location (do not click!)

z zooms in on the area under the box
Z zooms out
v view the entire design


More commands - working with cells

It is a good idea to make a part and replicate it as needed. For example, why draw a new inverter every time you need one? Instead, make one, save it, test it out to make sure it works, then load it into other designs as a cell. One difference between the dump command and the others is that dump puts the circuit in as if you just drew it. Suppose you use this command to put a copy of your 2-input NOR gate in your current design. If you later realize that you made a mistake in the NOR gate, you would also need to change the mistake within your circuit.
Back to the CSc 4250/6250 main page .
See gates drawn in Magic.


By Michael Weeks. Last update 12/11/02.