示例#1
0
 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)
示例#2
0
 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])
示例#3
0
 def test_collection(self):
     wires = list(
         sdn.get_wires(
             [self.netlist.libraries[1], self.netlist.libraries[1]]))
     self.assertEqual(len(wires), 6)
示例#4
0
 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)
示例#5
0
 def test_netlist(self):
     wires = list(sdn.get_wires(self.netlist))
     self.assertEqual(len(wires), 6)
示例#6
0
 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])
示例#7
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])
示例#8
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)
示例#9
0
 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)
示例#10
0
 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')
示例#11
0
 def test_outside(self):
     wires = list(
         sdn.get_wires(self.middle_inst,
                       selection="OUTSIDE",
                       recursive=True))
     self.assertEqual(len(wires), 1)
示例#12
0
 def test_both(self):
     wires = list(
         sdn.get_wires(self.middle_inst, selection="BOTH", recursive=True))
     self.assertEqual(len(wires), 2)