如何使用SKILL获取Cadence Virtuoso原理图中连接到网络的实例引脚列表

时间:2017-06-21 13:19:20

标签: cadence cadence-virtuoso

我有多个实例连接到其中一个网络的原理图。 我需要一个SKILL函数,它将打印所有实例连接到该网络的引脚列表

2 个答案:

答案 0 :(得分:0)

procedure(CCSgetLostOfConnectedInstancePinsForNet(netname)
let((cv netid instid termid revhierarchy subcktPath pinHierName inst_list)
    ;get cellview
    cv = geGetEditCellView()

    ; get netid
    netid = dbFindNetByName(cv  netname)

    foreach(inst netid~>allInstTerms~>inst
        unless(member( inst inst_list )
            inst_list = cons(inst inst_list)
        );unless
    );foreach

    ;get instid
    foreach(instid inst_list
        ;printf("Instance %L\n" instid~>name )
        foreach(term instid~>instTerms
            when(car(term~>net~>sigNames) == netname
                termid=term
                ;printf("\tNet %L is connected to terminal %L of Instance %L\n" netname termid~>name instid~>name )
                revhierarchy = reverse(mapcar('car geGetHierMemInst()))
                subcktPath = CCSgetSubcktPath(revhierarchy)
                pinHierName=strcat( subcktPath instid~>name "/" termid~>name)
                printf("%s\n" pinHierName)
            );when
        );foreach
    );foreach
    t
);let);procedure

答案 1 :(得分:0)

或更短:

procedure( ABC_findInstsAndPinsByNet(cvId netName)
    let( (netId returnTable)
        returnTable = makeTable("ABC_findInstsAndPinsByNet" nil)
        netId = dbFindNetByName(cvId netName)
        foreach( termId netId~>instTerms
            returnTable[termId~>inst] = cons(termId~>name returnTable[termId~>inst])
        )

        returnTable ;;return
    )
)

然后阅读:

rezTbl = ABC_findInstsAndPinsByNet(cv() "net2")
printstruct(rezTbl)

,您将得到类似的东西:

printstruct(rezTbl)
Structure of type association table (table:ABC_findInstsAndPinsByNet):
  db:0x3f04079b: ("d")
  db:0x3f04079c: ("d" "g")
  db:0x3f04079a: ("s")
t

,或者如果您想解析所有内容:

foreach( elem rezTbl
    printf("%L => %L\n" elem rezTbl[elem])
)