通过代码拼版:
所有代码如下:
from si_fab import all as pdk
from ipkiss3 import all as i3class Design1(i3.GDSCell):def _default_filename(self):return "Ring_Test.gds"def _default_name(self):return "Design1"class Design2(i3.GDSCell):def _default_filename(self):return "routed_opa.gds"def _default_name(self):return "Design2"class Design3(i3.GDSCell):def _default_filename(self):return "SplitterTree2Levels.gds"def _default_name(self):return "Design3"class Chip(i3.PCell):def _default_name(self):return "My_Chip"unprefixed_library = i3.DefinitionProperty(doc="The names of the cells that are unprefixed")def _default_unprefixed_library(self):l = i3.Library(name="unprefixed_library")l.add(pdk.MMI1x2Optimized1550())l.add(pdk.FC_TE_1550())return lclass Layout(i3.LayoutView):def _generate_instances(self, insts):frame = pdk.Template2500x1250()frame_lv = frame.Layout()design1 = Design1(unprefixed_library=self.unprefixed_library)design1_lv = design1.Layout()design2 = Design2(unprefixed_library=self.unprefixed_library)design2_lv = design2.Layout()design3 = Design3(unprefixed_library=self.unprefixed_library)design3_lv = design3.Layout()insts += i3.SRef(reference=frame_lv,position=(0, 0),name="frame")insts += i3.ARef(reference=design1_lv,n_o_periods=(1, 12),period=(0, 100),origin=(100, 50),name="ring")insts += i3.SRef(reference=design2_lv,position=(800, 750),name="opa")insts += i3.ARef(reference=design3_lv,n_o_periods=(4, 3),period=(500, 200),origin=(600, 80),name="SplitterTree")return instsif __name__ == '__main__':chip = Chip()chip_lv = chip.Layout()chip_lv.write_gdsii("merged_chip.gds")
注意:运行该代码需要三个待拼版的gds文件
不需要加后缀的器件,可以加入到:
def _default_unprefixed_library(self):l = i3.Library(name="unprefixed_library")l.add(pdk.MMI1x2Optimized1550())l.add(pdk.FC_TE_1550())return l