A: The files are located in /usr/class/ee271/magic/tutorial. A postscript version of the actual tutorial text is in /usr/class/ee/src/magic-6.5/doc/.
Q: How can I add a directory to the magic search path?
A: Everytime you start magic it looks for a .magic file in $CAD_HOME/lib/magic/sys/, your home dir, and the dir that you invoked magic from. Edit the .magic file in your home dir and add the line
For example, say I wanted to add the magic dir in our class dir to the search path. I would add the line
A: You have /usr/local/bin in your path before /usr/class/ee/bin. There is an older version of magic located in /usr/local/bin. Edit your .cshrc so that /usr/class/ee/bin appears before /usr/local/bin in your path.
Q: I'm in magic and trying to access the layout window(s) with the mouse I keep clicking and clicking, but nothing happens. Has magic crashed?
A: Maybe, but maybe not. Make sure that there is not a ":" on the text entry screen. If there is, it means that magic is waiting for you to finish entering your text command. Just hit return, and the layout window will respond normally again.
Q: I try to type a text command (not a macro) into magic, and it goes crazy and does a bunch of weird stuff.
A: You might have forgotten to put a ":" before entering the text command. You enter macros (e.g. z for zoom) without the ":", but text commands must have the ":" (e.g. :open /usr/class/ee271/palette). Otherwise magic interprets each text command letter as a separate macro. Hence the bunch of weird stuff that happens.
Q: When I activate the grid all I see is a single black dot. This does not make me happy ...
A: You are zoomed too far out, and magic cannot display the grid lines because they are too close together. Try zooming into the layout. The black dot that you see is the origin of the coordinate system.
Q: I want to edit this layout, but everytime I try Magic says: "The box isn't in a window on the edit cell." Help!!
A: You need to make the cell you want to edit the edit cell. Do this by putting the cursor in that window over empty space. Now type the s macro to select the entire cell. Now type :edit. That cell is now the edit cell.
If you look at the title bar of the layout windows you will either see a little message indicating which cell is the edit cell.
Q: How can I print out my magic layout?
A: We use a utility called pplot to print the layouts. If you have setup your path correctly, you should be able to invoke pplot. Pplot uses a file format called CIF. You can generate a .cif file from magic layout by doing the following while in magic:
Usage: pplot [options] cif-file
-l allText option.
The -d option allows you to set the number of levels of hierarchy that you push down.
Q: How can I plot my layout with no labels?
A: Use the pplot with the -l allText option.
Q: How can I plot only pushing down X levels of hierarchy?
A: Use pplot with the -d flag. See the pplot usage above.
Q: How can I generate a postscript file from my layout?
A: Use pplot with the -k flag. See the pplot usage above.
Q: What is inside of a Mosis i/o pad?
A: The io.mag cell has a buffer (set of 2 inverters) from the pad and a non-inverting tri-state driver to the pad. There are 3 nodes that make-up the inputs from the outside to the chip core. The node IN_unB is the raw connection to the pad (don't use this). The node INB is the value at the pad after one inversion. The node IN is the value at the pad after 2 inversions.
The output tristate takes its data input from the node OUT and the enable from the ENABLE node. If you want a true bidirectional wire, you will need to build another tri-state.
If the pin is a dedicated input, remember to ground the ENABLE and OUT nodes. Floating nodes are bad!
Take a look at the MOSIS documentation on the pad frame
http://www.isi.edu/mosis/cell-libraries/scn20-pads/scn20-pads.docfor more info.
Q: What is the correspondence between the pads and the actual pins numbers of the package?
A: On the MOSIS web site there is a diagram that shows this. The URL is
http://www.isi.edu/mosis/packaging/standard-frames/40pc22x22-info.ps.There is a copy of this diagram in the pad frame directory. It is named pad_to_pin.ps.
Q: When I generate a .cif file, I get a "parent-child don't agree" error. What is the problem?
A: The problem is a quirk of magic. Magic bloats the diffusions (normal diff and well contacts) to be a little larger than what you specify. The way that the hierarchy works in magic, an upper level cannot remove paint from a lower level. What has happened is that the diff bloat in a lower level (child) conflicts with some feature on the upper level (parent).
Say in the child, you have some n-diff for a transistor. In the parent, you put a well contact (p+ diff) right next to that n-diff. In the child, the n-diff is bloated around the drawn feature. In the parent the well contact precludes the well bloat in that area. Thus there is a conflict.
You will have to modify the cell in some way so that this does not happen. In the example above, the easiest thing to do would be to move the well contact into the child.
Q: When I extract my layout magic says I have warnings. What are these warnings and how can I fix them?
A: These warnings usually have to do with labelling. Magic paints little white hash marks over the area that causes the warnings. You can use the command ":feedback find" to list out the warnings one by one (repeat the command for the next warning). Magic will put the box over the warning, so you can just do a zoom box (macro z) to locate the warning area.
The command ":feedback clear" will clear away all of the white hash mark area. Magic won't do this automatically after you fix the warning, so you will have to do it manually.
For a more complete list of commands dealing with feedback do ":feedback help".
Q: Is there a command for repeat-last-command?
A: The macro "." will repeat the last command.
Q: Is there online help?
A: The command ":help" will list out all the commands available in magic. If you want help on a specific command you can do a ":command help", replacing command with the desired command. For instance, ":drc help".
Q: Labelling is a real pain. I have to type ":label" every time. Is there an easier way?
A: You can use the netlist window for faster labelling. Look in the magic tutorials for a full explanation. Basically all you need to do is enter the command ":spec netlist". This will open up the netlist menu.
Left click on the label field, and enter all of the labels that you want to use. For multi-line buses, you only need to enter one of the bits (Bus_v1[0]), and you can increment the number from inside the netlist menu. End your list with a blank line.
Now you can place labels by clicking in the grey grid. Where you click in the grid determines where the label text is placed relative to the layout box.
Q: I am a lazy person. Do I really have to type whole commands?
A: You only need to type in as much of the command as it requires for magic to determine uniquely what that command is. So for the command "specialopen", the minimum that you need to type in is "sp". Since there are numerous other commands that start with "s", just typing "s" is not sufficient, but no other command begins with "sp".
Q: I just erased all of my .mag files. Is there any way to recover my layout from the other files?
A: First, you can frantically notify the sweethall people and see if you can get a copy of your files from the last time they were backed up. You probably won't get the most recent copy back, but you will get something.
Next, if you have the .cif specification of your design, you can read that back into magic, and restore the layout. You have to set the cif input style to whatever the output style you used was. The command would look something like ":cif istyl lambda=1.0(nwell)". Now you need to read in your .cif file with ":cif read file", replacing file with the file name.
Q: How do I make a cool layout like the palette that shows no DRC errors even though there are errors?
A: If you just want to see no error paint, you can issue the command
:see no error. If you want to create a cell like the
palette, that never shows error paint, you need to first create
the cell. Then use a text editor to delete all lines in the .mag
file that are for error paint and check paint (error_p,check_p).
Now as long as you don't edit the cell again, magic will assume that
the cell has been checked for DRC errors, and not check again.
Special note to the TA: In /usr/class/ee/src/magic6.5/doc/ there are 4 magic maintainer manuals.
Another note to TA: In /usr/class/ee/verilog/rsim/ are the PLI functions that snooper uses.
Another note to TA: Look in /usr/class/ee/src/irsim9.4/doc for
IRSIM analyzer documentation.
