示例#1
0
def test_example():
    name = "tfr_prim"
    try:
        primitive_generator = main.get_generator(name, pdk_dir)
        data = primitive_generator().generate(
            ports=['p', 'n'],
            netlist_parameters={
                'w': '1e-6',
                'l': '1e-6'
            },
            layout_parameters={'dummy': True})
        export_to_viewer("test_example", data)
    except BaseException:
        assert False, 'This should not happen'
示例#2
0
def test_canvas_three():
    def _helper(c):
        c.addWire(c.m1, 'a', 1, (1, -1), (6, 1))
        c.addWire(c.m3, 'a', 2, (1, -1), (6, 1))
        c.addWire(c.m5, 'a', 3, (1, -1), (6, 1))
        c.addWire(c.m2, 'a', 1, (1, -1), (3, 1))
        c.addWire(c.m4, 'a', 2, (1, -1), (3, 1))
        c.addWire(c.m6, 'a', 3, (1, -1), (3, 1))
        c.addVia(c.v1, 'a', 1, 1)
        c.addVia(c.v2, 'a', 2, 1)
        c.addVia(c.v3, 'a', 2, 2)
        c.addVia(c.v4, 'a', 3, 2)
        c.addVia(c.v5, 'a', 3, 3)
        c.computeBbox()

    c1 = CanvasPDK()
    _helper(c1)
    c1.gen_data(run_drc=True)
    assert c1.drc.num_errors == 0

    c2 = DefaultCanvas(Pdk().load(layers_json))
    _helper(c2)
    c2.gen_data(run_drc=True)
    assert c2.drc.num_errors == 0

    export_to_viewer("test_canvas_3_c1", c1)
    export_to_viewer("test_canvas_3_c2", c2)

    d1 = {
        'bbox': c1.bbox.toList(),
        'globalRoutes': [],
        'globalRouteGrid': [],
        'terminals': c1.removeDuplicates(allow_opens=True)
    }
    d2 = {
        'bbox': c2.bbox.toList(),
        'globalRoutes': [],
        'globalRouteGrid': [],
        'terminals': c2.removeDuplicates(allow_opens=True)
    }

    assert d1 == d2
示例#3
0
def test_dig22inv():
    name = "dig22inv"
    primitive_generator = main.get_generator(name, pdk_dir)
    data = primitive_generator().generate(ports=['A', 'O', 'VCCX', 'VSSX'])
    export_to_viewer("dig22inv", data)
示例#4
0
def test_zero():
    pg = tfr_prim()
    data = pg.generate(ports=['a', 'b'])
    export_to_viewer("test_tfr_0", data)