IP Manager Reference

Test classes

The following classes can be inherited to perform the described tests:

ComponentReferenceTest

Test LayoutView, NetlistView and CircuitModelView of a component against known-good reference files.

CircuitModelTest

Abstract base class for testing the CircuitModelView

VFab2DReferenceTest

Test a 2D virtual fabrication material result against a known-good reference file.

LayoutToNetlistTest

Test that the netlist (terms, instances, nets) extracted from the LayoutView matches the NetlistView.

CanvasLibraryTest

Generate an IPKISS Canvas library file (.iclib extension) from a library and compare it against the library's built-in reference.

SampleTest

Easily configure which sample files to automatically test with pytest.

Component reference tests

ip_manager.testing.ComponentReferenceTest groups a range of different tests against known-good reference files. The tests to need to be selected by marking the class with the tests to run using pytest.mark.comparisons:

from ip_manager.testing import ComponentReferenceTest, Compare

@pytest.mark.comparisons([Compare.LayoutToGds, Compare.GdsToGds, Compare.LayoutToXML, Compare.LayoutDrawingToXML])
class TestMyComponent(testing.ComponentReferenceTest):

    @pytest.fixture
    def component(self):
        # create component here

The available test configurations in the Compare object are:

  • Compare.LayoutToGds: compare the LayoutView to a reference GDSII file, without GDSII filters (TECH.GDISI.FILTER) applied.

  • Compare.GdsToGds: export a GDSII of the LayoutView, read it back in and compare with a reference GDS.

  • Compare.LayoutToXML: export the LayoutView to an XML and compare with a reference XML.

  • Compare.LayoutDrawingToXML: export the Layout elements to XML file, without port information and without the GDSII filters applied, and compare with a reference XML.

  • Compare.NetlistToXML: export the NetlistView to an XML and compare with a reference XML.

  • Compare.SMatrix: compare the S-matrix from a CircuitModelView in a given wavelength range to a reference S-matrix file.

Helper classes

The SMatrixTester class is useful for performing behavioral checks on the S-matrix resulting of a component’s circuit model. To get started, check out Add your own circuit checks.

SMatrixTester

Tools for conveniently testing an S-matrix as part of regression tests.

Functions

generate_reference_files([path, match_tests])

Generate or regenerate the reference files for the specified ComponentReferenceTest tests.