Can KLayout do Layout comparison (LVL)?


Can KLayout do Layout comparsion for two gds?
Could anyone give me some related website page about this ?

Best regards!


  • edited August 2021


    If you mean geometrical equivalence, there are two tools for this, both in the "Tools" menu:

    1. XOR
    2. Diff

    XOR does a mask check - it will report places where the polygons differ. It does not check for logical equivalence (same hierarchy, cell names, labels ...). "Diff" will look for logical differences.

    When you have large layouts, use XOR with "tiling" enabled (give a reasonable tile size - I typically use 500µm). Otherwise memory overflow is likely to happen. You can utilize multiple cores to improve performance. You can also specify a tolerance to remove differences generated by numerical jitter (grid snap) or intentionally (biasing).

    If you mean electrical equivalence, it should basically be possible to extract a netlist from one layout and to an LVS against that with the other layout.


  • Hi, @Matthias,

    Thank you very much for your respond.
    It does take effect. This software is very powerful and thank you for developing this software.
    There is also something strange.
    When I choose “Hierarchical(Consider hierarchy)” , it will get stuck.

    Bedide, what does “Heal result shapes” stand for?

    I also tried the method "Diff".
    It seems that this method will also give XOR result (but it is hierarchy) and cell name difference.

    Does I understand right?

  • edited August 2021

    @Weiling_Zheng I'd not recommend the "hierarchical mode" for now - it needs some polishing to be useful in the general case.

    "Heal resulting shapes" will try to merge XOR shapes which have been cut during the tiling step (i.e. crossing tile boundaries). When you use this option, the resulting XOR difference count is more representative for the real number of differences at the cost of additional run time.

    The Diff tool can do XOR, but only locally in a cell. This does not take into account the environment the cell is embedded. So false positives are possible. XOR in the Diff tool is rather an option to visualize the geography of the differences.


  • Hi, @Matthias ,
    Thank you very much for your detailed respond.
    I got it.

    Best regards!

  • Hi @Matthias ,
    like above we can do on GUI.
    can we do compare layout vs layout like above by macro?.
    Please let me know If you have any code example.

    Thank you,

  • Have a look at the strmxor buddy tool for xor’s.

  • Thank you, @StefanThiede
    can you show more detail?. Where do i find this tool on klayout?


  • i saw it in forum. :)

    thank @StefanThiede

Sign In or Register to comment.