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

📄 net_editor.il

📁 skill语言在Cadence平台二次开发中大量使用
💻 IL
📖 第 1 页 / 共 5 页
字号:
defun( _INEAddNetPinCompl ()
prog( ()
        setq( allfound t)
        axlCancelEnterFun()
        axlUIPopupSet(nil)
);endprog
);enddefun
;================================================================================
;=================================== Add Net Functions ==========================
;================================================================================
;------------------------Function call Sets for new net -------------------------
defun( _INENew_Net_Commands ()
prog( ()
        _INEInitVar()
        picknet = t
        pingrp = nil
        _INEPopUpAddNet()
        while( allfound == nil
                if(picknet == t then
                        _INEAddNetPick()
                else
                        _INEGetPinName()
                );endif
        );end-while
        axlUIPopupSet(nil)
        unless( pingrp == nil
                _INEBldNetFile()
                _INENetIn()
                axlClearSelSet()
        );endunless
        unless( doneit == t
                axlClearSelSet()
                axlFormClose( _INESFormPtr )
                axlFlushDisplay()
                axlUIPopupSet(nil)
                _INEStart()
        );endunless
);endprog
);enddefun
;------------------------Select Pins for adding new net -------------------------
; This function will locate a pin, verify that a net does not already exist and
; then store the data to build a net in file, incremental type, later.
;-------------------------------------------------------------------------------
defun( _INEAddNetPick ()
prog( ( )
        getpin = nil
        axlClearSelSet()
        unless( pingrp == nil axlHighlightObject( pingrp))
        getpin = nil
        axlSetFindFilter( ?enabled (list "noall" "pins") ?onButtons (list "pins"))
        axlMsgPut("Select Pin.")
        axlSingleSelectPoint( )
        setq( getpin axlGetSelSet())
        if( getpin != nil then
                unless( (getpin == nil && allfound == nil)
                        axlMsgPut("%s.%s Selected." car(getpin)->parent->refdes
                                car(getpin)->number)
                        if( car(getpin)->net->name == "" then
                                pingrp = cons( nthelem(1 getpin) pingrp)
                                axlHighlightObject( pingrp)
                                axlClearSelSet()
                        else
                                axlHighlightObject( car(getpin))
                                axlMsgPut(" Pin Assigned to a Net. Select Again.")
                                axlDehighlightObject( car(getpin))
                        );endif
                );endunless
        else
                when( (getpin == nil && allfound == nil)
                        unless( ooped == t  axlMsgPut("No Pin Found, Try Again."))
                );endwhen
        );endif
        return( pingrp)
);endprog
);enddefun
;-------------------------Select Pin by Name to add to new net ------------------
; This function will look for refdes and pin number, then verify if a net exists
; then if not net exists add the selection to the pin group variable set, to be
; input to the incremental net list.
;--------------------------------------------------------------------------------
defun( _INEGetPinName ()
prog( ()
        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
                        axlCancelEnterFun()
                        looking = t
                        plook = t
                        _INECancel()
                else
                        if( newpin_name != "" then
                                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
                                                        if( nthelem(pcount pinlist)->number == pinidno then
                                                                if( nthelem(pcount pinlist)->net->name == "" then
                                                                        pingrp = cons(nthelem( pcount pinlist) pingrp)
                                                                        axlMsgPut(" %s Selected" newpin_name)
                                                                else
                                                                        axlMsgPut(" Pin Assigned to a Net. Try Again.")
                                                                );endif
                                                                plook = t
                                                        );endif
                                                        ++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."))
                        );endif
                );endif
                unless(pingrp == nil axlHighlightObject( pingrp))
        );endwhile
        picknet = t
        return( pingrp)
);endprog
);enddefun
;-------------------------Build Net List Data for add net -----------------------
; This funtion will ask for a net name, verify the net name does not exist, then
; verify all selections are correct. After which the load net list is invoked.
;--------------------------------------------------------------------------------
defun( _INEBldNetFile ()
prog( ()
        if(  pingrp != nil && nthelem( 2 pingrp) == nil then
                axlUIConfirm("Only One Pin Selected, No action Taken")
        else
                axlDehighlightObject( pingrp )
                axlUIPopupSet(nil)
                netids = netid = netverify= netverpin = nil
                verifyok = nil
                foundone = t
                tmpname = ""
                axlSetFindFilter( ?enabled ( list "nets" )  ?onButtons ( list "nets" ) )
                axlAddSelectAll()
                netids = axlGetSelSet()
 
                while( foundone == t
                        newnetname = axlUIPrompt(" Enter New Net Name" "")
                        if(newnetname == nil then
                                pingrp = nil
                                 _INECancel()
                                foundone = nil
                                return()
                        else
                                newnetname = upperCase(newnetname)
                                foundone = nil
                                unless( (newnetname == "")
                                        foreach( netid netids
                                                when( netid->name == newnetname foundone = t)
                                        );endforeach
                                        unless( (foundone == nil) axlMsgPut("Net Name Already Exists!"))
                                );endunless
                        );endif
                );endwhile
                unless( newnetname == nil
                        if(newnetname == "" then
                                tmpname = "Un-named"
                        else
                                tmpname = newnetname
                        );endif
                        sprintf( netverify "The Following Pins Will be Attached to\n net name: %s\n" tmpname)
                        foreach( pinid pingrp
                                sprintf( netverpin "%s.%s\n" pinid->parent->refdes pinid->number)
                                netverify = strcat( netverify netverpin)
                        );endforeach
                        verifyok = axlUIYesNo( netverify)
                        unless( (verifyok == nil)
                                netaddfl = outfile("ia_net_edit_tmp_in_file.txt")
                                fprintf( netaddfl "$NETS\n$ADD\n%s ; " newnetname)
                                foreach( pinid pingrp fprintf( netaddfl ",\n %s.%s" pinid->parent->refdes pinid->number))
                                fprintf( netaddfl "\n$END\n")	;This line was changed to END from DONE for PE13.x
                                close( netaddfl)
                        );endunless
                );endunless
        );endif
        when( newnetname == nil
                pingrp = nil
                _INECancel()
        );endwhen
        pingrp = nil
        return(pingrp)
);endprog
);enddefun
;--------------------------Net IN Routine For Add Net ---------------------------
; This funtion Operates the netin scripts, the suspends all funtions and leaves
; a done popup to exit this program
;--------------------------------------------------------------------------------
defun( _INENetIn ()
        when( isFile("ia_net_edit_tmp_in_file.txt")
		    l_bBox=axlWindowBoxGet()	;Save the current window view
                axlMsgPut("Updating Database.")
                axlClearSelSet()
                axlUIPopupSet(nil)
                axlShell("scriptmode +invisible")
                axlShell("scriptmode +noinfo")
                axlShell("setwindow pcb")
                axlShell("netin param")
                axlShell("setwindow form.niparams")
		    axlShell("FORM niparams netin_netlist YES") 
                axlShell("FORM niparams filename ia_net_edit_tmp_in_file.txt")
                axlShell("FORM niparams options")
                axlShell("FORM niparams syntax_check_only NO")
                axlShell("FORM niparams supercede NO")
                axlShell("FORM niparams append_device_log NO")
                axlShell("FORM niparams remove_etch NO")
                axlShell("FORM niparams place_never YES")
                axlShell("FORM niparams Done")
                axlShell("setwindow pcb")
                axlShell("scriptmode -invisible")
                axlShell("scriptmode -noinfo")
                deleteFile( "ia_net_edit_tmp_in_file.txt")
		    axlWindowBoxSet(l_bBox)	;Restore the window view
                return()
        );endwhen
);enddefun
;================================================================================
;================================ Delete Net Functions ==========================
;================================================================================
;------------------------Function call Sets for new net -------------------------
defun( _INEDel_Net_Commands ()
prog( ()
        _INEInitVar()
        stpprocess = nil
        doneit = nil
        picknet = t
        netpickid = nil
        _INEPopUpDelNet()
        while( allfound == nil
                when(picknet == t _INEDelNetPick())
                when(picknet == nil _INEGetNetName())
        );end-while
        axlUIPopupSet(nil)
        unless( doneit == t _INEDelNetIn())
        axlClearSelSet()
        unless( stpprocess == t
                axlFormClose( _INESFormPtr )
                axlFlushDisplay()
                axlUIPopupSet(nil)
                _INEStart()
        );endunless
);endprog
);enddefun
;--------------------------- Find Net By Pick ----------------------------------
;       This function will locate a net by pick.
;-------------------------------------------------------------------------------
defun( _INEDelNetPick ()
prog( ()
        axlSetFindFilter( ?enabled '( "noall" "nets") ?onButtons '("nets"))
        axlSingleSelectPoint()
        netpickid = axlGetSelSet()
        if( car(netpickid)->name == "" || netpickid == nil then
                unless( ooped == t axlMsgPut(" No Net Found. Select again."))
        else
                axlHighlightObject( netpickid)
                sprintf( pmptmess "Net Name %s Will Be Delete!" car(netpickid)->name )

⌨️ 快捷键说明

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