通过判断版图端口的domain.name,可以知道端口是电端口还是光端口:
如:
可以通过如下代码获取两个电端口(anode和cathode)的信息:
from si_fab import all as pdk
def get_electrical_ports(layout):
ports = layout.ports
electrical_ports = []
for port in ports:
if port.domain.__name__ == 'ElectricalDomain':
electrical_ports.append(port)
return electrical_ports
phase_shfter = pdk.PhaseShifterWaveguide()
phase_shfter_lv = phase_shfter.Layout()
phase_shfter_lv.visualize(annotate=True)
electrical_ports = get_electrical_ports(phase_shfter_lv)
for x, port in enumerate(electrical_ports):
print("The name of electrical port_{} is: {}".format(x, port.name))
print("The position of electrical port_{} is: {}".format(x, port.position))
print("The angle of electrical port_{} is: {}".format(x, port.angle))
print("The layer of electrical port_{} is: {}".format(x, port.layer))
print("The trace template of electrical port_{} is: {}".format(x, port.trace_template.name))
得到所有电端口electrical_ports 后,就可以输入端口名称、端口位置、端口角度、端口图层、端口迹线横截面等信息: