[Magic-dev] RE: pplot

R. Timothy Edwards tim.edwards at multigig.com
Tue Sep 21 11:22:40 EDT 2004


Dear Graham,

>   I've spent some time trying to get nice plots from Magic.
> I use a program called pplot, which is old but can still be
> found thru a Google search. I think it is related to the plot
> routines in Magic.

Yes, it's related to the routines in Magic.  I hacked on pplot
while I was a student with Mike Godfrey at Stanford in the
early 90's, and made it pass the "CIF torture test" and
introduced color (a major improvement---nobody can make heads
or tails of a black & white VLSI layout).  The final version
of that is on my website at:

	http://bach.ece.jhu.edu/~tim/programs

(one directory above the Magic website).  To make the Magic
"plot postscript" command, I took my most recent version of
pplot, removed the CIF parser, and pretty much dropped the
rest of it into the Magic source distribution unchanged.
The primary difference is that "plot postscript" in magic
draws layout from the Magic database, not CIF/GDS.  On the
other hand, it is fairly simple to make a tech file for
magic that makes a 1:1 correspondence between CIF/GDS and
magic layers.  That makes a fairly convenient way to get
plot output from a GDS file.

One note on "plot postscript" vs. "plot pnm": "plot postscript"
generates lots of lines and patterned fills.  The detailed
output is appropriate for plotting subcells and such.  However,
on chip-level plots, the detail is all lost anyway, and the
PostScript output tends to be prohibitively large.  "plot pnm"
does not produce detail, but is good at color blending on
sub-pixel dimensions, so it can keep a reasonably good
representation of fine detail at large scales.  The larger the
chip, the more the output of "plot pnm" looks like a photograph.
"plot pnm" also produces huge output files, but it's very easy
to read the pnm file into a program like "gimp" or "xv" and
produce a compact JPEG image file.

One trick to get smaller files from "pplot" is to pass it, on
the command line, a list of layers not to draw.  At a certain
scale it makes sense not to draw labels, bounding boxes,
contact cuts, wells, implants, etc., but only metal layers,
poly, and diffusion.

The PostScript trick needed to draw patterns for each layer that
can blend with each other is in the coordinate system of the
rendering device.  This makes the patterns look unusually large
in ghostview on a computer monitor (native resolution ~75dpi)
but looks exceptionally nice on a 600-1200dpi color laser printer.
The monitor view problem can be resolved by viewing the postscript
under "gimp", which knows how to manipulate ghostscript to
generate device-independent output at a specified resolution, and
then subsamples the result to produce the monitor view.  If you
read the PostScript output from magic into "gimp" at a resolution
of 300 or 600 dpi (there's a dialog box that allows you to select
this), you get a reasonable screen-viewable result.  So the dual-
OS setup you mention can also be duplicated entirely on a Unix
system using Magic and gimp (theoretically; I haven't tried 
turning the method into a batch process.  That would be a nice
thing to have in the Tk-based Magic GUI).

				Regards,
				Tim


More information about the magic-dev mailing list