Magic-8.3 Command Reference

#

## plot

Hardcopy plotting

### Usage:

> plot option

> > where option may be one of the following:
> > postscript file [layers]
> >   Generate a PostScript file of layout underneath the box.
> > pnm file [scale [layers]]
> >   Generate a `.pnm` ("portable anymap") file of layout underneath the box. The output size is propotional to scale, where a scale of 1 is one output pixel per magic internal unit. The default scale value, if unspecified, is 0.5.
> >   Note: Magic version 7.5.45 changed the syntax to
> >   plot pnm file [width [layers]]
> >   where width is the width of the output, in pixels, having a default value of 1500 if unspecified (which is reasonably photographic when scaled to the size of a printed page). If the parameter "pnmplotRTL" is set to true, then output is filtered into HPRTL or HPGL2 format according to the "color versatec" style settings. In that case, the filename is optional; if missing, a temporary file is created.
> > svg file
> >   Generate an SVG (scalable vector graphics) file of the exact contents of the layout window. Note that this command has no options other than the name of the output file: SVG graphics are scalable, so no scalefactor is necessary, and it is intended as a WYSIWYG option. This option is only availble when magic is invoked with the Cairo graphics interface ("`magic -d XR`"), because the `libcairo` library has interchangeable back-end rendering engines and can quickly swap out the X11 window rendering target for an SVG file rendering target, something that cannot be done in the straight-up Xlib or OpenGL interfaces. Note that when rendering to the screen, no layout can be represented below the scale of a screen pixel, whereas with scalable vector graphics, all layout is rendered, no matter how dense. Therefore, for large full-chip layouts, the SVG output can be very large and very dense. For full-chip rendering, the PNM plot style is usually a better choice.
> > versatec scale [layers]
> >   Generate an HPRTL or HPGL2 rasterized rendering of the layout underneath the box. The scale value is an absolute scale, according to the physical size of the layout as determined by the CIF or GDS output style, and the resolution of the rendering device (i.e., printer or plotter). The device resolution is declared in the plot parameters (see below).
> > parameters [name value]
> >   Set or print out plotting parameters (see Summary below).
> > help
> >   Print help information

### Summary:

> The plot command generates hardcopy plots of a layout. The use of plot for any particular output format requires that the parameters of the format be defined in the plot section of the technology file. However, from magic-7.3.56, the PNM handler will create a default set of output styles from the existing layout styles for the technology. This makes plot pnm compatible with all technology files, regardless of whether or not a section exists for "style pnm".

> Each plot format has its own set of parameters, but all parameters are controlled with the plot parameters option. Valid parameters and their defaults are as follows:

> > General parameters:

> > parameter name | default value
> > showCellNames | true

> > PostScript parameters:

> > parameter name | default value | explanation
> > PS_cellIdFont | /Helvetica | Font used for writing cell use IDs
> > PS_cellNameFont | /HelveticaBold | Font used for writing cell definition names
> > PS_labelFont | /Helvetica | Font used for writing label text
> > PS_cellIdSize | 8 | Font size for writing cell use IDs (in points)
> > PS_cellNameSize | 12 | Font size for writing cell definition names (in points)
> > PS_labelSize | 12 | Font size for writing label text (in points)
> > PS_boundary | true | Whether to draw boundaries around layers in addition to fill patterns
> > PS_width | 612 (8.5in) | Page width of the target output
> > PS_height | 792 (11in) | Page height of the target output
> > PS_margin | 72 (1in) | Minimum margin to allow on all sides of the output page

> > HPRTL/HPGL2 parameters:

> > parameter name | default value | explanation
> > cellIdFont | vfont.I.12 | Font used for cell use identifier names. The default font is part of the Magic distribution.
> > cellNameFont | vfont.B.12 | Font used for cell definition names. The default font is part of the Magic distribution.
> > labelFont | vfont.R.8 | Font used for labels. The default font is part of the Magic distribution.
> > directory | /tmp | The directory used to store the temporary output file that is generated prior to spooling for the printer.
> > dotsPerInch | 300 | The native resolution of the target rendering device (printer or plotter)
> > printer | versatec | Name of the print spool queue.
> > spoolCommand | lp -d %s %s | The OS command to use to send the plot to the printer or plotter.
> > swathHeight | 64 | The number of lines of output resolution that Magic will generate at a time. Normally it is not necessary to mess with this value.
> > width | 2400 | The pixel width of the output device.
> > plotType | hprtl | The format of the plot to make. The choices are hprtl (equivalent to PCL5) and hpgl2 for the most common raster plot formats. The two (very!) outdated formats versatec_color and versatec_bw are retained for compatibility.

> > PNM parameters:

> > parameter name | default value | explanation
> > pnmmaxmem | 65536 | Maximum memory (in KB) to use to generate output. Larger values allow larger chunks of the layout to be processed at a time. Normally, anything larger than the default will just take a long time to render, so it's better to leave it alone and let the plot pnm routine downsample the image to fit in memory if the size of the layout requires it.
> > pnmbackground | 255 | Value of the background, where 0=black and 255=white. White is default to match the printed page, which is where the plots usually end up. A value of 200 is approximately the default background color in magic.
> > pnmdownsample | 0 | Number of bits to downsample the original layout. In the first pass, one pixel is generated for each n magic internal units in each of x and y, where n is the downsampling value. Each downsampling bit therefore represents a factor of 4 in decreased computation time. Generally speaking, downsampling causes information to be lost in the translation from layout to the PNM file. However, if the grid has been scaled from the original lambda, then downsampling up to the scale factor will have no impact on the output other than speeding up the rendering (because the minimum feature size is still in lambda, so no feature will be overstepped by the downsampling). For example, for a grid scaling of 1:10 the proper downsampling would be 3 bits. Note that layouts that are too large for the allocated memory blocksize pnmmaxmem will force downsampling regardless of the value of pnmdownsample.
> > pnmplotRTL | false | When set to value true, this parameter pipes the PNM plot output through the raster driver used by "plot versatec". This allows rendered, antialiased PNM plots to be sent directly to a printer. The versatec parameters are used to determine what format, printer, spooler command, temporary directory, and printer pixel width and resolution. The filename is optional in the "plot pnm" command when this parameter is set. If the filename is missing, a temporary filename will be generated for creating the file that is spooled to the printer queue.

> PostScript plotting is best suited for drawing small layouts with relatively few components. PNM plotting is best suited for drawing large layouts. For chip-size layouts, the PNM plots are virtually identical to chip photographs. From magic version 7.3.56, plotting PNM files requires no special entries in the technology file. Although such entries can fine-tune the output, this is usually not necessary. Also, since version 7.3.56, magic makes intelligent decisions about memory usage, so it's generally not necessary to change the PNM plot parameters. Raster plotting in HPGL2 and HPRTL formats are a good alternative to PostScript for printers and plotters that support those formats. The output is not scalable, but the size of the output plot is much smaller and the speed of rendering is much faster.

### Implementation Notes:

> plot is implemented as a built-in command in magic.

> Original plot styles versatec and gremlin have been removed, but shells of the code are retained so that magic doesn't complain when encountering styles for these types in a technology file.

Return to command index

Last updated: March 7, 2020 at 1:06pm