DCellInstArray Qt5 Array Instance Properties

edited October 9 in Python scripting

Hello,
I found a rather suprising behaviour of the Instance Properties display of instance arrays. The arrays were produced by the code:

arrbox=cur_layout.create_cell('box')
arr_box.shapes(bLayer).insert(DBox(-60.0,-210.0, 1360.0, 1510.0))
Box_vrow=DVector(0.01,1750)
Box_vcol=DVector(1450,0.01)
cur_layout.cell('Top').insert((DCellInstArray(arr_box.cell_index(), DTrans(), Box_vrow, Box_vcol, 5, 6)))

The DCellInstArray has a proper behaviour, so the placement of the boxes is correct for both cases, but the display in the "Instance Properties" is somehow irritating.

one time with wrong display
Box_vrow=DVector(0,1750)
Box_vrow=DVector(0,1750)

one time with correct display
Box_vrow=DVector(0.01,1750)
Box_vrow=DVector(0.01,1750)

On Windows10
Klayout 0.26.5 downloaded from klayout.de
Python 3.7

Comments

  • I guess this was after you saved the file to GDS.

    Saving to GDS will "normalize" the arrays as some tools (Cadence Virtuoso in older versions for example) insist on a certain convention. "Rows" for these tools are supposed to be really "rows" and columns to be really "columns" (GDS internally is agnostic and accepts every kind of a/b vectors as long as they are not collinear). These tools also only accept orthogonal arrays (Mosaics in Cadence terminology). Hence this normalization happens only for this case which is your first one.

    OASIS will not perform such a normalization.

    Matthias

  • Hello Matthias,
    thank you for your reply. The file was saved as oas. I reproduced the behaviour of the code in the KLayout IDE and with by pure python coding using pya.
    with
    Box_vrow=DVector(0,1750)
    When using the KLayout IDE the array is displayed correctly before saving the layout as .oas file via the GUI in Klayout, but shows the swapped values after reopening.
    On Windows10
    Klayout 0.26.5 downloaded from klayout.de
    Python 3.7

  • Hi Leo,

    I stand corrected. OASIS also has a reason to modify the arrays as it employs type 1 repetitions for orthogonal arrays. These impose a definition of "row" and "column".

    I general, don't rely on the exact representation of an array. This is not a bug, but a rather a consequence of the file formats and the expectations of consumers of these files.

    Matthias

Sign In or Register to comment.