laylight tour
0/25
2/4

Cells and instances · 2 of 4

Parameters

Cells become far more useful with parameters:

cell Pad {
    param {
        side size = 80um
    }
    layer metal {
        shape rect with side, side as body
        place body at self.origin
    }
}

Each parameter has a name, a type and usually a default value. The types are those of the values: integer, number, size, angle, string, bool, point, and lists such as [size]. A parameter without a default must be given every time the cell is placed.

Inside the cell a parameter is used by its name. When placing the cell, with sets parameters by name:

place Pad with side = 60um at (0, 0)

Each combination of parameter values becomes a cell of its own in the output. With all the default values it keeps the cell's name (Pad); other values give it a name with a hash (Pad$1f3a9c02).

Exercise

Give Pad a parameter side, a size with the default 80 µm, that sets the width and the height of the square. Then make the pads of PadRow 40, 60 and 80 µm wide, from left to right.

loading compiler…

Edit the code, watch the layout, then press Submit to check your solution against the exercise.

Compiling…