Bin.wang的个人空间 https://blog.eetop.cn/1779684 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

MOS_SDG_METAL1.il

已有 121 次阅读| 2025-6-24 13:49 |系统分类:芯片设计

;dbCopyFig,                Copies and transforms a figure,and places it in a cellview
;leConvertPolygonToPath,    convert a path,that you can replaced the ptah with same boundary as the polygon
;dbLayerAndNot,            Find the areas of A do not overlap B and create the results in layer in cellview
;mapcar,                    calcaulate the element of list one by one
;dbDeleteObject,         Delete object
;lessp,                    check the first argument is less than the second arugument

procedure(MOS_SDG_METAL1()
    let((cv instlist tech)

        cv=geGetEditCellView()
        instlist=geGetSelSet()
        tech=techGetTechFile(cv)

        SD_M1_Width=0.16
        GT_Width=0.22
        CT_M1_enc=0.05
        CT_Space=0.16
        CT_Width= 0.12
        GT_M1_Width=CT_M1_enc*2+CT_Width

        M1_Layer=list("M1" "drawing")
        AA_Layer=list("ACT" "drawing")
        POLY_Layer=list("POLY" "drawing")
        CT="M1_POLY"

        Direction_GT=0;0=>top or right,1=>bottom or left

    foreach(inst instlist
        Add_SD_Metal1(inst)
        Add_GT_Metal1(inst)
    );foreach
    );let
);end MOS_SDG_METAL1

procedure(Add_SD_Metal1(inst)
    let((sd_metal1 temp0 shapes)
        temp0_SD_List=nil
        shapes=inst~>master~>shapes
        shapes=setof(one shapes one~>lpp == M1_Layer)
    foreach(shape shapes
        sd_metal1=dbCopyFig(shape cv inst~>transform)
        temp0=leConvertPolygonToPath(sd_metal1)        
        temp0~>width=SD_M1_Width
        temp0_SD_List=append1(temp0_SD_List temp0)
    );foreach shapes
    );let
);end Add_SD_Metal1

procedure(Add_GT_Metal1(inst)
    let((aa_shapes_list poly_shapes_list shapes gt_poly gt_aa gate_shapes anBBox anBBox_poly anBBox_m1 cPt)
        shapes=inst~>master~>shapes
        aa_shapes_list=setof(one shapes one~>lpp == AA_Layer)
        poly_shapes_list=setof(one shapes one~>lpp == POLY_Layer)

        temp0_AA_List=nil
    foreach(shape aa_shapes_list
        gt_aa=dbCopyFig(shape cv inst~>transform)
        temp0_AA_List=append1(temp0_AA_List gt_aa)
    );foreach

        temp0_POLY_List=nil
    foreach(shape poly_shapes_list
        gt_poly=dbCopyFig(shape cv inst~>transform)
        temp0_POLY_List=append1(temp0_POLY_List gt_poly)
    );foreach

        newshapes_List=dbLayerAndNot(cv POLY_Layer temp0_POLY_List temp0_AA_List)
        mapcar(lambda((xx) dbDeleteObject(xx)) temp0_POLY_List)
        mapcar(lambda((xx) dbDeleteObject(xx)) temp0_AA_List)
        gate_shapes_list=Direction_Chooce(inst newshapes_List)
    foreach(gate_shapes gate_shapes_list
        anBBox=gate_shapes~>bBox
        if(Direction_GT == 0 && Direction_mos == "V" then
            anBBox_poly=list(leftEdge(anBBox):bottomEdge(anBBox) rightEdge(anBBox):topEdge(anBBox)+GT_Width)
            anBBox_m1=list(leftEdge(anBBox_poly):topEdge(anBBox_poly)-GT_M1_Width rightEdge(anBBox_poly):topEdge(anBBox_poly))
        );if
        
        if(Direction_GT == 0 && Direction_mos == "H" then
            anBBox_poly=list(rightEdge(anBBox)+GT_Width:bottomEdge(anBBox) leftEdge(anBBox):topEdge(anBBox))
            anBBox_m1=list(leftEdge(anBBox_poly)-GT_M1_Width:bottomEdge(anBBox_poly) leftEdge(anBBox_poly):topEdge(anBBox_poly))
        );if        
    
        if(Direction_GT == 1 && Direction_mos == "V" then
            anBBox_poly=list(leftEdge(anBBox):topEdge(anBBox) rightEdge(anBBox):bottomEdge(anBBox)-GT_Width)
            anBBox_m1=list(leftEdge(anBBox_poly):topEdge(anBBox_poly)+GT_M1_Width rightEdge(anBBox_poly):topEdge(anBBox_poly))
        );if

        if(Direction_GT == 1 && Direction_mos == "H" then
            anBBox_poly=list(leftEdge(anBBox)-GT_Width:bottomEdge(anBBox) rightEdge(anBBox):topEdge(anBBox))
            anBBox_m1=list(leftEdge(anBBox_poly):bottomEdge(anBBox_poly) leftEdge(anBBox_poly)+GT_M1_Width:topEdge(anBBox_poly))
        );if
        
;        printf("debug=>anBBox_poly==%L\n" anBBox_poly)
;        printf("debug=>anBBox_m1==%L\n" anBBox_m1)
        gate_shapes~>bBox=anBBox_poly
        cPt=hiBoxCenter(anBBox_m1)
        Add_Via(cPt anBBox_m1 CT "R0")
    );foreach
);let
);end Add_GT_Metal1

procedure(Direction_Chooce(inst newShapes)
    prog((xcoord_list shapes_tmp yy_offset mylist_X mylist_Y xx)
        mylist_X=nil
        mylist_Y=nil
        shapes_tmp=nil
    foreach(one newShapes
        mylist_X=append1(mylist_X xCoord(hiBoxCenter(one~>bBox)))
        mylist_Y=append1(mylist_Y yCoord(hiBoxCenter(one~>bBox)))
    );foreach
        mylist_X=sort(mylist_X lambda((a b) lessp(a b)))
        mylist_Y=sort(mylist_Y lambda((a b) lessp(a b)))
    cond(
        (inst~>orient == "R0"||inst~>orient == "R180"||inst~>orient == "MY"||inst~>orient == "MX"
        Direction_mos="V"
            if(Direction_GT == 0 then
                foreach(xx newShapes
                    if(yCoord(hiBoxCenter(xx~>bBox)) != car(mylist_Y) then
                    shapes_tmp=append1(shapes_tmp xx)
                    else dbDeleteObject(xx)
                    );if
                );foreach
            return(shapes_tmp)
            else
                foreach(xx newShapes
                    if(yCoord(hiBoxCenter(xx~>bBox)) != nth(length(mylist_Y)-1 mylist_Y) then
                    shapes_tmp=append1(shapes_tmp xx)
                    else dbDeleteObject(xx)
                    );if
                );foreach
            return(shapes_tmp)
            );if
        );case1
        (inst~>orient == "R90"||inst~>orient == "R270"||inst~>orient == "MYR90"||inst~>orient == "MXR90"
        Direction_mos="H"
            if(Direction_GT == 0 then
                foreach(xx newShapes
                    if(xCoord(hiBoxCenter(xx~>bBox)) != car(mylist_X) then
                    shapes_tmp=append1(shapes_tmp xx)
                    else dbDeleteObject(xx)
                    );if
                );foreach
            return(shapes_tmp)
            else
                foreach(xx newShapes
                    if(xCoord(hiBoxCenter(xx~>bBox)) != nth(length(mylist_X)-1 mylist_X) then
                    shapes_tmp=append1(shapes_tmp xx)
                    else dbDeleteObject(xx)
                    );if
                );foreach
            return(shapes_tmp)
            );if
        );case2
        );cond
    );prog
);end Direction_Chooce

procedure(Add_Via(cPt anBBox_m1 viaName Rotation)
    let((viaDefld viaParams_list temp overlap_width overlap_height)
        overlap_width=abs(xCoord(nth(0 anBBox_m1))-xCoord(nth(1 anBBox_m1)))
        overlap_height=abs(yCoord(nth(0 anBBox_m1))-yCoord(nth(1 anBBox_m1)))
        viaDefld=techFindViaDefByName(tech viaName)
        viaParams_list=ViaParams(viaDefld~>name overlap_width overlap_height)
        ;printf("debug=>viaParams== %L\n"viaParams_list)

        temp=dbCreateVia(cv viaDefld cPt Rotation viaParams_list)
    ) ;let
);end Add_Via

procedure(ViaParams(vianame overlap_width overlap_height)
    prog((rows columns viaParams)
        rows=floor((overlap_height-CT_M1_enc*2.0+CT_Space+0.01)/(CT_Width+CT_Space))
;        printf("debug=>rows=%L\n" rows)
          columns=floor((overlap_width-CT_M1_enc*2.0+CT_Space+0.01)/(CT_Width+CT_Space))
;        printf("debug=>columns=%L\n" columns)
              if(rows<=1 then rows=1
              );if
              if(columns<=1 then columns=1
              );if
          ;printf("debug=> %L ==  %L  %L ==  %L \n" CT_M1_enc CT_Space  rows colums)
        viaParams=list(
                    list("cutSpacing" list(CT_Space CT_Space)) ;via1 space
                       list("layer1Enc" list(CT_M1_enc CT_M1_enc));via1 enc
                       list("layer2Enc" list(CT_M1_enc CT_M1_enc));via1 enc
                       list("cutRows"  rows)
                       list("cutColumns"  columns)
                    );list
          return(viaParams)
);prog
);end ViaParams


点赞

全部作者的其他最新日志

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 17

    周排名
  • 11

    月排名
  • 0

    总排名
  • 1

    关注
  • 1

    粉丝
  • 0

    好友
  • 1

    获赞
  • 0

    评论
  • 3

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 手机版| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-7-2 18:28 , Processed in 0.015359 second(s), 8 queries , Gzip On, MemCached On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部