Layout Knowledge Base

Automation

Why people write layout scripts

Because a thousand polite rectangles should not be a career. Record, repeat, parameterize.

The small job, the one a person can still see and still count.

You can place ten small connections by hand, and you should not plan to place ten thousand the same way.

A script places one named drawing with a start, a step, and a count. It will do exactly that, including a wrong step. Enter 2 where you meant 2 micrometers, and at 1000 database ticks per micrometer you have asked for 2 ticks instead of 2000. The vias pack into a smear, or they miss the strap, and they miss it evenly. A missed via is easy once the count reaches four thousand. The script uses the numbers you gave it.

The picture at the top of this page is the small job, the one a person can still see and still count. A teal strap, a navy strap, and ten copper vias spaced evenly between them. Each via is a cut that ties the two metals. Counting to ten is a fair piece of work. Counting to ten thousand is how a via gets skipped, doubled, or set one grid step off the strap. Hands still belong on the work that is not a loop. An analog pair you are matching by eye, a pad you are nudging away from a noisy neighbor, a polygon you have drawn once in your life: those are judgments. A row of identical cuts on a constant pitch is one judgment and a count.

The cell the script places

One via cell: teal metal, navy metal, and a single copper square

The second picture is one via, the cell the script places. Two metal landings and one copper square between them. The script should place an instance of this cell, not a fresh pile of rectangles at every site. Ten thousand instances of one cell stay editable. If the copper square must grow, you edit the cell and every stamp grows. Ten thousand copied polygons will not hear that edit. The picture at the top is ten of those stamps, already standing between the straps. The second picture is the drawing those stamps share.

A short script is a loop with a start, a step, and a count. Place the via cell at the first point. Step by the pitch. Stop at ten, or at ten thousand. The long straps may be drawn by hand or by the same script. What you refuse to do by hand is the repetitive click. You still choose the pitch, the layer, and the cell name. The script is obedient. If you tell it to stamp the via beside the strap instead of on it, it will do that evenly, and you will have a perfect row of opens.

Read the cell before you loop it. The copper square in the second picture has to sit on both landings, with the margin the process wants around the cut. A script that places a correct cell will place that margin every time. A script that builds each via from raw numbers, typed a little differently in two places, will invent a family of almost-vias. One cell is how you keep the family from forming. The top picture should be ten copies of the second picture, plus the straps that tie the row, not ten inventions.

What you still check by eye

Check the first stamp, the last stamp, and one in the middle against the second picture. The copper square should sit inside both metals the way it does in the cell. The pitch should match the number you typed, in the same unit the file stores. A via that lands on the grid inside the cell and off the grid in the loop is a unit mistake. Write the unit next to the number in the script so the next person does not guess. Two micrometers, written as two bare steps, is the smear.

Scripts also earn their keep on chores that are repetitive and easy to get tired of: a ring of dummy shapes, a label on every pad, a rename of a hundred cells so the names stay legal for the file you will send. They are a poor tool for the one device you are still moving because the circuit person is still thinking. Use your hand where each object gets its own decision. Use the script where the tenth object should be the same decision as the first.

Keep the script beside the layout. A row of vias with no script and no cell is a row you cannot regenerate when the contact size changes. The ten copper squares at the top of the page are easy to admire and easy to rebuild from the cell. When the count becomes ten thousand, you change a number. You do not click ten thousand times and hope the last click landed on the strap.

Look at both pictures together before you trust the loop. The top is the row a person can count. The second is the object the loop is allowed to stamp. If a stamp in the middle does not match the cell, or the pitch is not the step you can read beside its unit, the script has started drawing. Put the extra shape in the cell on purpose, or take it out of the row.

Count ten, then change one number

The ten copper squares at the top of the page are a row a person can count. The second picture is the object the loop is allowed to stamp: one cell, one origin, one pitch. Read the pitch beside its unit. A step of 2 micrometers stored as 2 ticks is a row that piles up on itself if the file’s tick is a nanometer, or a row that leaps if the tick is a micrometer. The script has to use the same unit the header uses.

If a stamp in the middle does not match the cell, the script has started drawing shapes of its own. Put the extra shape in the cell on purpose, or take it out of the row. Keep the script beside the layout. When the contact size changes, you change the cell and run the script. When the count becomes ten thousand, you change a number. You do not click ten thousand times and hope the last click landed on the strap.

Continue exploring