In addition to the SREF (structure reference) which is a single placement of a structure (cell), GDSII has an AREF (array reference) which enables placement of 1D and 2D arrays. This is very useful for many types of IC layouts that include memory; identical memory cells are often arrayed in two dimensions.
An AREF record has a number of arguments:
Let's look at a 5 x 5 array of cells that have an extents of 50 um x 30 um and a gap of 2 um between them.
We are going to write an ASCII "equivalent" of a small GDSII file using this array.
LIBRARY ARRAY_EXAMPLE1.GDS unit:UM grid:1000
STRUCT RECT
BOUNDARY 1 0
0 0
50000 0
50000 -30000
0 -30000
0 0
ENDEL
ENDSTR
STRUCT TOP
AREF RECT M0 1.0 0.0 5 5 0 0 260000 0 0 -160000
ENDEL
ENDSTR
ENDLIB
If we use Artwork's ascii2gds program to convert this to GDSII here is what we see:
Rotating the Array
One would think that rotating this array by 30 degrees would be a simple matter of changing the rotation parameter, i.e.:
AREF RECT M0 1.0 30.0 5 5 0 0 260000 0 0 -160000
However this won't work! One actually has to compute the second and third pair of coordinates of the rotated array and enter those. I have no idea why this is the case but it is. So for the same array (but with reference point 0 20000 (instead of 0 0 ) we would have the following parameters in our AREF.
AREF RECT M0 1.0 30.0 5 5 0 200000 225167 330000 80000 61436
You can see in the illustration below how the locations for the second and third pair of coordinate parameters are calculated: