def test_wire_outside(self): wires = list( sdn.get_wires(self.middle_inst.reference.cables[0].wires[0], selection="OUTSIDE")) self.assertEqual(len(wires), 2) self.assertTrue( self.middle_inst.reference.cables[0].wires[0] not in wires)
def test_outer_pin_outside(self): inner_pin = self.middle_inst.reference.ports[0].pins[0] outer_pin = self.middle_inst.pins[inner_pin] wires = list(sdn.get_wires(outer_pin, selection="OUTSIDE")) self.assertEqual(len(wires), 1) self.assertIs(wires[0], self.netlist.top_instance.reference.cables[0].wires[0])
def test_collection(self): wires = list( sdn.get_wires( [self.netlist.libraries[1], self.netlist.libraries[1]])) self.assertEqual(len(wires), 6)
def test_href(self): href = next(sdn.get_hinstances(self.netlist.top_instance)) wires = list(sdn.get_wires(href, recursive=True)) self.assertEqual(len(wires), 6)
def test_netlist(self): wires = list(sdn.get_wires(self.netlist)) self.assertEqual(len(wires), 6)
def test_outer_pin_inside(self): inner_pin = self.middle_inst.reference.ports[0].pins[0] outer_pin = self.middle_inst.pins[inner_pin] wires = list(sdn.get_wires(outer_pin)) self.assertEqual(len(wires), 1) self.assertIs(wires[0], self.middle_inst.reference.cables[0].wires[0])
def test_pin_inside(self): wires = list(sdn.get_wires( self.middle_inst.reference.ports[0].pins[0])) self.assertEqual(len(wires), 1) self.assertIs(wires[0], self.middle_inst.reference.cables[0].wires[0])
def test_pin_all(self): wires = list( sdn.get_wires(self.middle_inst.reference.ports[0].pins[0], selection="ALL")) self.assertEqual(len(wires), 3)
def test_cable_all(self): wires = list( sdn.get_wires( self.netlist.top_instance.reference.cables[0].wires[0], selection="ALL")) self.assertEqual(len(wires), 3)
def test_port_outside(self): wires = list( sdn.get_wires(self.middle_inst.reference.ports[0], selection="OUTSIDE")) self.assertEqual(len(wires), 1) self.assertTrue(wires[0].cable.name == 'top_cable')
def test_outside(self): wires = list( sdn.get_wires(self.middle_inst, selection="OUTSIDE", recursive=True)) self.assertEqual(len(wires), 1)
def test_both(self): wires = list( sdn.get_wires(self.middle_inst, selection="BOTH", recursive=True)) self.assertEqual(len(wires), 2)