p2m Tutorial

WHAT IS p2m?

p2m is a plug-in for converting image files into formats that are compatible with integrated circuit and printed circuit board layout tools. This allows the user to include pictures, signatures, logos, etc., on the fabricated chip or board. Some users have used p2m to implement actual circuit elements such as spiral inductors and antennas.

Here is a simple example, one of the first images that we placed on one of our prototype integrated circuits:

Example

Here's another example, this time showing that you can put your picture or signature on your circuit! In this case it is a mulitchip module substate.

Example

p2m can generate native layout files for the Cadence, Magic and Mentor layout packages in addition to CIF, which most, if not all, major layout editors can handle. Of course, as a GIMP plug-in, it can handle virtually any sort of image file format.

We will see below that p2m includes support for implementing color images. Thus given a palette that associates the different layers of your manufacturing process with their colors, p2m can dither the image using only the colors that your process provides, and create a layout in color that approximates the colors in the original image. Depending on the colors available in the palette and the colors that make up the image, the approximation can be very close.


Simple single-layer layout example

Here is a simplified example to aid in understanding the process. In this example we want to place a two-color picture of Wilber on our chip. We are going to use the CIF file format. We simply open up the image, do any editing, cropping, etc. that we want to do to it, and then use the File/Save As... menu item. In the "Save Image" dialog box we can just choose wilber.cif or, as in the example, use the Determine File Type menu to select CIF. When we select OK in the "Save Image" dialog box, the file_cif_save save handler pops up a "Save Parameters" dialog box. In this dialog box we can determine the size of the resulting layout as well as the layer(s) used. In this case, we want to use two colors so we just choose the 1-Bit Palette option, and we have chosen the layer CMT, which is CIF's way of saying the third metal layer on our IC. Then we adjust the size parameters. It is possible to choose either the size of the box that your layout will fit in (Final height and Final width entries) or the size that each layout rectangle will be. The plug-in assigns one rectangle for each pixel in the image. So if your image is 50 by 50 pixels and you choose 2 microns per pixel, the final image size will be 100x100 microns. The dialog box figures this stuff out for you. It also allows you to make the pixels rectangular instead of square. To do this you need to unselect the Constrain Ratio check button. Then just hit OK.

Example p2m session

The file_cif_save save handler dithers the image to two colors and saves it as a CIF layout. The file_cif_save save handler is a little different from all of the other save handlers. This is because importing CIF files into your layout requires that you know the top level cell name. Thus, the file_cif_save save handler pops up a little message box to let you know what the name is:

The result of hitting OK

The file wilber.cif is a file that your layout tool can import to include the image in your layout. It will contain something that looks like this:

What the CIF file looks like

Note that in this case a lot of the rectangles are on the CMT (third-layer metal) layer. This is because we chose an image with a white background and this is a very important point. When you do a 1-Bit image you need to make sure that you choose a layer that contrasts with the substrate or whatever the background is. Thus you may need to invert your image for it to look right on your chip or board, or you may need to place a big rectangle of some contrasting layer under the layer that you are using. By the same token, if you print out a plot of your layout on paper, the colors used to plot your layout are almost certain not to be the same as the colors on the fabricated circuit.


Simple three-layer layout example introducing color

In the next example, our integrated circuit process includes many layers, some of which have different colors. We will tell p2m to dither the image using three of those colors using a palette. Then for each pixel in the image, p2m will place a rectangle in the layout on the layer that corresponds to that color.

The easiest way to create the palette is to use GIMP's palette editor. We simply take a picture of a chip made with the same process, and use GIMP's color picker to add colors to the palette. Here's a small bit of a picture of a chip that was made using our example manufacturing process:

Example chip

We use the color palette editor to associate colors from the chip photo to layers in the integrated circuit process: In the screenshot above, we have just added the third color to our palette, which we just created using GIMP's Palettes dialog and which is called wilber. This is the highlighted color in the "Palette Editor" dialog. (Note that we have set the name of the color to be CMT. This is the CIF layer name for third-layer metal. You need to make each color's name in the palette the same as the name your layout tool uses for that layer in your manufacturing process.) When we save the palette it is saved in our palettes directory as wilber.gpl. If you don't want to use the GIMP palette editor to create your palette you can do it manually, you just need to save it in a place where GIMP can find it. See the example palettes.

In this case, we have chosen three of the layers available that have colors close to the colors needed to make up the image. As with the 1-Bit example above, the choice of the colors may depend on the background that the final layout is going to be placed on. Please note that there is a reserved layer name that you can use in your color palette to refer to the background. It is "Background" and is treated different from the other layer names. If a pixel in the image is of the color assigned the name "Background" p2m will not place a rectangle in that position. Thus, in our example here, we might add the pink color of the substrate to our palette and assign it the name "Background." This was not done in the case of our example because our image doesn't have much use for pink.

Now we save the file as wilber.cif as before, but we choose the "Use Custom Palette" radio button and select the palette named wilber.gpl:

Example
And when we hit "OK" the plug-in dithers the image using wilber.gpl:
Example
Here is a comparison of the original image, the single-layer, and the three-layer images to give you some idea of how even a small number of colors can make your image look much more like the original:
Example