Tutorial:P2m

From NCSU EDA Wiki
Jump to: navigation, search

This tutorial is designed to show the new user how to use the GIMP p2m plug-in to create text labels and logos to insert into layouts using Virtuoso. At the end of this tutorial there is a link to a more advanced tutorial for users that want to use the full color capability of the plug-in.

Getting p2m

p2m is a GIMP plug-in. This means that it is a bit of dynamically-loaded code that GIMP loads on start-up if it finds it in one of the standard places.

p2m at the NCSU ECE Department

For users using Linux-based systems at NCSU, it is probably simplest to just copy the pre-compiled p2m executable into your private plug-in directory.

If you have never run GIMP before, you should start it up once so that it will create a GIMP directory in your home directory.

If you have already run GIMP, you will have a hidden directory in your home directory called .gimp-X.X where X.X is the version number of your GIMP executable. For most people at NCSU this will be .gimp-2.0.

Inside this directory, you will find a slew of subdirectories, one of which should be called plug-ins. If for some reason it does not exist, create it with the mkdir command.

Now, copy the p2m executable from ERL-space to your plug-ins directory. To do this you may need to get your local filesystem to mount /ncsu/erl. Here's how to do this (assuming you're using GIMP version 2.0):

% cd ~/.gimp-2.0/plug-ins
% attach erl
% cp /ncsu/erl/p2m/p2m .

N.B. This will only work right now if you are using a Linux computer.

Downloading p2m

Users not using Linux systems at NCSU will probably need to download the p2m source code, compile it, and install it. THIS IS REALLY QUITE SIMPLE! The code is available at The GIMP Registry. It comes with complete installation instructions and should only require most users to type two or three commands to install.

Using p2m to add text to a layout

Most people will want to use p2m to place text labels or logos on chip layouts. It is really quite easy. The following example shows how to do this in detail.

For a recent project we needed to label a rather large layout (by chip standards) with tier numbers and serial numbers. This was a 3D layout with multiple tiers (levels) of vertical stackup. The final layout of the lowest tier is shown in the following figure:

Biglogo1.gif

In this example we'll show the details for how the serial number at the bottom of the layout was created. First, it is important to know how much room you have for your logo. In the next figure we show rulers measuring the part of the layout where we want the logo to end up. It's an area about 10000 microns wide by 4000 microns tall.

Biglogo2.gif

The next figure shows several GIMP windows used to create the logo. We start by creating a new image with dimensions of 1000 wide by 110 tall. The main reason for choosing this size is to allow the use of a large font. By picking a large font we get lots of pixels in each character. This gives us nice, high-resolution characters on the final layout.

Biglogo gmaster.gif

The main GIMP window is the window at top left. The text tool is highlighted. The tool options window at the bottom left was created by double-clicking the text tool icon in the main GIMP window. Note that the font size is set to 100, and Antialiasing is turned off. Since we are going to end up rendering the letters with pixels that are either on or off, antialiasing will not help. In fact, it can make the edges of the characters look quite ragged. It is possible to do color images with p2m, and in that case antialiasing of the font can be beneficial. But in this case it is better to leave it turned off. (It might be an interesting exercise for the reader to try it both ways to see what happens....)

The text tool creates a new text layer which can be seen in the layers dialog box. The layers dialog box can be made visible by choosing Dialogs/Layers... in the menu at the top of the main image window.

Note that the text has to be inside the white background in the main image window. If you need to move it around, select the text layer in the layers dialog box and use the move tool, which is above the text tool and to the left. It looks like a plus sign with arrows pointing up and down and left and right.

Once you are happy with the text you need to flatten the layout to a single layer. Right click inside the image to bring up the menu....

Biglogo flattening.gif

To get p2m to give you the best estimate of how big the final layout will be it helps to crop the image so that the text fills almost the entire image. Use the crop tool. It looks like a knife and it is right above the text tool in the main GIMP window. Crop your image so it looks something like this:

Biglogo cropped.gif

Now you are ready to save the image to a layout format. The easiest way to get the layout into Virtuoso is to save the image as a skill file. Just right click on the image and choose Save As.... Then type a name that ends with .il. For example: /tmp/serial_number.il

The p2m plug-in will be called by GIMP (because of the .il extension on the filename) and it will put up a dialog box for the save parameters:

Biglogo params.gif

It is important to remember to choose a pixel size that is an integer multiple of your Manufacturing Technology grid. That way you won't get off-grid errors. In this case 15 microns/pixel works out to a logo that will be about 9250 microns wide, so it will fit nicely on the layout in the spot we have chosen.

The only thing left to do is to create a cell that has the layout in it. Simply type a new cell name into the Cell entry box in the library manager (in this case we are naming it serial_number) and choose Virtuoso as the editor.

Biglogo library manager.gif

When Virtuoso opens up an empty cellview for edit just type

(load "/tmp/serial_number.il") 

in the CIW. Now that the logo is in layout it is probably a good idea to Select All and do an Edit/Merge... This can drastically reduce the number of rectangles in your layout and speed up processing! In this example merging combines over 22000 rectangles into 11 polygons.

At this point you can also easily duplicate your layout or copy it to another layer.

Advanced p2m

The documentation that comes with the p2m plug-in contains a tutorial that shows the advanced user how to use the full color capability of the plug-in. In the near future that tutorial will be augmented and inserted here.

--Slipa 12:49, 8 September 2006 (EDT)