chen9771的个人空间 https://blog.eetop.cn/?15885 [收藏] [复制] [分享] [RSS]

日志

模块

已有 204 次阅读| 2025-8-22 14:23 |系统分类:其他


hiSetBindKey("Schematics" "<Key>1" "netmax()")



procedure(netnum(ID)

let((allnet y count y1 z netname num )

allnet=foreach(mapcan x ID netna(x)~>net)

y=""

count=0

numsel=0

foreach(x allnet

if(rexMatchp(":" x) then

y1=rena(x)

count=count+length(y1)

y=strcat(y  lis(y1) ) 

else

count=count+1

y=strcat(y  x " ") 

)

)

z=parseString(y " \n")

netname=ciUtilsMakeUnique(parseString(y " \n"))

))


procedure(netmax()

let((name name1 name2 netInfo  m netname savename fps nameall)

name1=foreach(mapcar x geGetSelSet() 

 netnum(list(x))

)

name2=foreach(mapcan x geGetSelSet() 

netnum(list(x))

)

name=foreach(mapcar x geGetSelSet() 

x~>cellName

)

netInfo=makeTable('net11)

netInfo['mokuai]=name

netInfo['allnet]=name2

m=foreach(mapcar x car(name1)

list(x length(lindex(netInfo~>allnet x ?all t)) lindex(netInfo~>allnet x ?all t))

)

netInfo['m]=setof(x m cadr(x)>=2)

netInfo['out]=setof(x m cadr(x)<=2)

netname=sort( foreach(mapcar x netInfo~>m list(car(x) cadr(x)))

(lambda (f1 f2)

if( equal(cadr(f1) cadr(f2) )    then

lessp(cadr(f1) cadr(f2))

else

lessp(cadr(f2) cadr(f1)))

))

saveName = "./test.txt"

fps = outfile(saveName)

fprintf(fps "cell= %s\nconnect=%d\nnetname=\n" car(netInfo~>mokuai) length(netInfo~>m) )

foreach(mapcar z netname fprintf(fps "%L\n" z)  )

close(fps)

view(saveName)


))


procedure(rena(r)

prog((b)

r=parseString(r "<>:")

b=nil

if(length(r)>=3 then

for(i min(evalstring(nth(1,r)) evalstring(nth(2,r))) max(evalstring(nth(1,r)) evalstring(nth(2,r))) 

sprintf(x "%L", i)

b=append1(b strcat(nth(0,r) "<" x ">" ))

)

else

b=list(r)

)

return(b)

))


procedure(netna(netId)

let((name  netInfo)

       netInfo=makeTable('net)

       netInfo['pin]=netId~>terminals~>name

       netInfo['net]=netId~>terminals~>net~>name

netInfo))

 procedure(CLMessage(title button message)

    prog( ()

    hiDisplayAppDBox(

        ?name       'CLDBox

        ?dboxBanner title

        ?buttonlayout   button

        ?dboxText   message

    )

    );prog

);procedure 

procedure(lis(a )

prog((y)

y=""

foreach(x a

y=strcat(y  x "\n") 

)

 return(y)

)

)



点赞

发表评论 评论 (1 个评论)

回复 chen9771 2025-8-25 17:40
hiSetBindKey("Schematics" "<Key>3" "num()")
hiSetBindKey("Schematics" "<Key>1" "netmax(1)")

procedure(num()
let((num myColorArray myIcon field4)
if(!boundp('num) || (num==nil) then
myColorArray = hiCreateColorArray( )
myColorArray[24]=hiMatchColorByName("yellow");y
myColorArray[17]=hiMatchColorByName("red");r
myColorArray[11]=hiMatchColorByName("green");c
iconString ="000000000000000000000000000000000000000000\
000000000000000000000000000000000000000000\
000000000000000000000000000000000000000000\
000000000000rrrrrrrrrrrr000000000000000000\
000000000000rrrrrrrrrrrr000000000000000000\
000000000000rrrrrrrrrrrr000000000000000000\
000000000rrrrrrrrrrrrrrrrrrrrrrrr000000000\
000000000rrrrrrrrrrrrrrrrrrrrrrrr000000000\
000000000rrrrrrrrrrrrrrrrrrrrrrrr000000000\
000000000lllllllllyyyyyylllyyy000000000000\
000000000lllllllllyyyyyylllyyy000000000000\
000000000lllllllllyyyyyylllyyy000000000000\
000000lllyyylllyyyyyyyyylllyyyyyyyyy000000\
000000lllyyylllyyyyyyyyylllyyyyyyyyy000000\
000000lllyyylllyyyyyyyyylllyyyyyyyyy000000\
000000lllyyyllllllyyyyyyyyylllyyyyyyyyy000\
000000lllyyyllllllyyyyyyyyylllyyyyyyyyy000\
000000lllyyyllllllyyyyyyyyylllyyyyyyyyy000\
000000llllllyyyyyyyyyyyyllllllllllll000000\
000000llllllyyyyyyyyyyyyllllllllllll000000\
000000llllllyyyyyyyyyyyyllllllllllll000000\
000000000000yyyyyyyyyyyyyyyyyyyyy000000000\
000000000000yyyyyyyyyyyyyyyyyyyyy000000000\
000000000000yyyyyyyyyyyyyyyyyyyyy000000000\
000000000llllllrrrllllllrrr000000000000000\
000000000llllllrrrllllllrrr000000000000000\
000000000llllllrrrllllllrrr000000000000000\
000000lllllllllrrrllllllrrrlllllllll000000\
000000lllllllllrrrllllllrrrlllllllll000000\
000000lllllllllrrrllllllrrrlllllllll000000\
000llllllllllllrrrrrrrrrrrrllllllllllll000\
000llllllllllllrrrrrrrrrrrrllllllllllll000\
000llllllllllllrrrrrrrrrrrrllllllllllll000\
000yyyyyylllrrryyyrrrrrryyyrrrlllyyyyyy000\
000yyyyyylllrrryyyrrrrrryyyrrrlllyyyyyy000\
000yyyyyylllrrryyyrrrrrryyyrrrlllyyyyyy000\
000yyyyyyyyyrrrrrrrrrrrrrrrrrryyyyyyyyy000\
000yyyyyyyyyrrrrrrrrrrrrrrrrrryyyyyyyyy000\
000yyyyyyyyyrrrrrrrrrrrrrrrrrryyyyyyyyy000\
000yyyyyyrrrrrrrrrrrrrrrrrrrrrrrryyyyyy000\
000yyyyyyrrrrrrrrrrrrrrrrrrrrrrrryyyyyy000\
000yyyyyyrrrrrrrrrrrrrrrrrrrrrrrryyyyyy000\
000000000rrrrrrrrr000000rrrrrrrrr000000000\
000000000rrrrrrrrr000000rrrrrrrrr000000000\
000000000rrrrrrrrr000000rrrrrrrrr000000000\
000000lllllllll000000000000lllllllll000000\
000000lllllllll000000000000lllllllll000000\
000000lllllllll000000000000lllllllll000000\
000000000000000000000000000000000000000000\
000000000000000000000000000000000000000000\
000000000000000000000000000000000000000000"
myIcon = hiStringToIcon(myColorArray iconString 42 51)   
field4=  hiCreateLabel( ?name 'iconField ?labelIcon myIcon)
hiCreateAppForm(
            ?name 'num
            ?formTitle "Group1 Number"
            ?buttonLayout 'ApplyCancelDef
        
            ?fields  list(
                        list(     hiCreateStringField(
                                ?name 'number
                                ?prompt " number : "
                                ?value "1")
                                5:20 150:110 60 )
                                list(field4 200:55 50:40 ))
                     
                     ?callback list(  "netmg(evalstring(num->number->value))"   )

            ?help  ""
)
hiDisplayForm('num)
)
))

procedure(netnum(ID)
let((allnet y count y1 z netname num )
allnet=foreach(mapcan x ID netna(x)~>net)
y=""
count=0
numsel=0
allnet=foreach(mapcan x allnet parseString(x ","))
allnet=foreach(mapcar x allnet if(nindex(x "<*") then substring(x nindex(x ">")+1) else x ))
foreach(x allnet
if(rexMatchp(":" x) then
y1=rena(x)
count=count+length(y1)
y=strcat(y  lis(y1) )
else
count=count+1
y=strcat(y  x " ")
))
z=parseString(y " \n")
netname=ciUtilsMakeUnique(parseString(y " \n"))
))

procedure(netmax(num)
let((name name1 name2 netInfo  m netname savename fps nameall insts win cvPath netNames instHierPath instName netHierPath)
win=hiGetCurrentWindow()
cvPath=geGetInstHierPath(win)
geDeleteAllProbe()
name1=foreach(mapcar x geGetSelSet()
netnum(list(x))
)
name2=foreach(mapcan x geGetSelSet()
netnum(list(x))
)
name=foreach(mapcar x geGetSelSet()
x~>cellName
)
netInfo=makeTable('net11)
netInfo['mokuai]=name
netInfo['allnet]=name2
m=foreach(mapcar x car(name1)
list(x length(lindex(netInfo~>allnet x ?all t)) lindex(netInfo~>allnet x ?all t))
)
netInfo['m]=setof(x m cadr(x)>=2)
netInfo['out]=setof(x m cadr(x)<=2)
netname=sort( foreach(mapcar x netInfo~>m list(car(x) cadr(x)))
(lambda (f1 f2)
if( equal(cadr(f1) cadr(f2) )    then
lessp(cadr(f1) cadr(f2))
else
lessp(cadr(f2) cadr(f1)))
))
if(num ==1 then
saveName = "./test.txt"
fps = outfile(saveName)
fprintf(fps "cell= %s\nconnect=%d\nnetname=\n" car(netInfo~>mokuai) length(netInfo~>m) )
foreach(mapcar z netname fprintf(fps "%L\n" z)  )
close(fps)
view(saveName)
netNames=netname
            instHierPath=nil
            when(netNames
                if(cvPath==nil then
                    foreach(netName netNames
                        geAddNetProbe(win nil car(netName))
                    );end foreach
                else
                    foreach(x cvPath
                        instName=car(x)~>name
                        if(instHierPath==nil then
                            instHierPath=strcat("/" instName)
                        else instHierPath=strcat(instHierPath "/" instName)
                        );end if
                    );end foreach
                    foreach(netName netNames
                        netHierPath=strcat(instHierPath "/" car(netName))
                        geAddNetProbe(win nil netHierPath)
                    );end foreach
                );end if
            );end when
      )
    netname
))

procedure(rena(r)
prog((b)

r=parseString(r "<>:")
b=nil
if(length(r)>=3 then
for(i min(evalstring(nth(1,r)) evalstring(nth(2,r))) max(evalstring(nth(1,r)) evalstring(nth(2,r)))
sprintf(x "%L", i)
b=append1(b strcat(nth(0,r) "<" x ">" ))
)
else
b=list(r)
)
return(b)
))

procedure(netna(netId)
let((name  netInfo)
       netInfo=makeTable('net)
       netInfo['pin]=netId~>terminals~>name
       netInfo['net]=netId~>terminals~>net~>name
        netInfo))
       
procedure(CLMessage(title button message)
    prog( ()
    hiDisplayAppDBox(
        ?name       'CLDBox
        ?dboxBanner title
        ?buttonLayout   button
        ?dboxText   message
    )
    );prog
);procedure
procedure(lis(a )
prog((y)
y=""
foreach(x a
y=strcat(y  x "\n")
)
return(y)
)
)

procedure(netmg(num1)
let((symbols group1 group2 group3 y namelist mokuailist y1 y2 group22 y3 m netname connect1  fps saveName  hg netNames   instHierPath cvPath win  instName    instHierPath    instHierPath  netHierPath)
saveName = "./test1.txt"
fps = outfile(saveName)
win=hiGetCurrentWindow()
cvPath=geGetInstHierPath(win)
symbols=setof(x geGetSelSet() x~>objType== "inst")
group1=reverse(nthcdr(length(symbols)-num1 reverse(symbols)))
group2=nthcdr(num1 symbols)
geDeselectAll(hiGetCurrentWindow())
/*dan du 1 yu 3 zhengti*/
y=foreach(mapcar x group1
group3=cons(x group2)
geDeselectAll(hiGetCurrentWindow())
geSelectFigs(group3)
netmax(0)
)
namelist=foreach(mapcan x y foreach(mapcar z x car(z)))
m=foreach(mapcar x namelist
list(x length(lindex(namelist x ?all t)) lindex(namelist x ?all t))
)
m=setof(x m cadr(x)>=2)
netname=sort( foreach(mapcar x m list(car(x) cadr(x)))
(lambda (f1 f2)
if( equal(cadr(f1) cadr(f2) )    then
lessp(cadr(f1) cadr(f2))
else
lessp(cadr(f2) cadr(f1)))
))
netname=ciUtilsMakeUnique(netname)
connect=length(ciUtilsMakeUnique(namelist))
connect1=connect-length(netname)
hg=foreach(mapcan x y foreach(mapcar z x z))
y=sort(hg
(lambda (f1 f2)
if( equal(cadr(f1)    cadr(f2)  ) then
lessp(cadr(f2)   cadr(f1)   )
else
lessp( cadr(f2)   cadr(f1)   ))))
y=ciUtilsMakeUnique(y)
fprintf(fps "group1:%L and group2 :%L connect : %L connect1:%L same:%L \nnetname:%L\ngroup1same:%L\n\n" group1~>cellName group2~>cellName connect connect1 length(netname)  y netname )
/*dan du 1 yu 1 duli*/
y1=foreach(mapcan x group1
geDeselectAll(hiGetCurrentWindow())
foreach(mapcar g2 group2
geDeselectAll(hiGetCurrentWindow())
group3=list(x g2)
geSelectFigs(group3)
netmax(0)
))
count=0
foreach(x group1~>cellName
foreach(y group2~>cellName
fprintf(fps "cell1%L and cell2%L connect:%L\nnetname:%L\n\n" x y length(nth(count y1)) nth(count y1))
count=count+1
))
geDeselectAll(hiGetCurrentWindow())
close(fps)
view(saveName)
netNames=y
            instHierPath=nil
            when(netNames
                if(cvPath==nil then
                    foreach(netName netNames
                        geAddNetProbe(win nil car(netName))
                    );end foreach
                else
                    foreach(x cvPath
                        instName=car(x)~>name
                        if(instHierPath==nil then
                            instHierPath=strcat("/" instName)
                        else instHierPath=strcat(instHierPath "/" instName)
                        );end if
                    );end foreach
                    foreach(netName netNames
                        netHierPath=strcat(instHierPath "/" car(netName))
                        geAddNetProbe(win nil netHierPath)
                    );end foreach
                );end if
            );end when
))

facelist

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

  • 12

    周排名
  • 0

    月排名
  • 0

    总排名
  • 1

    关注
  • 1

    粉丝
  • 2

    好友
  • 1

    获赞
  • 2

    评论
  • 24

    访问数
关闭

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


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

GMT+8, 2025-8-28 12:10 , Processed in 0.017624 second(s), 8 queries , Gzip On, Redis On.

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