⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 net_editor.il

📁 skill语言在Cadence平台二次开发中大量使用
💻 IL
📖 第 1 页 / 共 5 页
字号:
                oktorun = axlUIYesNo( pmptmess )
                if(oktorun == t then
                        pindlf = outfile("ia_net_edit_tmp_in_file.txt")
                        fprintf( pindlf "$PINS\n$ADD\n%s ; %s.%s\n$END\n"
                        car(netnme)->name car(pingrp)->parent->refdes car(pingrp)->number)
                        close( pindlf)
                        oktorun = t
                else
                        pingrp = nil
                        allfound = nil
                        netfound = nil
                );endif
        );endwhen
        );ednunless
        unless( oktorun == nil
                _INENetIn()
        );endunless
        axlUIPopupSet(nil)
        axlClearSelSet()
        unless( doneit == t
                axlFormClose( _INESFormPtr )
                axlFlushDisplay()
                _INEStart()
        );endunless
);endprog
);enddfun
;----------------------Add Pin To Net By Pin Name ------------------------------
defun( _INEAdd_Pin_Name ()
prog( ()
        axlCancelEnterFun()
        newpin_name = nil
        pincount = count = nil
        refdesids = nil
        axlClearSelSet()
        axlSetFindFilter( ?enabled (list "noall" "symbols") ?onButtons (list "symbols"))
        axlAddSelectAll()
        refdesids = axlGetSelSet()
        looking = plook = nil
        while( looking == nil && plook == nil
                axlSetFindFilter( ?enabled (list "noall" "pins") ?onButtons (list "pins"))
                newpin_name = axlUIPrompt("Enter Refdes.Pinnum" "")
                if( newpin_name == nil then
                        looking = t
                        plook = t
                        axlCancelEnterFun()
                        _INECancel()
                else
                        when( newpin_name != ""
                                newpin_name = upperCase(newpin_name)
                                rdpinlst = parseString( newpin_name ".")
                                refdesg = nthelem( 1 rdpinlst)
                                pinidno = nthelem( 2 rdpinlst)
                                count = 1
                                while( nthelem(count refdesids) && looking == nil
                                        if( nthelem(count refdesids)->refdes == refdesg then
                                                pinlist = nthelem( count refdesids)->pins
                                                pcount = 1
                                                while( nthelem(pcount pinlist) && plook == nil
                                                        when( nthelem(pcount pinlist)->number == pinidno
                                                                if( nthelem(pcount pinlist)->net->name == "" then
                                                                        pingrp = list(nthelem( pcount pinlist))
                                                                        pinfound = t
                                                                        axlMsgPut(" %s Selected" newpin_name)
                                                                else
                                                                        axlMsgPut(" Pin Assigned to a Net. Try Again.")
                                                                );endif
                                                                plook = t
                                                        );endwhen
                                                        ++pcount
                                                );endwhile
                                                unless( (plook == t) axlMsgPut("Pin Number Not Found. Try Again."))
                                                looking = t
                                        );endif
                                        ++count
                                );endwhile
                                unless( (looking == t) axlMsgPut("RefDes Not Found, Try Again."))
                        );endwhen
                );endif
                unless(pingrp == nil axlHighlightObject( pingrp))
        );endwhile
        axlMsgPut("%L" pingrp )
        axlClearSelSet()
        return( pingrp)
);endprog
);enddefun
;---------------------------------Select Net Name to Add Pin To ----------------
defun( _INEAddPinNetName ()
prog( ()
        axlCancelEnterFun()
        doneit = nil
        good = nil
        netname = axlUIPrompt( "Enter Net Name To Add Pin To." "")
        if( netname != nil then
                netname = upperCase(netname)
                if( netname == "" then
                        axlMsgPut(" No Net Name Selected.")
                        allfound = nil
                else
                        axlSetFindFilter( ?enabled '( "noall" "nets") ?onButtons '("nets"))
                        axlAddSelectAll()
                        netnamelist = axlGetSelSet()
                        foreach( net netnamelist
                                when( net->name == netname
                                        netnme = list(net)
                                        netfound = t
                                        good = t
                                        allfound = t
                                );endwhen
                        );endeach
                        when(good == nil
                                axlMsgPut(" Net Not Found, Try Again.")
                                allfound = nil
                                netfound = nil
                        );endwhen
                );endif
                axlClearSelSet()
                return( netnme )
        else
                axlClearSelSet()
                axlCancelEnterFun()
                _INECancel()
        );endif
);endprog
);enddfun
;--------------------Change Pin by Pick to New Net From Old --------------------
; This function will call routines to find a pin, verify the pin is not assigned
; to a net. Then request a net name and verify that net exists. then Add pin to
; the net.
;--------------------------------------------------------------------------------
defun( _INEChg_Pin_Commands ()
prog( ()
        _INEInitVar()
        good = nil
        pinfound = nil
        netfound = nil
        netnme = nil
        oldnetname = nil
        _INEPopUpChgPin()
        while( allfound == nil
                axlMsgPut(" Select Pin To Be Changed.")
                axlSetFindFilter( ?enabled '( "noall" "pins") ?onButtons '("pins"))
                axlSingleSelectPoint()
                when( pinfound == nil pingrp = axlGetSelSet())
                when(pingrp != nil && ooped != t
                        axlMsgPut("Pin %s.%s Selected." car( pingrp )->parent->refdes
                                         car(pingrp)->number)
                        pinfound = t
                );endwhen
                while(pingrp != nil && netfound == nil
                        axlClearSelSet()
                        axlHighlightObject( car(pingrp))
                        axlUIPopupSet(nil)
                        _INEPopUpAddPinNet()
                        axlMsgPut(" Select Net to Add Pin To.")
                        axlSetFindFilter( ?enabled '( "noall" "nets") ?onButtons '("nets"))
                        axlSingleSelectPoint()
                        if( ooped == nil then
                                when(netnme == nil
                                        netnme = axlGetSelSet()
                                        good = t
                                );endwhen
                                if( car(netnme)->name  == "" then
                                        axlMsgPut("No Net Name, Please Select Again.")
                                        netfound = nil
                                else
                                        unless( netnme == nil
                                        when(good == t && nthelem(2 netnme) == nil
                                                allfound = t
                                                netfound = t
                                        );endwhen
                                        );endunless
                                );endif
                        else
                                ooped = nil
                                pinfound = nil
                        );endif
                );endwhile
        );endwhile
        axlDehighlightObject(pingrp)
        axlUIPopupSet(nil)
        unless(doneit == t
                if(netfound == t && pinfound == t then
                        if( car(pingrp)->net->name == "" then
                                oldnetname = "Un-Named"
                        else
                                oldnetname = car(pingrp)->net->name
                        );endif
                        axlHighlightObject(pingrp)
                        axlHighlightObject( netnme )
                        sprintf( pmptmess "Pin %s.%s Will Changed From\n Old Net %s to New Net %s\n"
                                car( pingrp )->parent->refdes car(pingrp)->number oldnetname car(netnme)->name)
                        oktorun = axlUIYesNo( pmptmess )
                        axlDehighlightObject(pingrp)
                        axlDehighlightObject(netnme)
                        if(oktorun == t then
                                pindlf = outfile("ia_net_edit_tmp_in_file.txt")
                                fprintf( pindlf "$PINS\n")
                                when( car(pingrp)->net->name != ""
                                        fprintf( pindlf "$DELETE\n%s.%s\n" car(pingrp)->parent->refdes car(pingrp)->number)
                                );endwhen
                                fprintf( pindlf "$ADD\n%s ; %s.%s\n$END\n" car(netnme)->name car(pingrp)->parent->refdes car(pingrp)->number)
                                close( pindlf)
                        else
                                pingrp = nil
                                allfound = nil
                                netfound = nil
                        );endif
                );endif
                when( isFile("ia_net_edit_tmp_in_file.txt") _INEDelNetIn())
                axlClearSelSet()
                axlFormClose( _INESFormPtr )
                axlFlushDisplay()
                axlUIPopupSet(nil)
                _INEStart()
        );endunless
);endprog
);enddfun
;-------------------------Change Pin By Pin Name to a New Net ------------------
defun( _INEChg_Pin_Name ()
prog( ()
        axlCancelEnterFun()
        newpin_name = nil
        pincount = count = nil
        refdesids = nil
        axlClearSelSet()
        axlUIPopupSet(nil)
        axlSetFindFilter( ?enabled (list "noall" "symbols") ?onButtons (list "symbols"))
        axlAddSelectAll()
        refdesids = axlGetSelSet()
        looking = plook = nil
        while( looking == nil && plook == nil
                axlSetFindFilter( ?enabled (list "noall" "pins") ?onButtons (list "pins"))
                newpin_name = axlUIPrompt("Enter Refdes.Pinnum" "")
                if( newpin_name == nil then
                        looking = t
                        plook = t
                        axlCancelEnterFun()
                        _INECancel()
                else
                        unless( newpin_name == ""
                                newpin_name = upperCase(newpin_name)
                                rdpinlst = parseString( newpin_name ".")
                                refdesg = nthelem( 1 rdpinlst)
                                pinidno = nthelem( 2 rdpinlst)
                                count = 1
                                while( nthelem(count refdesids) && looking == nil
                                        when( nthelem(count refdesids)->refdes == refdesg
                                                pinlist = nthelem( count refdesids)->pins
                                                pcount = 1
                                                while( nthelem(pcount pinlist) && plook == nil
                                                        when( nthelem(pcount pinlist)->number == pinidno
                                                                pingrp = list(nthelem( pcount pinlist))
                                                                pinfound = t
                                                                axlMsgPut(" %s Selected" newpin_name)
                                                                plook = t
                                                        );endwhen
                                                        ++pcount
                                                );endwhile
                                                unless( (plook == t) axlMsgPut("Pin Number Not Found. Try Again."))
                                                looking = t
                                        );endwhen
                                        ++count
                                );endwhile
                                unless( (looking == t) axlMsgPut("RefDes Not Found, Try Again."))
                        );endunless
                );endif
                unless(pingrp == nil axlHighlightObject( pingrp))
        );endwhile
        axlUIPopupSet(nil)
        axlClearSelSet()
        return( pingrp)
);endprog
);enddefun

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -