[Home]Magic/FAQ

OpenCircuitWiki | Magic | RecentChanges | Preferences | Sandbox
Open Circuit Design | Magic | XCircuit | IRSIM | Netgen | PCB

Magic FAQ

1. Is there a faster way to input magic commands?
2. How does the undo command work?
3. What are some common Magic material shortcuts?
4. How can I move my design around easily?
5. How can I force text to be output on a different GDS layer data type?
6. How can I generate site-specific macros that won't get overwritten by a code update?
7. Why is the 'grid' statement in my .magicrc file ignored?

1. Is there a faster way to input magic commands?

A: Yes, Magic searches for the command sequence you have input and executes the command when it finds a single match. For instance, typing "pai" is just as effective as "paint". The following is a brief table of common commands and the shortest equivalent. Of course, using a longer version of the command will still execute it properly.

  Command          Shortest equivalent 
  paint            pai
  erase            era
  label            label
  polycontact      pc

Also, the "." will repeat the last command on the new selection. Highlighting an area and middle-clicking in a different region will paint the middle-clicked material into your highlighted area. This also works for deleting selections my middle-clicking an empty region.

Users with "readline" compiled in or users of the Tcl version of magic also have the shortcut key macros "p" and "l", which expand to "paint" and "label" on the command line, then wait for further input.

2. How does the undo command work?

A: Typing "u" will undo the previous command, including deletions. Repeating the command will undo previous command in sequence up to 100 commands back.
Magic versions 7.1 and up increased the undo sequence limit to 1000. Magic versions 7.4 and 7.5 implement selections in a more efficient way, so that Magic doesn't dump the whole geometry of the selection onto the undo stack. That was one of the most common reasons for Magic 6.5 to run out of computer memory.

3. What are some common Magic material shortcuts?

A: The following shortcuts can be used instead of the full material name after any command that takes that argument (paint, erase, etc.)
  Material          Shortcut 
  poly               p
  metal 1            m1
  metal 2            m2
  metal 3            m3
  m1 to m2 contact   m2c
  polycontact        pc 

Note that these "shortcuts" are different from the command shortcuts in that they are not "built into" the program. These abbreviated names are declared in the technology file "types" section, so they may differ from technology to technology.

Tcl-based Magic version 7.4/7.5 has an additional set of shortcuts made available by selecting the "options->toolbar" menu button, which brings up a display of each material type. While the mouse button is over the material type in the toolbar, typing "p" will paint the material into the box on the layout; "e" will erase the material, and "s" will select the material. Clicking the right mouse button will hide the material type from displaying in the layout, and clicking the left mouse button will restore the display of the material type. Clicking the middle mouse button is equivalent to typing "p"; it paints the material.

4. How can I move my design around easily?

A. There are several flip/rotate/move commands that can be used to manipulate your design.
  upsidedown       flips selected parts on a horizontal axis
  sideways         flips selected parts on a vertical axis
  rotate           rotates selected parts 90 clockwise

To move parts of your design, first select the parts to move by boxing the desired parts with the cursor and hitting the 'a' key. Then move the cursor to the location you want to place the lower left corner of your selection box and hit the 'm' key. To extend pieces and not lose the connections, select the parts to move and then move them using the numeric keypad. This will move the parts up, down, left, right and extend any connections to the parts to the new location.

The Tcl/Tk-based version of Magic has an interactive move feature. Hit the space bar until you get the PICK tool. When the PICK tool is active, you can still use all of the key macros, such as "s" and "a" to select paint, as well as using the left and right mouse buttons to move the cursor box around as usual. With something selected and the PICK tool active, click the middle mouse button for a "move" function. You will then be able to interactively drag the selection around with the mouse (you will see only an outline of the selection during this time). Every time you press the left mouse button, you will paint a copy of the selection into the cell. The middle mouse button will paint one last copy and exit, while the right mouse button will exit the interactive copy without painting anything more.

Pressing the shift key along with the middle mouse button performs an interactive "copy" function. This works like the interactive move except that the original selection is not deleted from the layout.

5. How can I force text to be output on a different GDS layer data type?

A. Divide your GDS output into two parts. For example,

       layer MET1 m1
       calma 10 0

       layer TEXTM1
       labels m1
       calma 10 1

The first block outputs metal1 paint as GDS layer 10 datatype 0. The second block contains no paint information but outputs labels attached to metal1 on GDS layer 10 datatype 1.

6. How can I generate site-specific macros that won't get overwritten by a code update?

A. Magic versions 7.4.52 and 7.5.102 allow a file called site.def to be placed in the main library path for magic (normally /usr/local/lib/magic/sys/). This file is sourced after the system startup file, and may contain any magic or Tcl commands. It is only available with the Tcl-based version of Magic.

7. Why is the 'grid' statement in my .magicrc file ignored?

A. Commands like grid apply to individual layout windows, and are independent from the database. At the time the .magicrc startup file is read, there are no existing layout windows. You have to set up a callback procedure in the .magicrc file to be executed every time a new window is opened. The syntax is:

      set Opts(callback) "grid ..."

This feature is only available in the Tcl-based version of Magic.


OpenCircuitWiki | Magic | RecentChanges | Preferences | Sandbox
Open Circuit Design | Magic | XCircuit | IRSIM | Netgen | PCB
Page is read-only (use admin password ocd_edit to make writeable) | View other revisions
Last edited December 2, 2008 7:33 pm by Tim Edwards (diff)
Search: