Cells and instances · 3 of 4
Attributes
Attributes are values that a cell computes from its parameters and makes available to others:
cell Mmi {
param {
wg_len size = 10um
mmi_len size = 30um
}
attribute {
total_length wg_len * 2 + mmi_len
description "a simplified MMI"
}
...
}An attribute is read-only. Inside the cell it is used by its name, like a parameter. From outside it is read through a named instance, after a dot — and so are the instance's parameters:
place Mmi at (0, 0) as a
place Mmi at (a.total_length, 0) as b # b starts where a endsAttributes can use parameters, global constants and other attributes. They are also written to the GDSII output, together with the parameter values, so that tools can read them back.
Exercise
Give Mmi an attribute total_length, the length of both waveguides and the body together. Then use it in Chain to put the three splitters end to end, the first one at the origin.