Magic Tutorial #5: Multiple Windows - Managing Multiple Windows in Magic CAD Software, Papers of Electrical and Electronics Engineering

This tutorial from the university of california, berkeley explains how to create, move, resize, and manipulate multiple windows in magic cad software. It covers opening and closing windows, scrolling, saving window configurations, and editing colors. It also discusses the difference between windows displaying the same cell and different cells.

Typology: Papers

Pre 2010

Uploaded on 08/19/2009

koofers-user-j01
koofers-user-j01 🇺🇸

4

(1)

10 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Magic Tutorial #5: Multiple Windows
Robert N. Mayo
Computer Science Division
Electrical Engineering and Computer Sciences
University of California
Berkeley, CA 94720
(Updated by others, too.)
This tutorial corresponds to Magic version 6.
Tutorials to read first:
Magic Tutorial #1: Getting Started
Magic Tutorial #2: Basic Painting and Selection
Commands introduced in this tutorial:
:center :closewindow, :openwindow, :over, :specialopen, :under, :windowpositions
Macros introduced in this tutorial:
o, O, ‘‘,’’
1. Introduction
A window is a rectangular viewport. You can think of it as a magnifying glass that
may be moved around on your chip. Magic initially displays a single window on the
screen. This tutorial will show you how to create new windows and how to move old
ones around. Multiple windows allow you to view several portions of a circuit at the
same time, or even portions of different circuits.
Some operations are easier with multiple windows. For example, let’s say that you
want to paint a very long line, say 3 units by 800 units. With a single window it is hard
to align the box accurately since the magnification is not great enough. With multiple
windows, one window can show the big picture while other windows show magnified
views of the areas where the box needs to be aligned. The box can then be positioned
accurately in these magnified windows.
-1-
pf3
pf4
pf5

Partial preview of the text

Download Magic Tutorial #5: Multiple Windows - Managing Multiple Windows in Magic CAD Software and more Papers Electrical and Electronics Engineering in PDF only on Docsity!

Magic Tutorial #5: Multiple Windows

Robert N. Mayo

Computer Science Division Electrical Engineering and Computer Sciences University of California Berkeley, CA 94720

(Updated by others, too.)

This tutorial corresponds to Magic version 6.

Tutorials to read first:

Magic Tutorial #1: Getting Started Magic Tutorial #2: Basic Painting and Selection

Commands introduced in this tutorial:

:center :closewindow, :openwindow, :over, :specialopen, :under, :windowpositions

Macros introduced in this tutorial:

o, O, ‘‘,’’

1. Introduction

A window is a rectangular viewport. You can think of it as a magnifying glass that may be moved around on your chip. Magic initially displays a single window on the screen. This tutorial will show you how to create new windows and how to move old ones around. Multiple windows allow you to view several portions of a circuit at the same time, or even portions of different circuits.

Some operations are easier with multiple windows. For example, let’s say that you want to paint a very long line, say 3 units by 800 units. With a single window it is hard to align the box accurately since the magnification is not great enough. With multiple windows, one window can show the big picture while other windows show magnified views of the areas where the box needs to be aligned. The box can then be positioned accurately in these magnified windows.

2. Manipulating Windows

2.1. Opening and Closing Windows

Initially Magic displays one large window. The :openwindow [ cellname ]

command opens another window and loads the given cell. To give this a try, start up Magic with the command magic tut5a. Then point anywhere in a Magic window and type the command :openwindow tut5b (make sure you’re pointing to a Magic window). A new window will appear and it will contain the cell tut5b. If you don’t give a cellname argument to :openwindow , it will open a new window on the cell containing the box, and will zoom in on the box. The macro o is predefined to :openwindow. Try this out by placing the box around an area of tut5b and then typing o. Another window will appear. You now have three windows, all of which display pieces of layout. There are other kinds of windows in Magic besides layout windows: you’ll learn about them later. Magic doesn’t care how many windows you have (within reason) nor how they overlap.

To get rid of a window, point to it and type :closewindow

or use the macro O. Point to a portion of the original window and close it.

2.2. Resizing and Moving Windows

If you have been experimenting with Magic while reading this you will have noticed that windows opened by :openwindow are all the same size. If you’d prefer a different arrangement you can resize your windows or move them around on the screen. The techniques used for this are different, however, depending on what kind of display you’re using. If you are using a workstation, then you are also running a window system such as X11 or SunView. In this case Magic’s windows are moved and resized just like the other windows you have displayed, and you can skip the rest of this section.

For displays like the AED family, which don’t have a built-in window package, Magic implements its own window manager. To re-arrange windows on the screen you can use techniques similar to those you learned for moving the box for painting opera- tions. Point somewhere in the border area of a window, except for the lower left corner, and press and hold the right button. The cursor will change to a shape like this:

This indicates that you have hold of the upper right corner of the window. Point to a new location for this corner and release the button. The window will change shape so that the corner moves. Now point to the border area and press and hold the left button. The cur- sor will now look like:

(though we don’t think it’s as easy to use as the scroll bars). See the man page for infor- mation on it.

If you only want to make a small adjustment in a window’s view, you can use the command

:center

It will move the view in the window so that the point that used to be underneath the cur- sor is now in the middle of the window. The macro , is predefined to :center.

The bull’s-eye in the lower left corner of a window is used to zoom the view in and out. Clicking the left mouse button zooms the view out by a factor of 2, and clicking the right mouse button zooms in by a factor of 2. Clicking the middle button here makes everything in the window visible and is equivalent to the :view command.

2.5. Saving Window Configurations

After setting up a bunch of windows you may want to save the configuration (for example, you may be partial to a set of 3 non-overlapping windows). To do this, type:

:windowpositions filename

A set of commands will be written to the file. This file can be used with the :source command to recreate the window configuration later. (However, this only works well if you stay on the same kind of display; if you create a file under X11 and then :source it under SunView, you might not get the same positions since the coordinate systems may vary.)

3. How Commands Work Inside of Windows

Each window has a caption at the top. Here is an example: mychip EDITING shiftcell

This indicates that the window contains the root cell mychip , and that a subcell of it called shiftcell is being edited. You may remember from the Tutorial #4 that at any given time Magic is editing exactly one cell. If the edit cell is in another window then the caption on this window will read:

mychip [NOT BEING EDITED] Let’s do an example to see how commands are executed within windows. Close any layout windows that you may have on the screen and open two new windows, each containing the cell tut5a. (Use the :closewindow and :openwindow tut5a commands to do this.) Try moving the box around in one of the windows. Notice that the box also moves in the other window. Windows containing the same root cell are equivalent as far as the box is concerned: if it appears in one it will appear in all, and it can be manipu- lated from them interchangeably. If you change tut5a by painting or erasing portions of it you will see the changes in both windows. This is because both windows are looking at the same thing: the cell tut5a. Go ahead and try some painting and erasing until you feel comfortable with it. Try positioning one corner of the box in one window and another corner in another window. You’ll find it doesn’t matter which window you point to, all Magic knows is that you are pointing to tut5a.

These windows are independent in some respects, however. For example, you may scroll one window around without affecting the other window. Use the scrollbars to give this a try. You can also expand and unexpand cells independently in different windows.

We have seen how Magic behaves when both windows view a single cell. What happens when windows view different cells? To try this out load tut5b into one of the windows (point to a window and type :load tut5b ). You will see the captions on the windows change — only one window contains the cell currently being edited. The box cannot be positioned by placing one corner in one window and another corner in the other window because that doesn’t really make sense (try it). However, the selection commands work between windows: you can select information in one window and then copy it into another (this only works if the window you’re copying into contains the edit cell; if not, you’ll have to use the :edit command first).

The operation of many Magic commands is dependent upon which window you are pointing at. If you are used to using Magic with only one window you may, at first, for- get to point to the window that you want the operation performed upon. For instance, if there are several windows on the screen you will have to point to one before executing a command like :grid — otherwise you may not affect the window that you intended!

4. Special Windows

In addition to providing multiple windows on different areas of a layout, Magic pro- vides several special types of windows that display things other than layouts. For exam- ple, there are special window types to edit netlists and to adjust the colors displayed on the screen. One of the special window types is described in the section below; others are described in the other tutorials. The

:specialopen type [ args ]

command is used to create these sorts of windows. The type argument tells what sort of window you want, and args describe what you want loaded into that window. The :openwindow cellname command is really just short for the command :specialopen lay- out cellname.

Each different type of window (layout, color, etc.) has its own command set. If you type :help in different window types, you’ll see that the commands are different. Some of the commands, such as those to manipulate windows, are valid in all windows, but for other commands you must make sure you’re pointing to the right kind of window or the command may be misinterpreted. For example, the :extract command means one thing in a layout window and something totally different in a netlist window.

5. Color Editing

Special windows of type color are used to edit the red, green, and blue intensities of the colors displayed on the screen. To create a color editing window, invoke the com- mand

:specialopen color [ number ]

Number is optional; if present, it gives the octal value of the color number whose inten- sities are to be edited. If number isn’t given, 0 is used. Try opening a color window on color 0.

will load the color map from the file named techStyle. displayStyle. monitorType .cmap as above. If no arguments are given, the current technology style, display style, and moni- tor type are used. When loading color maps, Magic looks first in the current directory, then in the system library.